[BUG] Building CEGui0.8.2 with GCC fails: Can't find DbgHelp

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

odedsh
Just popping in
Just popping in
Posts: 12
Joined: Thu Nov 14, 2013 18:17

[BUG] Building CEGui0.8.2 with GCC fails: Can't find DbgHelp

Postby odedsh » Fri Nov 15, 2013 06:50

Building CEGui 0.8.2 on Windows with MinGW (with GCC 4.7.2) and CMake 2.8:

Building Debug DLL: libCEGUIBase-0_d.dll fails

Linking CXX shared library ..\..\bin\libCEGUIBase-0_d.dll
cd /d C:\Cpp\cegui-0.8.2\cegui\src && "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_link_script CMakeFiles\CEGUIBase-0.dir\link.txt --verbose=1
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E remove -f CMakeFiles\CEGUIBase-0.dir/objects.a
C:\MinGW\bin\ar.exe cr CMakeFiles\CEGUIBase-0.dir/objects.a @CMakeFiles\CEGUIBase-0.dir\objects1.rsp
C:\MinGW\bin\g++.exe -shared -o ..\..\bin\libCEGUIBase-0_d.dll -Wl,--out-implib,..\..\lib\libCEGUIBase-0_d.dll.a -Wl,--major-image-version,3,--minor-image-version,1 -Wl,--whole-archive CMakeFiles\CEGUIBase-0.dir/objects.a -Wl,--no-whole archive C:\Cpp\freetype\objs\freetype.a -lwinmm -lDbgHelp -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot find -lDbgHelp
collect2.exe: error: ld returned 1 exit status
cegui\src\CMakeFiles\CEGUIBase-0.dir\build.make:4120: recipe for target 'bin/libCEGUIBase-0_d.dll' failed
Mingw32-Make[2]: *** [bin/libCEGUIBase-0_d.dll] Error 1
Mingw32-Make[2]: Leaving directory 'C:/Cpp/cegui-0.8.2'
CMakeFiles\Makefile2:79: recipe for target 'cegui/src/CMakeFiles/CEGUIBase-0.dir/all' failed
Mingw32-Make[1]: *** [cegui/src/CMakeFiles/CEGUIBase-0.dir/all] Error 2
Mingw32-Make[1]: Leaving directory 'C:/Cpp/cegui-0.8.2'
Makefile:135: recipe for target 'all' failed
Mingw32-Make: *** [all] Error 2


The reason is linking to DbgHelp

Now I believe DbgHelp is used only with MSVC.. Looking at: src/Exceptions.cpp

#if defined(_MSC_VER)
#include <dbghelp.h>
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
...
#endif


However in src/CMakeLists.txt DbgHelp is added to all Windows builds
if (WIN32)
# - Removed DbgHelp library
cegui_target_link_libraries(${CEGUI_TARGET_NAME} winmm debug DbgHelp)
elseif (UNIX AND NOT APPLE)
# This is intentionally not using 'cegui_target_link_libraries'
target_link_libraries(${CEGUI_TARGET_NAME} ${CMAKE_DL_LIBS})
endif()


If I remove DbgHelp it compiles without problem

Bertram
Quite a regular
Quite a regular
Posts: 73
Joined: Wed Oct 02, 2013 14:46

Re: [BUG] Building CEGui0.8.2 with GCC fails: Can't find Dbg

Postby Bertram » Sat Nov 16, 2013 01:36

Hi again,

I also confirm this problem. Best regards! :)

odedsh
Just popping in
Just popping in
Posts: 12
Joined: Thu Nov 14, 2013 18:17

Re: [BUG] Building CEGui0.8.2 with GCC fails: Can't find Dbg

Postby odedsh » Sat Nov 23, 2013 20:40

To workaround this problem on my machine I changed:

Code: Select all

cegui_target_link_libraries(${CEGUI_TARGET_NAME} winmm debug DbgHelp)

to

Code: Select all

cegui_target_link_libraries(${CEGUI_TARGET_NAME} winmm )


In CMakeLists.txt

The correct fix is to only use DbgHelp in case of MSVC compiler.. I don't know enough CMake to attempt a real fix and I don't have VS to test that it continues working on that platform too..


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: Google [Bot] and 11 guests