SFML community forums
Help => Audio => Topic started by: fulfowi on March 22, 2025, 11:37:20 pm
-
I'm able to link all my SFML audio calls expect for openFromFile. I get the following error:
C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/dougy/OneDrive/Attachments/Documents/BJT/src/BlackJackTutorManager.cpp:26: undefined reference to `__imp__ZN2sf5Music12openFromFileERKSs'
The closest match I could find is:
dougy@DougyDrumzLT /cygdrive/c/SFML-2.6.2/lib
$ nm libsfml-audio*.a | grep __imp__ZN2sf5Music12openFromFile
0000000000000000 I __imp__ZN2sf5Music12openFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
0000000000000000 I __imp__ZN2sf5Music12openFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Attached is my CMakeLists.txt.
Please advise.
-
Are you using downloaded binaries of SFML?
The downloads are for MinGW 13.1, but your error message says you are using MinGW 11.2. The version numbers must match exactly.
You could either change your compiler to 13.1, or build SFML yourself using 11.2.
-
Thanks! I'll DL 13.1.
-
Make sure to download the ones linked on the download page!
-
Now I get:
$ ./cmake.bat
C:\Users\dougy\OneDrive\Attachments\Documents\BJT\src>"C:\Program Files\CMake\bin\cmake.exe" -D CMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" -D CMAKE_MAKE_PROGRAM:PATH="C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/mingw32-make" -D CMAKE_CXX_COMPILER="gcc" -D CMAKE_CXX_FLAGS="-std=gnu++17"
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
-- The C compiler identification is GNU 13.1.0
-- The CXX compiler identification is GNU 13.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/mingw32/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/mingw32/bin/gcc.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:6 (find_package):
Could not find a configuration file for package "SFML" that is compatible
with requested version "2.6.2".
The following configuration files were considered but not accepted:
C:/SFML-2.6.2/lib/cmake/SFML/SFMLConfig.cmake, version: 2.6.2 (64bit)
-- Configuring incomplete, errors occurred!