Issue running SDL Cpp based applicaton - c++

I Have never used SDL and have not coded in C/C++ this last 4 years so I m rusty somehow.
I have found an interesting project on github and I want to run it.
I have a kali linux distribution,
First I installed DotNet that I believe is fine since calling DotNet from terminal gives response from the console tool. I also installed CMake.
Then I successfully installed SDL2 using the vcpkg tool. the compiler is recognizing all the sources dependencies.
But when I run the app I m getting this prompt error
[Running] cd "/opt/workspaces/dvr/sdl/Media-Player/" && g++ main.cpp -o main && "/opt/workspaces/dvr/sdl/Media-Player/"main
In file included from main.cpp:1:
Core.h:8:10: fatal error: SDL2/SDL.h: No such file or directory
8 | #include "SDL2/SDL.h"
| ^~~~~~~~~~~~
compilation terminated.
My sdl2 headers are located on the vcpkg folder in /opt/workspaces/dvr/vcpkg/packages/sdl2_x64-linux/include/SDL2
What should I do to fix this

Related

How do i compile and use mariadb c++ Connector library in debian 10?

Setup: Beagleboneblack, debian10, arm, mariadb v10.3.36.
Following this guide: https://mariadb.com/docs/connect/programming-languages/cpp/install/
I reach this step:
$ sudo install include/mariadb/* /usr/include/mariadb/
when executing the above command I get the following message; install: omitting directory 'include/mariadb/conncpp'
I ran through the rest of the Install MariaDB Connector/C++
guide, but when i try to compile my task.cpp app using:
$ g++ -o tasks tasks.cpp -std=c++11 -lmariadbcpp
following this example: https://mariadb.com/docs/connect/programming-languages/cpp/sample-app/ i get:
# g++ -o tasks task.cpp -std=c++11 -lmariadbcpp
task.cpp:3:10: fatal error: mariadb/conncpp.hpp: No such file or directory
#include <mariadb/conncpp.hpp>
The main issue is with the -lmariadbcpp i think, its not installed in the correct place or whatever. Can someone explain to me how mariadb connector-library is installed, where it resides, and how i can use it when compiling?
It might be i can't use the c++ connector with my version of mariadb, since c++ connector requires that its a "enterprise" version of maria db. However it should be able to compile/install. Please help me understand the installation process of a library in debian? ?? :)
Update:
After some struggle, it seems i can install the files by cd into the include directories and installing the files manually be explicitly using the file name. Atleast i think there is some progress now...

make*** error 126 when trying to compile rstan with Rtools 3.5/Rv3.5.1

I am using R v.3.5.1, R studio v 1.3.1093 with Rtools 3.5 on windows 10.
I know that R tools have been successfully installed and the toolchain has been found, having followed https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows and successfully installing:
install.packages("jsonlite",type="source").
However, when I try and install rstan from source using
pkgbuild::with_build_tools(install.packages("rstan", type = "source"))
I get the following error message:
sh: C:/Rtools/mingw_32/bin/: Is a directory
make: *** [C:/PROGRA~1/R/R-35~1.1/etc/i386/Makeconf:215: sparse_extractors.o] Error 126
ERROR: compilation failed for package 'rstan'
* removing 'C:/R/library/rstan'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘rstan’ had non-zero exit status
Currently, my makevars.win file contains the following:
CXX14 = C:/Rtools/mingw_$(WIN)/bin/ g++ -std=c++1y
CXX14FLAGS = -O3 -Wno-unused-variable -Wno-unused-function
Although I have tried various different lines in the makevars file and all still bring up the error 126 message as above.
I can successfully install the binary versions of rstan/rstanarm/brms etc. But when I try and compile a model it fails. When I tried this and realised the binary versions were not working, I uninstalled rstan/rstanarm and brms before trying to install the source versions.
Any help fixing this error and successfully installing rstan would be greatly appreciated!
There is a space before g++ which causes the Makefile to execute the directory (which fails as it is not an executable).
Remove the space.

【MacOSX 10.15.1】Use odb generate database, fatal error: wchar.h: No such file or directory #include <wchar.h>

odb -d mysql --generate-query --generate-schema person.hxx
In file included from /usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/bits/postypes.h:40:0,
from /usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/bits/char_traits.h:40,
from /usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/string:40,
from <standard-odb-prologue>:7:
/usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/cwchar:44:19: fatal error: wchar.h: No such file or directory
#include <wchar.h>
Try reinstalling your XCode Command Line Tools like shown in this link with
xcode-select --install
This helped me today with compiling a program with gcc-9 installed with brew on Mac OS X Catalina to which I updated yesterday.
Mac OS updates usually mess up the location of the headers, this may be your case, too.
See also this question
Try to specify the include directory of XCode command line tools by adding to your odb the following:
-I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
if this doesn't work, double check the path. Sometimes you would find the SDK directory is MacOSX xx.xx.x instead of MacOSX.sdk

Makefile error raspberry-pi 3

I have an issue with Codelite compilation, running on raspbian jessie - these are the (known) steps I have taken to produce it.
First I installed Codelite with apt-get install Codelite, then produced a c++ project.
When running build project I get the error:
/bin/sh -c ' -j 4 -e -f Makefile'
/bin/sh: 1: -j: not found
0 errors, 0 warnings
I note that this error has been found and corrected previously, through running a different version of Codelite from 6.1.1 (that which apt-get installs). I therefore found the updated version of armhf .deb codelite from the rasbian archive with gdebi-gtk. However the updated version (9.1.1) produces the following error (install attempt with the graphical debian):
Error: Dependency is not satisfiable: libclang 1-3.8 (>=3.2)
I do not understand why the package manager cannot update these packages - do they not exist for the pi? I ran the manager as root, so I do not think it is a permissions issue.
EDIT 1:
Thank you for that Fabre. My Enviromental Variables file now looks like this:
CodeLiteDir=/usr/share/codelite
export MAKE=make
I still get the same error however.

qprinter not found in C++

This is a very basic question. I have searched the history of the of this forum and not found anything directly applicable to this app in C/C++.
I am building the code on Fedora20. I have the following libraries, installed using yum:
qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtscript-devel
qt5-qtwebkit-devel qt5-qtsvg-devel qt5-qttools-devel
[root#localhost subsurface]# qmake-qt5 --version
QMake version 3.0
Using Qt version 5.4.0 in /usr/lib64
I use qmake like this:
make-qt5
No errors displayed, I assume make file ok and header files generated are ok.
Upon make, the following Qt-related errors:
[root#localhost subsurface]# make
(1)
compiling main.cpp
In file included from /usr/include/QtGui/QTextEdit:1:0,
from .uic/ui_mainwindow.h:26,
from qt-ui/mainwindow.h:14,
from main.cpp:11:
/usr/include/QtGui/qtextedit.h:235:16: error: ‘QPrinter’ has not been declared
void print(QPrinter *printer) const;
^
(2)
In file included from qt-ui/tableview.h:10:0,
from .uic/ui_diveplanner.h:26,
from qt-ui/diveplanner.h:140,
from .uic/ui_mainwindow.h:30,
from qt-ui/mainwindow.h:14,
from main.cpp:11:
.uic/ui_tableview.h: In member function ‘void Ui_TableView::retranslateUi(QGroupBox*)’:
.uic/ui_tableview.h:49:87: error: ‘UnicodeUTF8’ is not a member of ‘QApplication’
TableView->setWindowTitle(QApplication::translate("TableView", "GroupBox", 0, QApplication::UnicodeUTF8));
I suspect I am missing one or two more Qt libraries. Which library files contain QPrinter and UnicodeUTF8?
Any advice, please?
Kind regards,
willem
This worked for me on PacketSender-2.0 project
# yum remove qt-devel
# yum install qt5-qtbase-devel -y
$ make clean
$ qmake-qt5
$ make