C compiler preprocessor denies file is present
Thanks for your earlier help which got me to this conundrum.
By using the locate command, I was able to add all the necessary pathnames to my makefile to get all "missing file" errors resolved. Now, however, something that I just can't see has caused this result:
john@John-
gcc -c main.c
main.c:24:23: fatal error: gdk/gdkgl.h: No such file or directory
compilation terminated.
make: *** [TestOpenGL] Error 1
john@John-
/usr/include/
/usr/include/
john@John-
When I believe that the appropriate paths are present in the makefile:
CPPFLAGS=-I /usr/include/
-I /usr/lib/
-I /usr/lib/
-I /usr/include/
TestOpenGL : main.o
gcc -c main.c
To correctly make the source:
#include <gdk/gdkgl.h>
#include <stdio.h>
int main(int argc, char **argv)
{
if (gdk_gl_init_check( (int *)argc, (char ***)argv ) )
printf(
else
printf("Open library failed\n");
return 0;
}
I am using the documentation in Devhelp, specifically this description of initializing the library:
gdk_gl_init_check ()
gboolean gdk_gl_init_check (int *argc,
This function does the same work as gdk_gl_init() with only a single change: It does not terminate the program if the library can't be initialized. Instead it returns FALSE on failure.
This way the application can fall back to some other means of communication with the user - for example a curses or command line interface.
argc : Address of the argc parameter of your main() function. Changed if any arguments were handled.
argv : Address of the argv parameter of main(). Any parameters understood by gdk_gl_init() are stripped before return.
Returns : TRUE if the GUI has been successfully initialized, FALSE otherwise.
All I want to do is get a true/false from this function to verify the presence of the requirements. It is most annoying that the preprocessor should fail in this regard, because prior to this failure, all the other includes were acted upon or I could not have used locate to find the necessary libraries. I have not even been able to get so far as setting up the makefile to call the linker.
Please have someone familiar with this library have a look at this. I think it needs a second look by someone experienced with this package. I am pretty rusty to say the least. The last time I did any development of this type was around 1980.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- John Winterton
- Solved:
- Last query:
- Last reply: