mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mingw-cross-env-list] mxe with sfml linking errors


From: damien LAURENT
Subject: [Mingw-cross-env-list] mxe with sfml linking errors
Date: Sat, 17 Aug 2013 09:57:07 +0200

Dear list,

I've developped a project on linux and I now I would like to distribute
it on Windows. My project uses the following external libraries: fftw,
SFML and wxWidgets.
With the command 
$
cmake 
..-DCMAKE_TOOLCHAIN_FILE=/home/damien/mxe/usr/i686-pc-mingw32/share/cmake/mxe-conf.cmake
then
$ make
the compilation occurs nicely, but it makes errors when linking.
The error messages seems to refer to SFML objects (e.g. first line
sf::Color::Black). Here are the messages:
address@hidden:~/Bureau/cpp/winviolette/build$ make
Linking CXX executable violette.exe
CMakeFiles/violette.dir/src/Controller.cpp.obj:Controller.cpp:(.text
+0xd86): undefined reference to `_imp___ZN2sf5Color5BlackE'
CMakeFiles/violette.dir/src/Controller.cpp.obj:Controller.cpp:(.text
+0x14a2): undefined reference to `_imp___ZN2sf13SoundRecorder4stopEv'
CMakeFiles/violette.dir/src/Controller.cpp.obj:Controller.cpp:(.text
+0x165b): undefined reference to `_imp___ZN2sf13SoundRecorder5startEj'
CMakeFiles/violette.dir/src/Controller.cpp.obj:Controller.cpp:(.text
+0x19ef): undefined reference to
`_imp___ZN2sf13SoundRecorder11isAvailableEv'
CMakeFiles/violette.dir/src/Controller.cpp.obj:Controller.cpp:(.text
+0x20ed): undefined reference to `_imp___ZN2sf5Music12openFromFileERKSs'
CMakeFiles/violette.dir/src/Controller.cpp.obj:Controller.cpp:(.text
+0x2988): undefined reference to
`_imp___ZN2sf11SoundBuffer12loadFromFileERKSs'
/home/damien/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/ld:
 CMakeFiles/violette.dir/src/Controller.cpp.obj: bad reloc address 0xa in 
section 
`.text$_ZN5wxLog14IsLevelEnabledEm8wxString[__ZN5wxLog14IsLevelEnabledEm8wxString]'
/home/damien/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/ld:
 final link failed: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [violette.exe] Erreur 1
make[1]: *** [CMakeFiles/violette.dir/all] Erreur 2
make: *** [all] Erreur 2

Any ideas ?
thanks
d

ps my CMakeLists.txt
"
cmake_minimum_required(VERSION 2.6.2)

project(violette)

FIND_PACKAGE(wxWidgets REQUIRED base core gl net)
if ( NOT wxWidgets_FOUND )
    message(FATAL_ERROR "wx not found !")
endif ()
INCLUDE(${wxWidgets_USE_FILE})

file(GLOB_RECURSE source_files src/*)

add_executable(violette ${source_files})

target_link_libraries(violette fftw3)

target_link_libraries(violette sfml-main)

target_link_libraries(violette sfml-audio-s)

target_link_libraries(violette sfml-graphics-s)

TARGET_LINK_LIBRARIES(violette ${wxWidgets_LIBRARIES})
"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]