-
Notifications
You must be signed in to change notification settings - Fork 504
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
Fix compile errors on Linux #3
base: master
Are you sure you want to change the base?
Conversation
The changes below fix compile errors experienced on Ubuntu 16.04 LTS with GCC 5.4.0. - On Linux, <sys/time.h> must be included to make struct timeval known. - <math.h> does not include `std:sqrt`. `<cmath>` does. - <cstdio> must be included to use fopen(). - string.h must be included to use memset(). - A jump to a label (done_close_file) must not cross local declarations. The corresponding code has been encapsulated in a block. - The use of the STRINGIZE macro leads to an error where the compiler sees the #version 430 sequence as an invalid preprocessor directive. Removing the # from #version fixes this.
I almost created a pull request with the same changes. But I checked the pull-requests before submitting it. Well, I should have checked the pull-requests, before working on the patches. QuestionA question about I could make it compile with adding a But I couldn't test the output, because my current gfx card only supports System Information$ glxinfo | grep -i version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
Version: 17.2.2
Max core profile version: 4.1
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
OpenGL core profile version string: 4.1 (Core Profile) Mesa 17.2.2
OpenGL core profile shading language version string: 4.10
OpenGL version string: 3.0 Mesa 17.2.2
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 17.2.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
$ g++ --version
g++ (Ubuntu 7.2.0-8ubuntu3) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ uname --all
Linux abyss 4.13.0-16-generic #19-Ubuntu SMP Wed Oct 11 18:35:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release --all
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.10
Release: 17.10
Codename: artful |
Well, looking back, I don't know why I removed the |
Do you want to resubmit without the change to #, or a change to # that preserves it? |
On Linux, <sys/time.h> must be included to make struct timeval known. string.h must be included to use memset(). A jump to a label (done_close_file) must not cross local declarations. The corresponding code has been encapsulated in a block. The use of the STRINGIZE macro leads to an error where the compiler sees the #version 430 sequence as an invalid preprocessor directive. Move add_subdirectory(lib/glfw) before examples compile in CmakeList.txt to avoid build dependence error. Reference: jhannemann openglredbook#3 elmindreda openglredbook#5
On Linux, <sys/time.h> must be included to make struct timeval known. string.h must be included to use memset(). A jump to a label (done_close_file) must not cross local declarations. The corresponding code has been encapsulated in a block. The use of the STRINGIZE macro leads to an error where the compiler sees the #version 430 sequence as an invalid preprocessor directive. Move add_subdirectory(lib/glfw) before examples compile in CmakeList.txt to avoid build dependence error. Reference: jhannemann openglredbook#3 elmindreda openglredbook#5
On Linux, <sys/time.h> must be included to make struct timeval known. string.h must be included to use memset(). A jump to a label (done_close_file) must not cross local declarations. The corresponding code has been encapsulated in a block. The use of the STRINGIZE macro leads to an error where the compiler sees the #version 430 sequence as an invalid preprocessor directive. Move add_subdirectory(lib/glfw) before examples compile in CmakeList.txt to avoid build dependence error. Reference: jhannemann openglredbook#3 elmindreda openglredbook#5
The changes below fix compile errors experienced on Ubuntu 16.04 LTS
with GCC 5.4.0.
std:sqrt
.<cmath>
does.declarations. The corresponding code has been encapsulated in a block.
sees the #version 430 sequence as an invalid preprocessor directive.
Removing the # from #version fixes this.