Author Topic: Project->linker settings->linker libraries  (Read 5518 times)

Offline gomer

  • Multiple posting newcomer
  • *
  • Posts: 10
Project->linker settings->linker libraries
« on: June 11, 2009, 09:21:42 pm »
Hello,

I have observed some odd behavior when building a project.  I have tried a number of different ways to specify the libraries for a project to investigate this further, but I will only list the last one as an example:

The project and target, both have the identical set of libraries. (I used "Copy selected to...").  If I use "Append target options to project options", then the link works. If I use "Use target options only", then the link fails with unresolved references.  Given that both project and target have the same set of libraries, how is this possible?

thanx

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Project->linker settings->linker libraries
« Reply #1 on: June 11, 2009, 09:27:13 pm »
You can try to debug it by setting:

Settings -> Compiler & Debugger -> Other settings -> Compiler Logging to Full command line
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gomer

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Project->linker settings->linker libraries
« Reply #2 on: June 11, 2009, 10:30:56 pm »
Thanx for the response. 
I took your advice and set logging to Full command line, but it didn't offer any additional insight as to why there are unresolved references when using "Use target options only".

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Project->linker settings->linker libraries
« Reply #3 on: June 11, 2009, 11:40:18 pm »
Look at the differences in the link command or post them here, also the errors....
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gomer

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Project->linker settings->linker libraries
« Reply #4 on: June 12, 2009, 11:44:02 pm »
It looks like there might be a problem with mingw32. 

Here is the log that worked :


-------------- Build: Debug Win32 in bullseye_tutorial ---------------

mingw32-g++.exe  -Wall -g -O0    -I..\..\..\includes -I..\..\..\..\SDL-1.2.13\include -I"..\..\..\..\..\Program Files\GnuWin32\include\freetype2" -I"..\..\..\..\..\Program Files\GnuWin32\include"  -c C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye_testapp.cpp -o Debug\bullseye_testapp.o
In file included from ../../../includes/wgui.h:30,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye_testapp.cpp:3:
../../../includes/std_ex.h:110: warning: ignoring #pragma warning
../../../includes/std_ex.h:111: warning: ignoring #pragma warning
../../../includes/std_ex.h:127: warning: ignoring #pragma warning
../../../includes/std_ex.h:128: warning: ignoring #pragma warning
In file included from ../../../includes/wg_message_client.h:28,
                 from ../../../includes/wgui.h:36,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye_testapp.cpp:3:
../../../includes/wgui_include_config.h:38: warning: ignoring #pragma warning
In file included from ../../../includes/wgui.h:44,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye_testapp.cpp:3:
../../../includes/wg_renderedstring.h:41: warning: ignoring #pragma warning
../../../includes/wg_renderedstring.h:42: warning: ignoring #pragma warning
../../../includes/wg_renderedstring.h:127: warning: ignoring #pragma warning
../../../includes/std_ex.h: In function `TDest stdex::safe_static_cast(const TSrc&) [with TDest = int, TSrc = size_t]':
../../../includes/wg_menu.h:94:   instantiated from here
../../../includes/std_ex.h:119: warning: comparison between signed and unsigned integer expressions
../../../includes/std_ex.h:119: warning: comparison between signed and unsigned integer expressions
mingw32-g++.exe  -Wall -g -O0    -I..\..\..\includes -I..\..\..\..\SDL-1.2.13\include -I"..\..\..\..\..\Program Files\GnuWin32\include\freetype2" -I"..\..\..\..\..\Program Files\GnuWin32\include"  -c C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp -o Debug\bullseye.o
In file included from ../../../includes/wgui.h:30,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.h:3,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp:3:
../../../includes/std_ex.h:110: warning: ignoring #pragma warning
../../../includes/std_ex.h:111: warning: ignoring #pragma warning
../../../includes/std_ex.h:127: warning: ignoring #pragma warning
../../../includes/std_ex.h:128: warning: ignoring #pragma warning
In file included from ../../../includes/wg_message_client.h:28,
                 from ../../../includes/wgui.h:36,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.h:3,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp:3:
../../../includes/wgui_include_config.h:38: warning: ignoring #pragma warning
In file included from ../../../includes/wgui.h:44,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.h:3,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp:3:
../../../includes/wg_renderedstring.h:41: warning: ignoring #pragma warning
../../../includes/wg_renderedstring.h:42: warning: ignoring #pragma warning
../../../includes/wg_renderedstring.h:127: warning: ignoring #pragma warning
C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp: In member function `virtual bool CBullseye::OnMouseButtonDown(wGui::CPoint, unsigned int)':
C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp:20: warning: converting to `int' from `double'
../../../includes/std_ex.h: In function `TDest stdex::safe_static_cast(const TSrc&) [with TDest = int, TSrc = size_t]':
../../../includes/wg_menu.h:94:   instantiated from here
../../../includes/std_ex.h:119: warning: comparison between signed and unsigned integer expressions
../../../includes/std_ex.h:119: warning: comparison between signed and unsigned integer expressions
mingw32-g++.exe -L"C:\Program Files\SDL-1.2.13\lib" -L"C:\Program Files\SDL-1.2.13\bin" -L"C:\Program Files\GnuWin32\lib" -L"C:\Program Files\GnuWin32\bin" -L..\..\..\Debug  -o Debug\bullseye_tutorial.exe Debug\bullseye_testapp.o Debug\bullseye.o    -lmingw32 -luser32 -lgdi32 -lwinmm -ldxguid -lSDLmain -lSDL.dll -lfreetype.dll -lwgui -lmingw32 -luser32 -lgdi32 -lwinmm -ldxguid -lSDLmain -lSDL.dll -lfreetype.dll -lwgui  -mwindows
Output size is 4.74 MB
Process terminated with status 0 (0 minutes, 2 seconds)
0 errors, 21 warnings
 
Here is the log that failed ( "Target only..." ) :


-------------- Build: Debug Win32 in bullseye_tutorial ---------------

mingw32-g++.exe  -Wall -g -O0    -I..\..\..\includes -I..\..\..\..\SDL-1.2.13\include -I"..\..\..\..\..\Program Files\GnuWin32\include\freetype2" -I"..\..\..\..\..\Program Files\GnuWin32\include"  -c C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye_testapp.cpp -o Debug\bullseye_testapp.o
In file included from ../../../includes/wgui.h:30,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye_testapp.cpp:3:
../../../includes/std_ex.h:110: warning: ignoring #pragma warning
../../../includes/std_ex.h:111: warning: ignoring #pragma warning
../../../includes/std_ex.h:127: warning: ignoring #pragma warning
../../../includes/std_ex.h:128: warning: ignoring #pragma warning
In file included from ../../../includes/wg_message_client.h:28,
                 from ../../../includes/wgui.h:36,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye_testapp.cpp:3:
../../../includes/wgui_include_config.h:38: warning: ignoring #pragma warning
In file included from ../../../includes/wgui.h:44,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye_testapp.cpp:3:
../../../includes/wg_renderedstring.h:41: warning: ignoring #pragma warning
../../../includes/wg_renderedstring.h:42: warning: ignoring #pragma warning
../../../includes/wg_renderedstring.h:127: warning: ignoring #pragma warning
../../../includes/std_ex.h: In function `TDest stdex::safe_static_cast(const TSrc&) [with TDest = int, TSrc = size_t]':
../../../includes/wg_menu.h:94:   instantiated from here
../../../includes/std_ex.h:119: warning: comparison between signed and unsigned integer expressions
../../../includes/std_ex.h:119: warning: comparison between signed and unsigned integer expressions
mingw32-g++.exe  -Wall -g -O0    -I..\..\..\includes -I..\..\..\..\SDL-1.2.13\include -I"..\..\..\..\..\Program Files\GnuWin32\include\freetype2" -I"..\..\..\..\..\Program Files\GnuWin32\include"  -c C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp -o Debug\bullseye.o
In file included from ../../../includes/wgui.h:30,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.h:3,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp:3:
../../../includes/std_ex.h:110: warning: ignoring #pragma warning
../../../includes/std_ex.h:111: warning: ignoring #pragma warning
../../../includes/std_ex.h:127: warning: ignoring #pragma warning
../../../includes/std_ex.h:128: warning: ignoring #pragma warning
In file included from ../../../includes/wg_message_client.h:28,
                 from ../../../includes/wgui.h:36,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.h:3,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp:3:
../../../includes/wgui_include_config.h:38: warning: ignoring #pragma warning
In file included from ../../../includes/wgui.h:44,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.h:3,
                 from C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp:3:
../../../includes/wg_renderedstring.h:41: warning: ignoring #pragma warning
../../../includes/wg_renderedstring.h:42: warning: ignoring #pragma warning
../../../includes/wg_renderedstring.h:127: warning: ignoring #pragma warning
C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp: In member function `virtual bool CBullseye::OnMouseButtonDown(wGui::CPoint, unsigned int)':
C:\CPP\wGui-0.5.0\docs\tutorial\Bullseye\bullseye.cpp:20: warning: converting to `int' from `double'
../../../includes/std_ex.h: In function `TDest stdex::safe_static_cast(const TSrc&) [with TDest = int, TSrc = size_t]':
../../../includes/wg_menu.h:94:   instantiated from here
../../../includes/std_ex.h:119: warning: comparison between signed and unsigned integer expressions
../../../includes/std_ex.h:119: warning: comparison between signed and unsigned integer expressions
mingw32-g++.exe -L"C:\Program Files\SDL-1.2.13\lib" -L"C:\Program Files\SDL-1.2.13\bin" -L"C:\Program Files\GnuWin32\lib" -L"C:\Program Files\GnuWin32\bin" -L..\..\..\Debug  -o Debug\bullseye_tutorial.exe Debug\bullseye_testapp.o Debug\bullseye.o    -lmingw32 -luser32 -lgdi32 -lwinmm -ldxguid -lSDLmain -lSDL.dll -lfreetype.dll -lwgui  -mwindows
..\..\..\Debug/libwgui.a(wg_view.o): In function `_ZN4wGui5CView13SetWindowTextERKSbIwSt11char_traitsIwESaIwEE':
C:/CPP/wGui-0.5.0/src/wg_view.cpp:101: undefined reference to `_SDL_WM_SetCaption'
..\..\..\Debug/libwgui.a(wg_view.o): In function `_ZN4wGui5CView13SetWindowRectERKNS_5CRectE':
C:/CPP/wGui-0.5.0/src/wg_view.cpp:121: undefined reference to `_SDL_SetVideoMode'
..\..\..\Debug/libwgui.a(wg_view.o): In function `_ZN4wGui5CView13HandleMessageEPNS_8CMessageE':
C:/CPP/wGui-0.5.0/src/wg_view.cpp:149: undefined reference to `_SDL_CreateRGBSurface'
C:/CPP/wGui-0.5.0/src/wg_view.cpp:153: undefined reference to `_SDL_UpperBlit'
C:/CPP/wGui-0.5.0/src/wg_view.cpp:154: undefined reference to `_SDL_FreeSurface'
C:/CPP/wGui-0.5.0/src/wg_view.cpp:155: undefined reference to `_SDL_UpdateRect'
C:/CPP/wGui-0.5.0/src/wg_view.cpp:187: undefined reference to `_SDL_SetVideoMode'
..\..\..\Debug/libwgui.a(wg_window.o): In function `_ZN4wGui7CWindowD2Ev':
C:/CPP/wGui-0.5.0/src/wg_window.cpp:66: undefined reference to `_SDL_FreeSurface'
..\..\..\Debug/libwgui.a(wg_window.o): In function `_ZN4wGui7CWindowD1Ev':
C:/CPP/wGui-0.5.0/src/wg_window.cpp:66: undefined reference to `_SDL_FreeSurface'
..\..\..\Debug/libwgui.a(wg_window.o): In function `_ZN4wGui7CWindowD0Ev':
C:/CPP/wGui-0.5.0/src/wg_window.cpp:66: undefined reference to `_SDL_FreeSurface'
..\..\..\Debug/libwgui.a(wg_window.o): In function `_ZN4wGui7CWindow13SetWindowRectERKNS_5CRectE':
C:/CPP/wGui-0.5.0/src/wg_window.cpp:82: undefined reference to `_SDL_FreeSurface'
C:/CPP/wGui-0.5.0/src/wg_window.cpp:83: undefined reference to `_SDL_CreateRGBSurface'
..\..\..\Debug/libwgui.a(wg_window.o): In function `_ZNK4wGui7CWindow14PaintToSurfaceER11SDL_SurfaceS2_RKNS_6CPointE':
C:/CPP/wGui-0.5.0/src/wg_window.cpp:274: undefined reference to `_SDL_UpperBlit'
..\..\..\Debug/libwgui.a(wg_application.o): In function `_ZN4wGui12CApplicationC2EiPPcSbIwSt11char_traitsIwESaIwEEb':
C:/CPP/wGui-0.5.0/src/wg_application.cpp:119: undefined reference to `_SDL_EnableKeyRepeat'
C:/CPP/wGui-0.5.0/src/wg_application.cpp:124: undefined reference to `_SDL_GetCursor'
..\..\..\Debug/libwgui.a(wg_application.o): In function `_ZN4wGui12CApplicationC1EiPPcSbIwSt11char_traitsIwESaIwEEb':
C:/CPP/wGui-0.5.0/src/wg_application.cpp:119: undefined reference to `_SDL_EnableKeyRepeat'
C:/CPP/wGui-0.5.0/src/wg_application.cpp:124: undefined reference to `_SDL_GetCursor'
..\..\..\Debug/libwgui.a(wg_application.o): In function `_ZN4wGui12CApplication4InitEv':
C:/CPP/wGui-0.5.0/src/wg_application.cpp:183: undefined reference to `_SDL_EnableUNICODE'
..\..\..\Debug/libwgui.a(wg_application.o): In function `_ZN4wGui12CApplication4ExecEv':
C:/CPP/wGui-0.5.0/src/wg_application.cpp:271: undefined reference to `_SDL_PollEvent'
C:/CPP/wGui-0.5.0/src/wg_application.cpp:277: undefined reference to `_SDL_PollEvent'
C:/CPP/wGui-0.5.0/src/wg_application.cpp:281: undefined reference to `_SDL_Delay'
..\..\..\Debug/libwgui.a(wg_application.o): In function `_ZN4wGui12CApplication15ApplicationExitEi':
C:/CPP/wGui-0.5.0/src/wg_application.cpp:345: undefined reference to `_SDL_PushEvent'
..\..\..\Debug/libwgui.a(wg_application.o): In function `_ZN4wGui12CApplication14SetMouseCursorEPNS_21CCursorResourceHandleE':
C:/CPP/wGui-0.5.0/src/wg_application.cpp:449: undefined reference to `_SDL_SetCursor'
C:/CPP/wGui-0.5.0/src/wg_application.cpp:461: undefined reference to `_SDL_SetCursor'
..\..\..\Debug/libwgui.a(wg_message_server.o): In function `_ZN4wGui14CMessageServerC2Ev':
C:/CPP/wGui-0.5.0/src/wg_message_server.cpp:45: undefined reference to `_SDL_CreateSemaphore'
..\..\..\Debug/libwgui.a(wg_message_server.o): In function `_ZN4wGui14CMessageServerC1Ev':
C:/CPP/wGui-0.5.0/src/wg_message_server.cpp:45: undefined reference to `_SDL_CreateSemaphore'
..\..\..\Debug/libwgui.a(wg_picture.o): In function `_ZNK4wGui8CPicture4DrawEv':
C:/CPP/wGui-0.5.0/src/wg_picture.cpp:76: undefined reference to `_SDL_UpperBlit'
..\..\..\Debug/libwgui.a(wg_painter.o): In function `_ZN4wGui8CPainter9DrawHLineEiiiRKNS_9CRGBColorE':
C:/CPP/wGui-0.5.0/src/wg_painter.cpp:78: undefined reference to `_SDL_FillRect'
..\..\..\Debug/libwgui.a(wg_painter.o): In function `_ZN4wGui8CPainter9DrawVLineEiiiRKNS_9CRGBColorE':
C:/CPP/wGui-0.5.0/src/wg_painter.cpp:96: undefined reference to `_SDL_FillRect'
..\..\..\Debug/libwgui.a(wg_painter.o): In function `_ZN4wGui8CPainter8DrawRectERKNS_5CRectEbRKNS_9CRGBColorES6_':
C:/CPP/wGui-0.5.0/src/wg_painter.cpp:122: undefined reference to `_SDL_FillRect'
..\..\..\Debug/libwgui.a(wg_painter.o): In function `_ZN4wGui8CPainter11LockSurfaceEv':
C:/CPP/wGui-0.5.0/src/wg_painter.cpp:248: undefined reference to `_SDL_LockSurface'
C:/CPP/wGui-0.5.0/src/wg_painter.cpp:250: undefined reference to `_SDL_Delay'
C:/CPP/wGui-0.5.0/src/wg_painter.cpp:251: undefined reference to `_SDL_LockSurface'
..\..\..\Debug/libwgui.a(wg_painter.o): In function `_ZN4wGui8CPainter13UnlockSurfaceEv':
C:/CPP/wGui-0.5.0/src/wg_painter.cpp:264: undefined reference to `_SDL_UnlockSurface'
..\..\..\Debug/libwgui.a(wg_painter.o): In function `_ZN4wGui8CPainter16TransparentColorERKNS_9CRGBColorE':
C:/CPP/wGui-0.5.0/src/wg_painter.cpp:319: undefined reference to `_SDL_SetColorKey'
..\..\..\Debug/libwgui.a(wg_painter.o): In function `_ZSt10__distanceIPwENSt15iterator_traitsIT_E15difference_typeES2_S2_St26random_access_iterator_tag':
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator_base_funcs.h:(.text$_ZNK4wGui9CRGBColor8SDLColorEP15SDL_PixelFormat[wGui::CRGBColor::SDLColor(SDL_PixelFormat*) const]+0x38): undefined reference to `_SDL_MapRGBA'
..\..\..\Debug/libwgui.a(wg_resource_handle.o): In function `_ZN4wGui21CBitmapResourceHandleD2Ev':
C:/CPP/wGui-0.5.0/src/wg_resource_handle.cpp:83: undefined reference to `_SDL_FreeSurface'
..\..\..\Debug/libwgui.a(wg_resource_handle.o): In function `_ZN4wGui21CBitmapResourceHandleD1Ev':
C:/CPP/wGui-0.5.0/src/wg_resource_handle.cpp:83: undefined reference to `_SDL_FreeSurface'
..\..\..\Debug/libwgui.a(wg_resource_handle.o): In function `_ZN4wGui21CBitmapResourceHandleD0Ev':
C:/CPP/wGui-0.5.0/src/wg_resource_handle.cpp:83: undefined reference to `_SDL_FreeSurface'
..\..\..\Debug/libwgui.a(wg_resource_handle.o): In function `_ZN4wGui25CBitmapFileResourceHandleC2ESbIwSt11char_traitsIwESaIwEE':
C:/CPP/wGui-0.5.0/src/wg_resource_handle.cpp:101: undefined reference to `_SDL_RWFromFile'
C:/CPP/wGui-0.5.0/src/wg_resource_handle.cpp:101: undefined reference to `_SDL_LoadBMP_RW'
..\..\..\Debug/libwgui.a(wg_resource_handle.o): In function `_ZN4wGui25CBitmapFileResourceHandleC1ESbIwSt11char_traitsIwESaIwEE':
C:/CPP/wGui-0.5.0/src/wg_resource_handle.cpp:101: undefined reference to `_SDL_RWFromFile'
C:/CPP/wGui-0.5.0/src/wg_resource_handle.cpp:101: undefined reference to `_SDL_LoadBMP_RW'
..\..\..\Debug/libwgui.a(wg_resource_handle.o): In function `_ZN4wGui21CCursorResourceHandleD2Ev':
C:/CPP/wGui-0.5.0/src/wg_resource_handle.cpp:130: undefined reference to `_SDL_FreeCursor'
..\..\..\Debug/libwgui.a(wg_resource_handle.o): In function `_ZN4wGui21CCursorResourceHandleD1Ev':
C:/CPP/wGui-0.5.0/src/wg_resource_handle.cpp:130: undefined reference to `_SDL_FreeCursor'
..\..\..\Debug/libwgui.a(wg_resource_handle.o): In function `_ZN4wGui21CCursorResourceHandleD0Ev':
C:/CPP/wGui-0.5.0/src/wg_resource_handle.cpp:130: undefined reference to `_SDL_FreeCursor'
..\..\..\Debug/libwgui.a(wg_fontengine.o): In function `_ZSt17__is_null_pointerIwEbPT_':
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator_base_types.h:(.text+0x9c): undefined reference to `_FT_Init_FreeType'
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator_base_types.h:(.text+0x237): undefined reference to `_FT_New_Face'
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator_base_types.h:(.text+0x403): undefined reference to `_FT_Set_Char_Size'
..\..\..\Debug/libwgui.a(wg_fontengine.o): In function `_ZN4wGui11CFontEngineC1ERKSbIwSt11char_traitsIwESaIwEEh':
C:/CPP/wGui-0.5.0/src/wg_fontengine.cpp:42: undefined reference to `_FT_Init_FreeType'
Process terminated with status 1 (0 minutes, 2 seconds)
50 errors, 21 warnings
 
Note that C::B faithfully duplicated the libraries from project and target with the policy "Append...".