#pragma comment in Dev-Cpp

Jan 30, 2009 at 6:12pm
I've seen it used a billion times, but when I tried to use it in my Win32 Project in Dev-Cpp, I still get the "undefined reference to..." errors, just as if I had failed to include the libraries in my linker options. I thought this was just another way of doing the same thing... Here's what I did:

1
2
3
4
5
6
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>

#pragma comment(lib, "c:/Dev-Cpp/lib/libopengl32.a");
#pragma comment(lib, "c:/Dev-Cpp/lib/libglu32.a"); 


Those are the two OpenGL libraries I link to in all my OpenGL projects. Does it need to be a *.lib file, instead of a *.a file? Any help is appreciated.
Last edited on Jan 30, 2009 at 6:13pm
Jan 30, 2009 at 6:18pm
#pragma directives depend on the compiler, #pragma comment() is for VC++, Dev-C++ uses MingW.
On Dev-C++ go to Project Options and then on the Parameters tab
Topic archived. No new replies allowed.