Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
General
»
sfml with gcc 5.2
Print
Pages: [
1
]
Author
Topic: sfml with gcc 5.2 (Read 5668 times)
0 Members and 1 Guest are viewing this topic.
paupav
Full Member
Posts: 156
sfml with gcc 5.2
«
on:
February 03, 2016, 10:39:29 pm »
compile it and put on the website plox
I'm getting error message: undefined reference to `sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)'|
«
Last Edit: February 03, 2016, 10:42:35 pm by paupav
»
Logged
Hapax
Hero Member
Posts: 3379
My number of posts is shown in hexadecimal.
Re: sfml with gcc 5.2
«
Reply #1 on:
February 03, 2016, 10:44:46 pm »
This is not a "general discussion"; this is a help request and should be posted in the help forums.
You should know this. You've posted there a lot!
Make sure you're linking the libraries.
Logged
Selba Ward
-SFML drawables
Cheese Map
-Drawable Layered Tile Map
Kairos
-Timing Library
Grambol
*
Hapaxia Links
*
eXpl0it3r
SFML Team
Hero Member
Posts: 11032
sfml with gcc 5.2
«
Reply #2 on:
February 03, 2016, 11:00:17 pm »
Just build SFML from source, it's not that complicated.
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
paupav
Full Member
Posts: 156
Re: sfml with gcc 5.2
«
Reply #3 on:
February 04, 2016, 02:56:50 pm »
It is still not working, even after compiling it. I still have the same error message undefined reference to `sf::Font::loadFromFile(std::string const&)'|
and similar errors:
(click to show/hide)
||=== Build: Debug in moj_projekt (compiler: GNU GCC Compiler) ===|
obj/Debug/EditorState.o||In function `EditorState::EditorState(sf::RenderWindow&, Cliff&)':|
/home/paulo/Dokumenti/moj_projekt/EditorState.cpp|13|undefined reference to `sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)'|
/home/paulo/Dokumenti/moj_projekt/EditorState.cpp|22|undefined reference to `sf::Font::loadFromFile(std::string const&)'|
obj/Debug/EditorState.o||In function `EditorState::run()':|
/home/paulo/Dokumenti/moj_projekt/EditorState.cpp|99|undefined reference to `sf::String::String(std::string const&, std::locale const&)'|
obj/Debug/MenuState.o||In function `MenuState::MenuState(sf::RenderWindow&, Cliff&)':|
/home/paulo/Dokumenti/moj_projekt/MenuState.cpp|9|undefined reference to `sf::Font::loadFromFile(std::string const&)'|
||error: ld returned 1 exit status|
||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
Make log:
(click to show/hide)
paulo@omgHaxor:~/Downloads/SFML-make$ sudo make install
[ 16%] Built target sfml-system
[ 38%] Built target sfml-window
[ 48%] Built target sfml-network
[ 79%] Built target sfml-graphics
[100%] Built target sfml-audio
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /usr/local/./include
-- Installing: /usr/local/./include/SFML
-- Installing: /usr/local/./include/SFML/Main.hpp
-- Installing: /usr/local/./include/SFML/Window
-- Installing: /usr/local/./include/SFML/Window/Mouse.hpp
-- Installing: /usr/local/./include/SFML/Window/WindowHandle.hpp
-- Installing: /usr/local/./include/SFML/Window/Event.hpp
-- Installing: /usr/local/./include/SFML/Window/Context.hpp
-- Installing: /usr/local/./include/SFML/Window/VideoMode.hpp
-- Installing: /usr/local/./include/SFML/Window/Window.hpp
-- Installing: /usr/local/./include/SFML/Window/Joystick.hpp
-- Installing: /usr/local/./include/SFML/Window/ContextSettings.hpp
-- Installing: /usr/local/./include/SFML/Window/Keyboard.hpp
-- Installing: /usr/local/./include/SFML/Window/Touch.hpp
-- Installing: /usr/local/./include/SFML/Window/Sensor.hpp
-- Installing: /usr/local/./include/SFML/Window/Export.hpp
-- Installing: /usr/local/./include/SFML/Window/WindowStyle.hpp
-- Installing: /usr/local/./include/SFML/Window/GlResource.hpp
-- Installing: /usr/local/./include/SFML/Network
-- Installing: /usr/local/./include/SFML/Network/TcpSocket.hpp
-- Installing: /usr/local/./include/SFML/Network/SocketSelector.hpp
-- Installing: /usr/local/./include/SFML/Network/Socket.hpp
-- Installing: /usr/local/./include/SFML/Network/SocketHandle.hpp
-- Installing: /usr/local/./include/SFML/Network/Http.hpp
-- Installing: /usr/local/./include/SFML/Network/Ftp.hpp
-- Installing: /usr/local/./include/SFML/Network/TcpListener.hpp
-- Installing: /usr/local/./include/SFML/Network/Packet.hpp
-- Installing: /usr/local/./include/SFML/Network/IpAddress.hpp
-- Installing: /usr/local/./include/SFML/Network/UdpSocket.hpp
-- Installing: /usr/local/./include/SFML/Network/Export.hpp
-- Installing: /usr/local/./include/SFML/Audio.hpp
-- Installing: /usr/local/./include/SFML/Window.hpp
-- Installing: /usr/local/./include/SFML/Graphics
-- Installing: /usr/local/./include/SFML/Graphics/VertexArray.hpp
-- Installing: /usr/local/./include/SFML/Graphics/ConvexShape.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Shape.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Color.hpp
-- Installing: /usr/local/./include/SFML/Graphics/RenderTarget.hpp
-- Installing: /usr/local/./include/SFML/Graphics/RenderWindow.hpp
-- Installing: /usr/local/./include/SFML/Graphics/PrimitiveType.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Transformable.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Image.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Font.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Texture.hpp
-- Installing: /usr/local/./include/SFML/Graphics/RenderStates.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Transform.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Rect.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Glyph.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Vertex.hpp
-- Installing: /usr/local/./include/SFML/Graphics/CircleShape.hpp
-- Installing: /usr/local/./include/SFML/Graphics/BlendMode.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Rect.inl
-- Installing: /usr/local/./include/SFML/Graphics/Drawable.hpp
-- Installing: /usr/local/./include/SFML/Graphics/View.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Sprite.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Shader.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Text.hpp
-- Installing: /usr/local/./include/SFML/Graphics/RenderTexture.hpp
-- Installing: /usr/local/./include/SFML/Graphics/RectangleShape.hpp
-- Installing: /usr/local/./include/SFML/Graphics/Export.hpp
-- Installing: /usr/local/./include/SFML/Network.hpp
-- Installing: /usr/local/./include/SFML/System
-- Installing: /usr/local/./include/SFML/System/MemoryInputStream.hpp
-- Installing: /usr/local/./include/SFML/System/Vector2.inl
-- Installing: /usr/local/./include/SFML/System/Mutex.hpp
-- Installing: /usr/local/./include/SFML/System/ThreadLocal.hpp
-- Installing: /usr/local/./include/SFML/System/Time.hpp
-- Installing: /usr/local/./include/SFML/System/InputStream.hpp
-- Installing: /usr/local/./include/SFML/System/ThreadLocalPtr.hpp
-- Installing: /usr/local/./include/SFML/System/ThreadLocalPtr.inl
-- Installing: /usr/local/./include/SFML/System/Vector3.hpp
-- Installing: /usr/local/./include/SFML/System/String.hpp
-- Installing: /usr/local/./include/SFML/System/FileInputStream.hpp
-- Installing: /usr/local/./include/SFML/System/Utf.inl
-- Installing: /usr/local/./include/SFML/System/Lock.hpp
-- Installing: /usr/local/./include/SFML/System/Vector3.inl
-- Installing: /usr/local/./include/SFML/System/NonCopyable.hpp
-- Installing: /usr/local/./include/SFML/System/Clock.hpp
-- Installing: /usr/local/./include/SFML/System/Utf.hpp
-- Installing: /usr/local/./include/SFML/System/Thread.inl
-- Installing: /usr/local/./include/SFML/System/Vector2.hpp
-- Installing: /usr/local/./include/SFML/System/String.inl
-- Installing: /usr/local/./include/SFML/System/Err.hpp
-- Installing: /usr/local/./include/SFML/System/Sleep.hpp
-- Installing: /usr/local/./include/SFML/System/Export.hpp
-- Installing: /usr/local/./include/SFML/System/Thread.hpp
-- Installing: /usr/local/./include/SFML/OpenGL.hpp
-- Installing: /usr/local/./include/SFML/Config.hpp
-- Installing: /usr/local/./include/SFML/Graphics.hpp
-- Installing: /usr/local/./include/SFML/Audio
-- Installing: /usr/local/./include/SFML/Audio/SoundFileWriter.hpp
-- Installing: /usr/local/./include/SFML/Audio/SoundSource.hpp
-- Installing: /usr/local/./include/SFML/Audio/Listener.hpp
-- Installing: /usr/local/./include/SFML/Audio/Sound.hpp
-- Installing: /usr/local/./include/SFML/Audio/SoundBufferRecorder.hpp
-- Installing: /usr/local/./include/SFML/Audio/SoundFileReader.hpp
-- Installing: /usr/local/./include/SFML/Audio/InputSoundFile.hpp
-- Installing: /usr/local/./include/SFML/Audio/Music.hpp
-- Installing: /usr/local/./include/SFML/Audio/OutputSoundFile.hpp
-- Installing: /usr/local/./include/SFML/Audio/SoundStream.hpp
-- Installing: /usr/local/./include/SFML/Audio/AlResource.hpp
-- Installing: /usr/local/./include/SFML/Audio/SoundFileFactory.hpp
-- Installing: /usr/local/./include/SFML/Audio/SoundRecorder.hpp
-- Installing: /usr/local/./include/SFML/Audio/SoundFileFactory.inl
-- Installing: /usr/local/./include/SFML/Audio/SoundBuffer.hpp
-- Installing: /usr/local/./include/SFML/Audio/Export.hpp
-- Installing: /usr/local/./include/SFML/System.hpp
-- Installing: /usr/local/share/SFML/license.txt
-- Installing: /usr/local/share/SFML/readme.txt
-- Installing: /usr/local/share/SFML/cmake/Modules/FindSFML.cmake
-- Installing: /usr/local/lib/libsfml-system.so.2.3.2
-- Installing: /usr/local/lib/libsfml-system.so.2.3
-- Installing: /usr/local/lib/libsfml-system.so
-- Installing: /usr/local/lib/libsfml-window.so.2.3.2
-- Installing: /usr/local/lib/libsfml-window.so.2.3
-- Installing: /usr/local/lib/libsfml-window.so
-- Removed runtime path from "/usr/local/lib/libsfml-window.so.2.3.2"
-- Installing: /usr/local/lib/libsfml-network.so.2.3.2
-- Installing: /usr/local/lib/libsfml-network.so.2.3
-- Installing: /usr/local/lib/libsfml-network.so
-- Removed runtime path from "/usr/local/lib/libsfml-network.so.2.3.2"
-- Installing: /usr/local/lib/libsfml-graphics.so.2.3.2
-- Installing: /usr/local/lib/libsfml-graphics.so.2.3
-- Installing: /usr/local/lib/libsfml-graphics.so
-- Removed runtime path from "/usr/local/lib/libsfml-graphics.so.2.3.2"
-- Installing: /usr/local/lib/libsfml-audio.so.2.3.2
-- Installing: /usr/local/lib/libsfml-audio.so.2.3
-- Installing: /usr/local/lib/libsfml-audio.so
-- Removed runtime path from "/usr/local/lib/libsfml-audio.so.2.3.2"
Code is correct and libraries are correctly linked.
Code:
https://github.com/paupav/boxGame
«
Last Edit: February 04, 2016, 08:59:24 pm by paupav
»
Logged
dabbertorres
Hero Member
Posts: 505
Re: sfml with gcc 5.2
«
Reply #4 on:
February 05, 2016, 04:06:18 am »
You're probably not linking to the newly created libraries.
You're not showing your compile/link commands.
Also, why are you using gcc 5.2? 5.3 fixes bugs in 5.2.
Logged
Github
paupav
Full Member
Posts: 156
Re: sfml with gcc 5.2
«
Reply #5 on:
February 05, 2016, 09:41:57 am »
That's the version in the Ubuntu 15.10
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 11032
Re: sfml with gcc 5.2
«
Reply #6 on:
February 05, 2016, 01:50:11 pm »
My guess would be that you're not linking against sfml-system or not in the correct order. Can you provide the full build command?
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
paupav
Full Member
Posts: 156
Re: sfml with gcc 5.2
«
Reply #7 on:
February 05, 2016, 03:42:35 pm »
I'm usually using CodeBlocks
EDIT: it seems that I just have to define const strings instead of just writing in file names.
e.g
const
std
::
string
menuFS
=
"menu.ttf"
;
font.
loadFromFile
(
menuFS
)
;
instead of:
font.
loadFromFile
(
"menu.ttf"
)
;
«
Last Edit: February 05, 2016, 03:50:30 pm by paupav
»
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 11032
Re: sfml with gcc 5.2
«
Reply #8 on:
February 05, 2016, 04:06:54 pm »
sfml-network also depends on sfml-system so you'd have to move sfml-system one position down, however that has nothing to do with the error.
You can still extract the
verbose build command
from Code::Blocks.
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
paupav
Full Member
Posts: 156
Re: sfml with gcc 5.2
«
Reply #9 on:
February 05, 2016, 04:37:53 pm »
It is working now for some reason. I've just updated Ubuntu and I've put sfml-network above sfml-system in linker settings.
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
General
»
sfml with gcc 5.2