I downloaded SFML, then I copied all its headers in usr/local/include/ and copied all its libraries in usr/local/lib/ .
I have a file named main.cpp in Desktop which I want to compile.
First I did this :-
g++ -c main.cpp
After that when I try to do this :-
g++ main.o -o sfml-app -lsfml-graphics -lsfml-window -lsfml-system
It gives me :-
/usr/local/lib/libsfml-window.so: undefined reference to `udev_device_get_action@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_list_entry_get_next@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_unref@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_list_entry_get_name@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_enumerate_unref@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_monitor_unref@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_new@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_monitor_receive_device@LIBUDEV_183'
/usr/local/lib/libsfml-graphics.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_device_get_devnode@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_monitor_enable_receiving@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_enumerate_new@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_monitor_get_fd@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_device_unref@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_device_get_property_value@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_monitor_filter_add_match_subsystem_devtype@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_enumerate_get_list_entry@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_enumerate_scan_devices@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_enumerate_add_match_subsystem@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_device_get_syspath@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_device_get_sysattr_value@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_monitor_new_from_netlink@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_device_new_from_syspath@LIBUDEV_183'
/usr/local/lib/libsfml-window.so: undefined reference to `udev_device_get_parent_with_subsystem_devtype@LIBUDEV_183'
I have installed all these required dependencies correctly : https://github.com/SFML/SFML/wiki/Tutorial%3A-Installing-SFML-dependencies
Have I missed any required step ?
Just because you're got the dependencies installed doesn't mean you're making use of them.
The mention of
udev
andLIBUDEV
suggest to me that you need to link against libudev. Try adding-ludev
to your command line.If you pasted all of the link errors, then that might actually take care of it. If you just pasted the first 20, then there might be other libraries that need to be linked in. Look at the missing symbols, figure out what libraries they're from, and add them.
Not sure what the deal is there. You might need to link against the C++ libraries?
Anyways, you should take a look at the instructions for setting up makefiles for your SFML project: https://github.com/SFML/SFML/wiki/Tutorial%3A-Build-your-SFML-project-with-CMake