Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot build on linux #22

Closed
alfredoivan opened this issue Oct 27, 2018 · 6 comments
Closed

cannot build on linux #22

alfredoivan opened this issue Oct 27, 2018 · 6 comments

Comments

@alfredoivan
Copy link

Hello.
I'm using ubuntu 14.04.5 and the code cannot be compiled.
First i did cmake on build/ folder.

$ cmake ..

Then make fails:

$ make
[ 14%] Built target glfw
[ 15%] Building CXX object CMakeFiles/vermilion.dir/lib/LoadShaders.cpp.o
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp: In function ‘const GLchar* ReadShader(const char*)’:
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:26:42: error: ‘fopen’ was not declared in this scope
FILE* infile = fopen( filename, "rb" );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:36:23: error: ‘SEEK_END’ was not declared in this scope
fseek( infile, 0, SEEK_END );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:36:32: error: ‘fseek’ was not declared in this scope
fseek( infile, 0, SEEK_END );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:37:29: error: ‘ftell’ was not declared in this scope
int len = ftell( infile );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:38:23: error: ‘SEEK_SET’ was not declared in this scope
fseek( infile, 0, SEEK_SET );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:42:35: error: ‘fread’ was not declared in this scope
fread( source, 1, len, infile );
^
/home/usuario/workspace/src/opengl/opg_pdf/OGLPG-9th-Edition/OGLPG-9th-Edition/lib/LoadShaders.cpp:43:20: error: ‘fclose’ was not declared in this scope
fclose( infile );
^
make[2]: *** [CMakeFiles/vermilion.dir/lib/LoadShaders.cpp.o] Error 1
make[1]: *** [CMakeFiles/vermilion.dir/all] Error 2

@elmindreda
Copy link

Have a look at #5.

@alfredoivan
Copy link
Author

Have a look at #5.

Ok, good. Now i can compile.
In my computer all example programs look black. But at least it compiles fine.

@elmindreda
Copy link

What is the output of glxinfo -B on your machine?

@alfredoivan
Copy link
Author

The command:
$ glxinfo -B Unknown option -B'`

Without -B option and greping OpenGL:
$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.0
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 11.2.0
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:

@elmindreda
Copy link

That makes sense, thank you. Most or all of the examples for this book use OpenGL 4.x features, while your system only supports 3.3.

Mesa 11 is really old. It might help to update your operating system.

@alfredoivan
Copy link
Author

So in summary i tried with two different computers using Ubuntu 14.04.5 and #5 help solve the issue of compiling.

However it won't execute properly because of old OpenGL version.
Thanks for your help. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants