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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - HowellJenkins

Pages: [1]
1
Audio / [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 ;)

Pages: [1]