How can I use sfml with codeblocks in Ubuntu ?
Are you sure the SFML directory is under /usr/local/include? You didn't copy the include directory to /usr/local/include, thus creating /usr/local/include/include/SFML accidentally? The only thing I could think of other than that is /usr/local/include isn't in the list of directories to include for some reason.
@teh_progreammer
You didn't copy the include directory to /usr/local/include, thus creating /usr/local/include/include/SFML accidentally?
Yes. Instead of copying only the contents of the include and lib folder, I had copied the whole include folder inside the /usr/local/include and the whole lib folder inside the usr/local/lib, but I corrected it now. But it is still not working. This error is coming :-
||warning: libxcb-image.so.0, needed by /usr/local/lib/libsfml-window.so, not found (try using -rpath or -rpath-link)|
||warning: libxcb-randr.so.0, needed by /usr/local/lib/libsfml-window.so, not found (try using -rpath or -rpath-link)|
||warning: libudev.so.1, needed by /usr/local/lib/libsfml-window.so, not found (try using -rpath or -rpath-link)|
/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 `xcb_randr_get_screen_info_sizes'|
/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 `xcb_randr_query_version'|
/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 `xcb_randr_get_screen_info_reply'|
/usr/local/lib/libsfml-window.so||undefined reference to `udev_monitor_receive_device@LIBUDEV_183'|
/usr/local/lib/libsfml-window.so||undefined reference to `xcb_create_pixmap_from_bitmap_data'|
/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 `xcb_randr_id'|
/usr/local/lib/libsfml-window.so||undefined reference to `udev_monitor_get_fd@LIBUDEV_183'|
/usr/local/lib/libsfml-window.so||undefined reference to `xcb_randr_query_version_reply'|
/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 `xcb_randr_set_screen_config_reply'|
/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 `xcb_randr_get_screen_info_sizes_length'|
/usr/local/lib/libsfml-window.so||undefined reference to `xcb_randr_set_screen_config'|
/usr/local/lib/libsfml-window.so||undefined reference to `xcb_randr_get_screen_info'|
/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'|
||=== Build finished: 34 errors, 3 warnings ===|
You will need to install the libraries which SFML is trying to reference. I don't use Ubuntu, though it looks like you will need to use your package manager to get libxcb-image0-dev, libxcb-randr0-dev, and libudev-dev.
If all else fails, you can install directly from the official repositories http://www.sfml-dev.org/tutorials/2.3/start-linux.php. I don't think it's the newest build, but It's also not that far behind.
Beginner here <- please take any opinions with grain of salt
You will need to install the libraries which SFML is trying to reference. I don't use Ubuntu, though it looks like you will need to use your package manager to get libxcb-image0-dev, libxcb-randr0-dev, and libudev-dev.
I installed them. Now only the first three warnings are gone, but these 34 undefined reference errors are still showing :-
/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 `xcb_randr_get_screen_info_sizes'|
/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 `xcb_randr_query_version'|
/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 `xcb_randr_get_screen_info_reply'|
/usr/local/lib/libsfml-window.so||undefined reference to `udev_monitor_receive_device@LIBUDEV_183'|
/usr/local/lib/libsfml-window.so||undefined reference to `xcb_create_pixmap_from_bitmap_data'|
/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 `xcb_randr_id'|
/usr/local/lib/libsfml-window.so||undefined reference to `udev_monitor_get_fd@LIBUDEV_183'|
/usr/local/lib/libsfml-window.so||undefined reference to `xcb_randr_query_version_reply'|
/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 `xcb_randr_set_screen_config_reply'|
/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 `xcb_randr_get_screen_info_sizes_length'|
/usr/local/lib/libsfml-window.so||undefined reference to `xcb_randr_set_screen_config'|
/usr/local/lib/libsfml-window.so||undefined reference to `xcb_randr_get_screen_info'|
/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'|
||=== Build finished: 34 errors ===|
If all else fails, you can install directly from the official repositories http://www.sfml-dev.org/tutorials/2.3/start-linux.php. I don't think it's the newest build, but It's also not that far behind.
It is very far behind. Ubuntu 12.04 has SFML 1.6 in its repositories, whereas the current version is 2.3. I have already tried this 1.6 version but it was totally messed up. The syntax of its functions were very different from the new SFML versions.
So I downloaded the latest SFML for linux, placed its header files in usr/local/lib and placed the modules in usr/local/include, which are the standard locations for installing libraries. Now it is giving me these undefined reference errors in code::blocks, and also when I compile and run from the terminal.
If all else fails, you can install directly from the official repositories http://www.sfml-dev.org/tutorials/2.3/start-linux.php. I don't think it's the newest build, but It's also not that far behind.
It is very far behind. Ubuntu 12.04 has SFML 1.6 in its repositories, whereas the current version is 2.3. I have already tried this 1.6 version but it was totally messed up. The syntax of its functions were very different from the new SFML versions.
So I downloaded the latest SFML for linux, placed its header files in usr/local/lib and placed the modules in usr/local/include, which are the standard locations for installing libraries. Now it is giving me these undefined reference errors in code::blocks, and also when I compile and run from the terminal.
Ah, I was anticipating you were at least using the latest lts (Ubuntu 14.04). I believe that's been updated to 2.1 for awhile now, which isn't the latest build but also not that far behind, feature-wise.
Beginner here <- please take any opinions with grain of salt