What do I do with the .lib files? I know I can’t use the header files it comes with without first doing something to these .lib files. Can someone please help?
Oh yeah: I don’t use visual studio.
If you arent using Visual, you must parametrize the compilator with .lib for linking of classes.
I have already tried but it is difficult. I advise you to use Visual C++ for that. It is more friendly to manipulate. The most difficult it is to configure VC librairies for linking but in reality, with a good documentation, it is easy… if you want more informations, contact me.
You just need to tell the compiler where they are (usually with -L(PATH)) and to use them (usually -l(LIB_NAME)). What compiler are you using?
I am using DJGPP
I am using DJGPP
A quick google search turned up this page: http://www.delorie.com/djgpp/doc/ug/compiling/portother.html
Although this is pretty limited info it looks to me like djgpp uses the standard compiler flag so:
-L should be used to tell the compiler where the lib is.
-l should be used to tell the compiler what to link to.
-I should tell the compiler where the header files are.
If glu32.lib is in /libraries and glu.h is in /headers then to link to the glu lib you would execute something like:
gcc myProg.c -I/headers -L/libraries -lglu -o myProg.exe
(the order can be important and you need to read the compiler documentation to get i right)
You might not need to tell the compiler where the library or header file is if it is in a directory the compiler would ordinarily look in (check the documentation).
By the way, in case you did not know, the header files contain the declaration of functions and classes while the libraries contain the actual binary code.
Isn’t DJGPP a DOS compiler? You won’t be able to use OpenGL, if it is. The best you can do is to get Mesa, which is basically identical but can’t call itself OpenGL for various reasons. That’s all going to be software rendering, though. My advice… if you don’t feel like spending money on a compiler, get a free one like the Borland compiler, or Cygwin.
Yes, DJGPP is a DOS compiler but I think I will try out what it says above your message…thanks for the help…I might need more if I can’t get this working though…
This is how my compiler is set up now:
gxx -o test.exe test.cc -I/headers -L/libraries -lglu
This does not work and generates the error:
GL.H: No such file or directory (ENOENT)
Glu32.lib: No such file or directory (ENOENT)
Glaux.H: No such file or directory (ENOENT)
Can someone please help?
Ok, first and foremost DJGPP cannot use .lib files. It uses a different format (.a instead of .lib). Second, you cant use OpenGL with DJGPP, well not hardware accelerated OpenGL. To use the software mode you need to download Mesa which does work with DJGPP. You can get mesa here: http://www.mesa3d.org
Lastly, unless your headers are in [drive]:\headers and your libraries are in [drive]:\libraries your command line arguments wont work. You need to specify relative or absolute paths:
Example: -Id:/opengl/headers -L./libraries
The first says “my headers are in d:\opengl\headers” the second says “my libraries are in a direction called ‘libraries’ that is underneath the current directory”.
You can also look into other freeware compilers such as mingw32 and Borland has one called C++ Builder or something like that. These work better with .lib files (I think) and can probably interface with hardware accelerated OpenGL (because they compile Windows programs instead of DOS programs). I’m sure somebody will kindly point out the links if ask (sorry, I dont have them, I use VC++).
So can someone please explain to me what this mesa thing is and what it does?
Also, if I am going to use mesa3d do I delete my OpenGL stuff and also, can I code the same way I would for GL with mesa3d?
I went to the site that someone above suggested and all there were were demos or something like that. I ended up at this page:
Can someone please help. I just want to get started.
After you got to the source forge site did you download mesa? I dont mean to be rude but how long have you been programming? I dont think jumping into something like 3d programming with OpenGL is a good way to start… If you’ve been programming for a while, please forgive me that comment.
Mesa is free version of OpenGL that runs in software mode. This means that you program just like you would for OpenGL because it IS OpenGL. The Mesa site has much documentation to get you started.
Originally posted by a beginner:
[b]I went to the site that someone above suggested and all there were were demos or something like that. I ended up at this page:
Can someone please help. I just want to get started.[/b]
When I went to that site the mesa library was there, down below the demos.
It is kinda hard to offer advice without knowing what you have and what you want to do. Perhaps it would be easier to use a different compiler? What is your OS? Do you need to use DOS? Do you know what graphics card you are using?
As Erik said, it’s hard to offer advice without knowing what you want to do. If you don’t need to use DOS, I’d highly recommend finding a different compiler. You can download and use Mesa3d, but the resulting programs won’t use hardware acceleration and could potentially be very slow. Maybe you don’t have a decent card and that doesn’t matter that much, anyway, though.
If you don’t have a lot of programming experience, then you should listen to BwB. OpenGL and 3d programming is a lot to bite off if you are just learning how to program.