News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Small bug with linker interaction?

Started by Multinode Nick, November 21, 2006, 08:58:51 PM

Previous topic - Next topic

Multinode Nick

I'm still at experimentation level with C::B and I'm a newbie with gcc, so I may be wrong with this problem I have...

I have a link problem with a test library of mine. I try to link my libTest.lib by adding it by a relative path, and then I get this compilation error:

mingw32-g++.exe -LC:\wxWidgets-2.6.3\lib\gcc_dll -L"D:\_PROJECT\LIBRAIRIES NEXUS\lib" -LD:\_Project\CodeBlocks\wxsmith\test-4\ -LC:\Euresys\MultiCam\lib -L"C:\Program Files\CodeBlocks\lib"  -o bin\Debug\test-4.exe obj\Debug\CImageGrabber.o obj\Debug\app.o obj\Debug\cnewbuttonctrl.o obj\Debug\newdialog.o obj\Debug\CFileSimulationGrabber.o   -pg -lgmon  -lwxmsw26 -lTest.lib  -mwindows
C:\Program Files\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lTest.lib


But if I add my libtest.lib as an absolute path, I don't get the error.

mingw32-g++.exe -LC:\wxWidgets-2.6.3\lib\gcc_dll -L"D:\_PROJECT\LIBRAIRIES NEXUS\lib" -LD:\_Project\CodeBlocks\wxsmith\test-4\ -LC:\Euresys\MultiCam\lib -L"C:\Program Files\CodeBlocks\lib"  -o bin\Debug\test-4.exe obj\Debug\CImageGrabber.o obj\Debug\app.o obj\Debug\cnewbuttonctrl.o obj\Debug\newdialog.o obj\Debug\CFileSimulationGrabber.o   -pg -lgmon  -lwxmsw26 D:\_Project\CodeBlocks\wxsmith\test-4\libTest.lib  -mwindows

Is there an automation modifying the name libTest.lib and removes the first lib to be threated as a .a library?

Also, I'm unable to use my libtest.lib. I put a simple class with a simple method in it, but it won't link. I get this as error:

obj\Debug\app.o: In function `ZN5MyApp6OnInitEv':
D:/_Project/CodeBlocks/wxsmith/test-4/app.cpp:24: undefined reference to `CTest::OnInit()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings


I know I do something wrong ;-) but I don't figure it?

Nick