About compiler flags

Started by
2 comments, last by cmsiu 22 years, 5 months ago
Hi all, I am a beginner of 3D graphics, now I want to generate the opengl using c++. But it tells me to set up the compiler flags in order to draw the geometries or execute the behaviors. So what does it mean, and how can I set up? Such as SUPPORT_OPENGL, SUPPORT_JPEG... Thank you very much! Siu
Advertisement
Do you have the exact error messages ?
Are they compile-time ? run-time ?
What compiler are you using ? CL (visual studio) ? g++ ?

Are you trying to compile the library ?

...
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Hi, Thank you for your reply.
Actually, I am following the work to do in the site:
http://www.cyber.koganei.tokyo.jp/vrml/cv97/cv97cc/index.html
Those source code is free, but I found that I don''t understand what''s means by compiler flag-SUPPORT_OPENGL, SUPPORT_JPEG.
The page stated that the requirement for using such flags needs "OpenGL 1.1 library" and "Independent JPEG Group''s library", so I don''t understand it and apply it.

The errors are compile time error, and says it cannot find xxx.lib, I''m using VC++6.
Thank you very much.

Siu
Ok

What is going on is that the library you are compiling has conditional compilation statements that you have to activate if your system supports such or such functionality.

For example, if you have installed libpng/zlib, you may set the corresponding flag SUPPORT_PNG (I''ll come to that later) and the appropriate code will be included in the library to uses it.

These compilation flags are the equivalent of #define instruction in the code (and are checked with #ifdef and the like ). In VC6, you access them in Project-Settings-C/C++-Preprocessor definitions. Depending on what you have installed, add SUPPORT_whatever... or not.

Unfortunately, from what I pick up on that web page ( specifically, the use of flex and bison ) building the library may be restricted to GNU platforms (e.g. on windows : cygwin, MinGW). I do not see any hints that you can build it with VC6 in the source code itself (usually, you are provided with a project file or a makefile...). Though I may be wrong.

So try again without defining the flags for the components you do not have. I can''t do much more for you.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

This topic is closed to new replies.

Advertisement