Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Build CSFML with MSYS2\MinGW-w64  (Read 10555 times)

0 Members and 3 Guests are viewing this topic.

Kreol

  • Newbie
  • *
  • Posts: 4
    • View Profile
Build CSFML with MSYS2\MinGW-w64
« on: November 02, 2014, 10:02:04 pm »
Hello.
Basically, I'm struggling to build CSFML from sources for the last two days. And I was quite succesful up until the moment when I was actually trying to "make" the library.

So, what I did was - got SFML 2.1 -> statically build it. During that process, I've got bunch of error with 'del' command missing, but I typed 'make' 5 or 6 times and SFML succesfully builded. (/bin/sh: del: command not found)

Then, I used cmake to create MSYS Makefiles. After that - typed make aaaaand that is the moment when I stuck.

This is the output:

Code: [Select]
Scanning dependencies of target csfml-system
[  2%] Building CXX object src/SFML/System/CMakeFiles/csfml-system.dir/Clock.cpp.obj
[  4%] Building CXX object src/SFML/System/CMakeFiles/csfml-system.dir/Mutex.cpp.obj
[  6%] Building CXX object src/SFML/System/CMakeFiles/csfml-system.dir/Sleep.cpp.obj
[  8%] Building CXX object src/SFML/System/CMakeFiles/csfml-system.dir/Thread.cpp.obj
[ 11%] Building CXX object src/SFML/System/CMakeFiles/csfml-system.dir/Time.cpp.obj
Linking CXX shared library ../../../lib/csfml-system-2.dll
[ 11%] Built target csfml-system
Scanning dependencies of target csfml-window
[ 13%] Building CXX object src/SFML/Window/CMakeFiles/csfml-window.dir/Context.cpp.obj
[ 15%] Building CXX object src/SFML/Window/CMakeFiles/csfml-window.dir/Joystick.cpp.obj
[ 17%] Building CXX object src/SFML/Window/CMakeFiles/csfml-window.dir/Keyboard.cpp.obj
[ 20%] Building CXX object src/SFML/Window/CMakeFiles/csfml-window.dir/Mouse.cpp.obj
[ 22%] Building CXX object src/SFML/Window/CMakeFiles/csfml-window.dir/VideoMode.cpp.obj
[ 24%] Building CXX object src/SFML/Window/CMakeFiles/csfml-window.dir/Window.cpp.obj
Linking CXX shared library ../../../lib/csfml-window-2.dll
C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../lib\libsfml-window-s.a(JoystickImpl.cpp.obj):JoystickImpl.cpp:(.text+0xb): undefined reference to `__imp_joyGetPosEx'
C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../lib\libsfml-window-s.a(JoystickImpl.cpp.obj):JoystickImpl.cpp:(.text+0xd5): undefined reference to `__imp_joyGetPosEx'
C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../lib\libsfml-window-s.a(JoystickImpl.cpp.obj):JoystickImpl.cpp:(.text+0x106): undefined reference to `__imp_joyGetDevCapsA'
C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../lib\libsfml-window-s.a(JoystickImpl.cpp.obj):JoystickImpl.cpp:(.text+0x214): undefined reference to `__imp_joyGetPosEx'
C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../lib\libsfml-window-s.a(JoystickImpl.cpp.obj): bad reloc address 0x0 in section `.pdata'
collect2.exe: error: ld returned 1 exit status
(And then bunch of text in russian, which doesn't matter)

So, the questions are:
a) Is this a problem of my statically builded SFML, maybe those errors were not those, which I may ignore.
b) If it is - how does one builds SFML statically without such annoying things.
c) If it's a problem with CSFML and SFML is builded correctly- how to fix it?

P.S. Sorry for my english in advance :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Build CSFML with MSYS2\MinGW-w64
« Reply #1 on: November 02, 2014, 10:24:21 pm »
Are you building SFML/CSFML 2.1, or a more recent revision? If 2.1, for what reason?
Laurent Gomila - SFML developer

Kreol

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Build CSFML with MSYS2\MinGW-w64
« Reply #2 on: November 02, 2014, 10:42:26 pm »
I'm building 2.1, for no particular reason - I just grabbed sources from the sites and began my attempts to build them on Windows. I can move to a more recent revision anytime.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Build CSFML with MSYS2\MinGW-w64
« Reply #3 on: November 02, 2014, 10:46:49 pm »
Why don't you use the precompiled binaries?
Laurent Gomila - SFML developer

Kreol

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Build CSFML with MSYS2\MinGW-w64
« Reply #4 on: November 02, 2014, 10:55:54 pm »
I can, and everything is fine, but I want to understand why doesn't it work and to get it done. And also if it's a bug of some sort, then it could be quit nice to reveal it.

Kreol

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Build CSFML with MSYS2\MinGW-w64
« Reply #5 on: November 02, 2014, 11:16:30 pm »
Allright, I have downloaded and builded sources from GitHub and everything is just fine, I have succesfully compiled both SFML and CSFML. If it was a bug, than it is fixed by now. But thank you for your fast replies. :)

Maurimel77

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Build CSFML with MSYS2\MinGW-w64
« Reply #6 on: May 06, 2022, 05:45:11 pm »
Allright, I have downloaded and builded sources from GitHub and everything is just fine, I have succesfully compiled both SFML and CSFML. If it was a bug, than it is fixed by now. But thank you for your fast replies. :)

Hello Kreol, could you please give me a hand on how to compile SFML for MSYS2 ? I don't know how to do it.