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

Author Topic: [Linux][SFML 2.4] Unexpected Linker Error  (Read 1903 times)

0 Members and 1 Guest are viewing this topic.

HowellJenkins

  • Newbie
  • *
  • Posts: 1
    • View Profile
[Linux][SFML 2.4] Unexpected Linker Error
« on: August 30, 2016, 11:37:44 pm »
Hey guys,
I shall be brief.


Makefile
CXXFLAGS = -std=c++11
LDLIBS = -lsfml-system -lsfml-window -lsfml-graphics -lsfml-audio -lsfml-network -lfftw3 -lm
OBJS = musicListener.o main.o


main: $(OBJS)
        g++ $(LDFLAGS) $^ $(LDLIBS) -o $@

%.o: %.cpp
        $(CXX) $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS) -c -o $@ $<

$(OBJS): %.o: $(wildcard ./*.hpp) Makefile
 

This works like a charme:
 if (sf::SoundRecorder::isAvailable())
    {
        std::cout << SFML_VERSION_MAJOR << "." << SFML_VERSION_MINOR << std::endl;
        return 1;
    }
 
output :
2.4

Here i got the Linker Error:
auto devices = sf::SoundRecorder::getAvailableDevices();
 
Error:
main.o: In function `main':
main.cpp:(.text+0xf4): undefined reference to `sf::SoundRecorder::getAvailableDevices()'
collect2: error: ld returned 1 exit status

Well I can't find any issue about this in the git-repository or in the forum. Am I missing something ?

post scriptum : Also setDevice() does not work.

Regards,
Howell


EDIT : Well i wasn't able to figure it out, but linking to old .so makes sense. I made a Fresh LinuxOS install and it's working now. Thanks a lot !
I didn't wanted to reply, so this post will not push up ;)
« Last Edit: September 30, 2016, 10:25:00 pm by HowellJenkins »

lapinozz

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: [Linux][SFML 2.4] Unexpected Linker Error
« Reply #1 on: September 05, 2016, 06:54:39 pm »
You probably updated the header but are still linking to the 2.1 binary, try uninstalling everything, make sure there is not trace SFML to be found then reinstall SFML 2.4

 

anything