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

Author Topic: [Solved] Error when building sfml-graphics on MinGW-w64 4.9.1 x86_64  (Read 2185 times)

0 Members and 1 Guest are viewing this topic.

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Hi there.

I just reinstalled my compiler, and switched from MinGW 4.8.2 i686 to MinGW 4.9.1 x86_64.
I'm on Windows 8.1. My compiler is MinGW 4.9.1 x86_64 (64-bit). I'm using CMake 3.0.1.
I'm building with
$ git clone https://github.com/SFML/SFML && cd SFML
$ mkdir build && cd build
$ cmake .. -G"MinGW Makefiles"
$ make

All the modules build fine, except for sfml-graphics, which fails with:
Linking CXX shared library ..\..\..\lib\sfml-graphics-2.dll
cd /d C:\Users\Aster\Programming\temp\SFML\build\src\SFML\Graphics && "c:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\sfml-graphics.dir\link.txt --verbose=1
"c:\Program Files (x86)\CMake\bin\cmake.exe" -E remove -f CMakeFiles\sfml-graphics.dir/objects.a
c:\MinGW\x86_64\mingw64\bin\ar.exe cr CMakeFiles\sfml-graphics.dir/objects.a @CMakeFiles\sfml-graphics.dir\objects1.rsp
c:\MinGW\x86_64\mingw64\bin\g++.exe     -shared -o ..\..\..\lib\sfml-graphics-2.dll -Wl,--out-implib,..\..\..\lib\libsfml-graphics.a -Wl,--major-image-version,2,--minor-image-version,1 -Wl,--whole-archive CMakeFiles\sfml-graphics.dir/objects.a -Wl,--no-whole-archive ..\..\..\lib\libsfml-window.a ..\..\..\lib\libsfml-system.a "C:\Program Files (x86)\SFML\lib\glew.lib" -lopengl32 ..\..\..\..\extlibs\libs-mingw\x64\libfreetype.a ..\..\..\..\extlibs\libs-mingw\x64\libjpeg.a -lwinmm -lgdi32 -lopengl32 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
CMakeFiles\sfml-graphics.dir/objects.a(GLExtensions.cpp.obj):GLExtensions.cpp:(.text+0x21): undefined reference to `glewInit'
CMakeFiles\sfml-graphics.dir/objects.a(GLExtensions.cpp.obj):GLExtensions.cpp:(.text+0x43): undefined reference to `glewGetErrorString'
c:/MinGW/x86_64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\sfml-graphics.dir/objects.a(GLExtensions.cpp.obj): bad reloc address 0x0 in section `.pdata'

I don't have GLEW installed separately from SFML (I usually do, but I installed SFML before GLEW this time), but this shouldn't be important since SFML ships with the "right" version of GLEW.

Is this issue MinGW x86_64 specific? How can I fix it without installing GLEW manually?

Cheers,
Aster
« Last Edit: August 29, 2014, 08:29:48 am by Aster »

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: Error when building sfml-graphics on MinGW-w64 4.9.1 x86_64
« Reply #1 on: August 29, 2014, 08:29:36 am »
Turns out I had a previous MSVC build of SFML and it was using those .lib files to link.

Cheers