Building GLEW with MSYS: X11 not found - c++

When trying to make GLEW with MSYS, I'm getting the following error:
In file included from src/glew.c:37:0:
include/GL/glxew.h:97:22: fatal error: X11/Xlib.h: No such file or directory
#include <X11/Xlib.h>
compilation terminated.
make: *** [tmp/mingw/default/shared/glew.o] Error 1
Why?

MSYS does not have X11. It's *M*inimal SYStem for a reason. You want Cygwin.
Or if you want to keep things Win32 native without Cygwin, take a look at Xming.

Related

Code::Blocks, and C++ Compiler problem. cant compile a header

im having problem when compiling C++ source code. that code is a keylogger. at first, i save with .cpp, and try to compile it from terminal using this command
g++ test.cpp
and then the terminal showed me this messages
test.cpp:1:10: fatal error: conio.h: No such file or directory
#include <conio.h>
^~~~~~~~~
compilation terminated.
and this message
test.cpp:2:10: fatal error: windows.h: No such file or directory
#include <windows.h>
^~~~~~~~~~~
compilation terminated.
to fix this, i tried to use a C++ IDE, code::blocks. installed from terminal, and the copy that keylogger source code to code:::blocks. but the IDE shows this message
||=== Build file: Debug in Belajar CPP (compiler: GNU GCC Compiler) ===|
/home/lucky/test.cpp|1|fatal error: conio.h: No such file or directory|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
I just don't know how to fix this and how to search the solutions online. because I'm new in using Linux-Mint. Can someone help me to fix this?
First of all, conio.h and windows.h these headers are not supported on linux console.
Alternative is to use NCurses library. It does all the Console realted stuff you could want and is part of the Linux Standard Base ( i.e. available in every distro ).
Include 'ncurses.h' instead.
I hope this will resolve your issue.

how to solve cppdb/frontend.h compilation error

I am extending a project which includes cppdb/frontend.h, but when I compile I always have this compilation error.
graph_from_db.cpp:6:28: fatal error: cppdb/frontend.h: No such file or directory
#include <cppdb/frontend.h>
^
compilation terminated.
I tried to install libcppdb0 in my Kubuntu 14.04 but it gives this error
E: Package 'libcppdb0' has no installation candidate.
What could be the best way to include this package or file to the project?
I am using a 32bit HP computer with i386 architecture. I have been on this for two weeks now no solution.

Compiling C++/OpenGL in FreeBSD

I'm trying to compile some C++/OpenGL source codes in FreeBSD-10.2-RELEASE.
To be specific, I'm following the instruction below:
http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/#Building_on_Linux
In step 6, I got an error message says:
In file included from /home/(my username)/Downloads/OpenGL-tutorial_v0014_33/external/glew-1.9.0/src/glew.c:32:
/home/(my username)/Downloads/OpenGL-tutorial_v0014_33/external/glew-1.9.0/include/GL/glew.h:1180:14: fatal error:
'GL/glu.h' file not found
# include <GL/glu.h>
^
1 error generated.
*** Error code 1
Stop.
I installed some packages such as graphics/glew, graphics/glfw, math/glm, graphics/libGL, graphics/libGLU, etc, but it still fails.
What should I do to make them work?
Thank you.
In FreeBSD OpenGL includes are located in /usr/local/include, so you need -I/usr/local/include flag.
To make tutorials link properly, you'd also need to replace
set(ALL_LIBS
${OPENGL_LIBRARY}
GLFW_303
GLEW_190
)
with
set(ALL_LIBS
${OPENGL_LIBRARY}
glfw3
GLEW
)
Note that you seemingly using headers from older libraries, this might cause more problems.

Clang: 'cmath' file not found

I'm compiling my project with clang but I'm having an odd error:
[ 1%] Building CXX object CMakeFiles/tfs.dir/src/actions.cpp.o
In file included from /home/travis/build/dominique120/miniature-adventure/src/actions.cpp:20:
In file included from /home/travis/build/dominique120/miniature-adventure/src/otpch.h:27:
/home/travis/build/dominique120/miniature-adventure/src/definitions.h:39:10: fatal error:
'cmath' file not found
#include <cmath>
^
make: *** [all] Error 2
My actions.cpp line 20:
#include "otpch.h"
otpch.h line 27:
#include "definitions.h"
definitions.h line 31:
#include <cmath>
I made a few edits but I have no idea what is causing this error, edits here: https://github.com/dominique120/miniature-adventure/commits/master
PS: GCC just dumps a ton of errors:
https://travis-ci.org/dominique120/miniature-adventure/jobs/21905513
After googling for a problem I was having on macOS, I came to your post. I am sharing a solution, even though it applies only to Mac users.
Chances are you upgraded Xcode (or it was upgraded for you) and you continue to use an old compilation scheme.
Determine which of the following directories actually exists on your disk:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/
and make sure that among your compilation switches you have -I along with a directory that exists.
I had the same issue on Ubuntu 22.04 with libstdc++-11-dev installed.
After doing:
sudo apt install libstdc++-12-dev
...the error went away.
It seems to occur with libstdc++-11 only?

During compilation QMainWindow is unable to be found

I am attempting to compile cutecash (a qt project) and having a bit of trouble. I am just doing the standard:
cmake .
make
However, I am getting errors about not being able to find QMainWindow and QString among other things. Here is the error:
http://pastebin.com/GGHTXE4N
In file included from /home/username/code/gnucash/src/gnc/fpo/ViewletView.hpp:14:0,
from /home/username/code/gnucash/src/gnc/fpo/FPO.hpp:4,
from /home/username/code/gnucash/src/gnc/fpo/moc_FPO.cxx:9:
/home/username/code/gnucash/src/gnc/mainwindow.hpp:26:23: fatal error: QMainWindow: No such file or directory
compilation terminated.
/home/username/code/gnucash/src/gnc/moc_RecentFileMenu.cxx:15:2: error: #error "This file was generated using the moc from 5.0.1. It"
/home/username/code/gnucash/src/gnc/moc_RecentFileMenu.cxx:16:2: error: #error "cannot be used with the include files from this version of Qt."
/home/username/code/gnucash/src/gnc/moc_RecentFileMenu.cxx:17:2: error: #error "(The moc has changed too much.)"
In file included from /home/username/code/gnucash/src/gnc/AccountItemModel.hpp:28:0,
from /home/username/code/gnucash/src/gnc/dashboard.hpp:34,
from /home/username/code/gnucash/src/gnc/moc_dashboard.cxx:9:
/home/username/code/gnucash/src/gnc/QofEventWrapper.hpp:37:19: fatal error: QString: No such file or directory
compilation terminated.
In file included from /home/username/code/gnucash/src/gnc/SplitListModel.hpp:29:0,
from /home/username/code/gnucash/src/gnc/moc_SplitListModel.cxx:9:
/home/username/code/gnucash/src/gnc/QofEventWrapper.hpp:37:19: fatal error: QString: No such file or directory
compilation terminated.
Something that seems fairly significant:
error: #error "This file was generated using the moc from 5.0.1. It"
error: #error "cannot be used with the include files from this version of Qt."
error: #error "(The moc has changed too much.)"
So whenever I attempt to install qt5-default (on ubuntu) I must remove qt4-default. If I attempt to compile now, I get the same issues with being unable to fin QMainWindow and a few other pieces (such as QAbstractItemDelegate).
I also receive this warning:
#error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC or -fPIE."
Along with a few new errors which seem like they happen due to being unable to find items. I am on ubuntu 13.04.
Steps that work for me:
svn checkout http://svn.gnucash.org/repo/gnucash/trunk
mkdir -p trunk/build
cd trunk/build
cmake ..
make