SFML community forums
Help => General => Topic started by: jakov on November 18, 2012, 06:54:22 pm
-
Hi!
I develop on Ubuntu, for Windows, with Mingw.
I linked the official Mingw 2.0-pre libraries, but then the program crashed when I called the first method. Some googling led me to believe, this is what happens when the library is compiled with another compiler version than the one I am using.
So, I try to compile SFML with http://mxe.cc (http://mxe.cc), but what is the proper magic spell to give it to compile with Mingw in Linux?
I have tried
cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-mingw32.cmake -D FREETYPE_LIBRARY=freetype -D FREETYPE_INCLUDE_DIRS=/opt/mxe/usr/i686-pc-mingw32/include/freetype2 -D GLEW_LIBRARY=glew -D GLEW_INCLUDE_PATH=/opt/mxe/usr/i686-pc-mingw32/include -D JPEG_INCLUDE_DIR=/opt/mxe/usr/i686-pc-mingw32/include -D JPEG_LIBRARY=jpeg .
and
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER i686-pc-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-pc-mingw32-g++)
SET(CMAKE_RC_COMPILER i686-pc-mingw32-windres)
SET(CMAKE_FIND_ROOT_PATH /opt/mxe/usr /opt/mxe/usr/ )
Now it asks for openal libraries,
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:70 (MESSAGE):
Could NOT find OpenAL (missing: OPENAL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindOpenAL.cmake:101 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/SFML/Audio/CMakeLists.txt:42 (find_package)
-- Configuring incomplete, errors occurred!
And by then I started thinking, does SFML even use OPENAL on Windows? Am I on the right track? Besides, MXE doesn't even seem to have OPENAL.
Any ideas? :)
-
For the external dependencies, you should rather use the libraries provided by SFML if you build for Windows. They work for every compiler on Windows so they should work with your cross-compiler too.
-
Thanks, I needed a nudge. Tried so many odd things I didn't see the clues in front of me.
-
Hello,
Two more questions about this topic (I'm also trying to compile a sfml project with mxe) :
- which include files should I use with the dll provided with the sfml ?
- what about GLEW ? the compilation of sfml-graphics seems to need glew functions, which library should i use ?
thanks
-
- which include files should I use with the dll provided with the sfml ?
I don't understand your question, sorry. "Include files" for what? "Use" where?
- what about GLEW ? the compilation of sfml-graphics seems to need glew functions, which library should i use ?
The only answer that comes to my mind is "GLEW", but this is probably not what you expect, so again, please be more precise, I don't get what you mean.
And as a general advice: don't bother with cross-compilation, just download a VM and compile natively.
-
Ok, that what I'm going to do.
thanks