1
Audio / [Linux][SFML 2.4] Unexpected Linker Error
« on: August 30, 2016, 11:37:44 pm »
Hey guys,
I shall be brief.
Makefile
This works like a charme:
2.4
Here i got the Linker 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
I shall be brief.
- Installed SFML 2.1 via sudo apt-get install libsfml-dev
- updated via compiled SDK http://www.sfml-dev.org/download/sfml/2.4.0/
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
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 : {
std::cout << SFML_VERSION_MAJOR << "." << SFML_VERSION_MINOR << std::endl;
return 1;
}
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