|
From: Smith, J. N. <jn...@ut...> - 2003-05-16 20:22:06
|
>
> add this keys for LINKER, not for compiler.
> Go to Project/Project Options/Parameters/Linker
(still with clean install):
- placed dll in windows/system32
- placed glut.h from 3.7.6 (Nate Robbin's Site) into c:/dev-cpp/include/gl
- placed libglut[32].a is *in place* from installation
- under project->project options->parameters->link I put -lopengl32,
-lglu32, -lglut32 (it has -L option into the include and lib folders)
- the project is "console"
The compiler correctly links to libopengl32.a and libglu32.a from the
standard opengl template with 4.9.8 but still fails to link with GLUT 3.7.6.
The code and errors follow.
%%%%%%%%%%% code %%%%%%%%%%%%%
#include <windows.h>
#include <gl/glut.h>
int main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(320,320);
glutCreateWindow("3D Tech- GLUT Tutorial");
}
%%%%%%%%%%% errors %%%%%%%%%%%%%%%
Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\thechao\Desktop\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\thechao\Desktop\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/include/c++"
-I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward"
-I"C:/Dev-Cpp/include" g++.exe main.o -o "glut.exe" -L"C:/Dev-Cpp/lib"
-lopengl32 -lglu32 -lglut32 main.o(.text+0x15):main.cpp: undefined
reference to `__glutInitWithExit@12'
main.o(.text+0x32):main.cpp: undefined reference to
`__glutCreateWindowWithExit@8'
main.o(.text+0x50):main.cpp: undefined reference to
`__glutCreateMenuWithExit@8' make.exe: *** [glut.exe] Error 1 Execution
terminated
|