Re: [Plib-users] Linking or compaling problem.
Brought to you by:
sjbaker
From: <p.l...@ci...> - 2005-08-08 09:44:23
|
In LIBS just put the -lopengl32 and -lSDL* after the libplib* stuffs, and, less important, remove the -l* stuffs from CXXFLAGS since are not appropriate there. Greetings - Paolo Scrive Francisco Carbonari <fra...@gm...>: > Hi everybody. I'm new to the list and I wrote here because I need > help. I read the list archives but I couldn' t find the solution, only > a few tips but they thosen' t are enough for me... > The problem is this, I dowload the package of plib and I compiled it > with cygwin and Dev-cpp (mingw). The compilation runs fine I think, I > get the lib*.a files. Then I think the problem is with the linker... > I get a simple piece of code that uses SDL and openGL and compile and > run fine, then I modified this code with two or three lines to get > plib in my program, but the the program don't finish the compiling > anymore. It's seems that they don't recognize the openGL functions > gl*(*). > I think maybe is the order of the parameters passed to the linker (I > read a problem like that in the archives) but my experience with this > enviroment is still too little... > Here are the makefile the Dev-cpp automatically generate for the project: > > # Project: SDL-GL_01 > # Makefile created by Dev-C++ 4.9.9.0 > > CPP = g++.exe -D__DEBUG__ > CC = gcc.exe -D__DEBUG__ > WINDRES = windres.exe > RES = SDL-DL_01_private.res > OBJ = main.o $(RES) > LINKOBJ = main.o $(RES) > LIBS = -L"C:/Archivos de programa/Dev-Cpp/lib" -mwindows -lmingw32 > -lopengl32 -lSDLmain -lSDL ../../lib/plib/libplibfnt.a > ../../lib/plib/libplibpu.a ../../lib/plib/libplibul.a -mwin32 -lm > -lgdi32 -lwinmm -lgmon -pg -g3 > INCS = -I"C:/Archivos de programa/Dev-Cpp/include" > CXXINCS = -I"C:/Archivos de programa/Dev-Cpp/include/c++/3.3.1" > -I"C:/Archivos de programa/Dev-Cpp/include/c++/3.3.1/mingw32" > -I"C:/Archivos de programa/Dev-Cpp/include/c++/3.3.1/backward" > -I"C:/Archivos de programa/Dev-Cpp/lib/gcc-lib/mingw32/3.3.1/include" > -I"C:/Archivos de programa/Dev-Cpp/include" > BIN = SDL-GL_01.exe > CXXFLAGS = $(CXXINCS) -DPU_USING_SDL -DWIN32 -g -mwin32 -lm -lgdi32 > -lwinmm -pg -g3 > CFLAGS = $(INCS) -pg -g3 > > .PHONY: all all-before all-after clean clean-custom > > all: all-before SDL-GL_01.exe all-after > > > clean: clean-custom > rm -f $(OBJ) $(BIN) > > $(BIN): $(OBJ) > $(CPP) $(LINKOBJ) -o "SDL-GL_01.exe" $(LIBS) > > main.o: main.cpp > $(CPP) -c main.cpp -o main.o $(CXXFLAGS) > > SDL-DL_01_private.res: SDL-DL_01_private.rc > $(WINDRES) -i SDL-DL_01_private.rc -I rc -o SDL-DL_01_private.res -O coff > > > And the errors that the linker shots me are like this: > > ../../lib/plib/libplibpu.a(pu.o): In function `Z16glIsValidContextv': > C:/Archivos de programa/Dev-Cpp/include/plib-1.8.4/src/pui/pu.cxx:105: > undefined reference to `wglGetCurrentContext@0' > > ../../lib/plib/libplibpu.a(pu.o): In function `Z12puDrawCursorii': > C:/Archivos de programa/Dev-Cpp/include/plib-1.8.4/src/pui/pu.cxx:137: > undefined reference to `glColor4fv@4' > > C:/Archivos de programa/Dev-Cpp/include/plib-1.8.4/src/pui/pu.cxx:139: > undefined reference to `glBegin@4' > C:/Archivos de programa/Dev-Cpp/include/plib-1.8.4/src/pui/pu.cxx:140: > undefined reference to `glVertex2i@8' > > etc, etc... > > In the code I already do this: > > #define _WIN32_WINNT 0x0500 > #define WINVER 0x0500 > #define WIN32_LEAN_AND_MEAN > #define NOGDI > > #include <windows.h> > > #include <gl/gl.h> > #include <SDL/SDL.h> > #define PU_USE_SDL 1 > #include <plib/pu.h> > > In this order... > Well, this is a picture of the problem. Like I'd say I have little > experience yet, so I couldn't find a solution to this problem. If > someone can help me I really appreciate the effort... > Thanks a lot... > > > PD: Excuse my english, it's not my natural language :) > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > |