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

Author Topic: Wrong openFromFile Mangling  (Read 164 times)

1 Member and 1 Guest are viewing this topic.

fulfowi

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Wrong openFromFile Mangling
« 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.

kojack

  • Sr. Member
  • ****
  • Posts: 363
  • C++/C# game dev teacher.
    • View Profile
Re: Wrong openFromFile Mangling
« Reply #1 on: March 23, 2025, 07:18:55 am »
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.

fulfowi

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Wrong openFromFile Mangling
« Reply #2 on: March 23, 2025, 11:29:30 pm »
Thanks! I'll DL 13.1.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11173
    • View Profile
    • development blog
    • Email
Re: Wrong openFromFile Mangling
« Reply #3 on: March 24, 2025, 01:24:39 pm »
Make sure to download the ones linked on the download page!
Official FAQ: https://www.sfml-dev.org/faq/
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

fulfowi

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Wrong openFromFile Mangling
« Reply #4 on: Today at 12:29:34 am »
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!

 

anything