1
General / Build Errors only with Code::Blocks?
« on: November 29, 2018, 12:50:00 am »
I'm trying to get SFML 2.5.1 to work with Code::Blocks so I can compile programs off my flash drive. I've already gotten it to work perfectly fine on VS2017 with very few issues. However, I get errors whenever I use C::B. I've followed the official tutorial numerous times and have tested it on maybe 4 different computers (My school has a network connected student drive). Still, I get the same build errors. The errors are from the headers themselves and not from the source file I'm compiling. There is one exception, and that is when I try to use SFML with C::B on my own home PC. I get a bunch of undefined reference errors and no similar errors to the ones on the school computers.
C::B version: 17.12 MingW no-setup
OS: Windows 10
SFML: 2.5.1 CB SJLJ
Build Errors on My PC:
Sorry, I'll have to get the log for the other computers tomorrow.
Thanks in advance for info/help.
Edit: Oh shoot! I'm dumb lol. I forgot to link sfml-graphics... I DID do this on the other computers, though, so I have no clue on those. I'll have to get the logs tomorrow.
C::B version: 17.12 MingW no-setup
OS: Windows 10
SFML: 2.5.1 CB SJLJ
Build Errors on My PC:
-------------- Build: Release in SFMLProject (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -DSFML_STATIC -O2 -I..\..\..\..\SFFMLLLL\include -c C:\Users\green\Documents\SFMLProject\main.cpp -o obj\Release\main.o
mingw32-g++.exe -L..\..\..\..\SFFMLLLL\lib -o bin\Release\SFMLProject.exe obj\Release\main.o -s -lfreetype -lsfml-window-s -lopengl32 -lgdi32 -lsfml-system-s -lwinmm
obj\Release\main.o:main.cpp:(.text.startup+0x13a): undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
obj\Release\main.o:main.cpp:(.text.startup+0x184): undefined reference to `sf::CircleShape::CircleShape(float, unsigned int)'
obj\Release\main.o:main.cpp:(.text.startup+0x184): undefined reference to `sf::Color::Green'
obj\Release\main.o:main.cpp:(.text.startup+0x193): undefined reference to `sf::Shape::setFillColor(sf::Color const&)'
obj\Release\main.o:main.cpp:(.text.startup+0x223): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
obj\Release\main.o:main.cpp:(.text.startup+0x23a): undefined reference to `sf::RenderTarget::clear(sf::Color const&)'
obj\Release\main.o:main.cpp:(.text.startup+0x251): undefined reference to `sf::RenderStates::Default'
obj\Release\main.o:main.cpp:(.text.startup+0x259): undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'
obj\Release\main.o:main.cpp:(.text.startup+0x296): undefined reference to `vtable for sf::CircleShape'
obj\Release\main.o:main.cpp:(.text.startup+0x2a0): undefined reference to `vtable for sf::CircleShape'
obj\Release\main.o:main.cpp:(.text.startup+0x2a5): undefined reference to `sf::Shape::~Shape()'
obj\Release\main.o:main.cpp:(.text.startup+0x2ba): undefined reference to `sf::RenderWindow::~RenderWindow()'
obj\Release\main.o:main.cpp:(.text.startup+0x351): undefined reference to `vtable for sf::CircleShape'
obj\Release\main.o:main.cpp:(.text.startup+0x35b): undefined reference to `vtable for sf::CircleShape'
obj\Release\main.o:main.cpp:(.text.startup+0x360): undefined reference to `sf::Shape::~Shape()'
obj\Release\main.o:main.cpp:(.text.startup+0x375): undefined reference to `sf::RenderWindow::~RenderWindow()'
collect2.exe: error: ld returned 1 exit status
mingw32-g++.exe -Wall -DSFML_STATIC -O2 -I..\..\..\..\SFFMLLLL\include -c C:\Users\green\Documents\SFMLProject\main.cpp -o obj\Release\main.o
mingw32-g++.exe -L..\..\..\..\SFFMLLLL\lib -o bin\Release\SFMLProject.exe obj\Release\main.o -s -lfreetype -lsfml-window-s -lopengl32 -lgdi32 -lsfml-system-s -lwinmm
obj\Release\main.o:main.cpp:(.text.startup+0x13a): undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
obj\Release\main.o:main.cpp:(.text.startup+0x184): undefined reference to `sf::CircleShape::CircleShape(float, unsigned int)'
obj\Release\main.o:main.cpp:(.text.startup+0x184): undefined reference to `sf::Color::Green'
obj\Release\main.o:main.cpp:(.text.startup+0x193): undefined reference to `sf::Shape::setFillColor(sf::Color const&)'
obj\Release\main.o:main.cpp:(.text.startup+0x223): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
obj\Release\main.o:main.cpp:(.text.startup+0x23a): undefined reference to `sf::RenderTarget::clear(sf::Color const&)'
obj\Release\main.o:main.cpp:(.text.startup+0x251): undefined reference to `sf::RenderStates::Default'
obj\Release\main.o:main.cpp:(.text.startup+0x259): undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'
obj\Release\main.o:main.cpp:(.text.startup+0x296): undefined reference to `vtable for sf::CircleShape'
obj\Release\main.o:main.cpp:(.text.startup+0x2a0): undefined reference to `vtable for sf::CircleShape'
obj\Release\main.o:main.cpp:(.text.startup+0x2a5): undefined reference to `sf::Shape::~Shape()'
obj\Release\main.o:main.cpp:(.text.startup+0x2ba): undefined reference to `sf::RenderWindow::~RenderWindow()'
obj\Release\main.o:main.cpp:(.text.startup+0x351): undefined reference to `vtable for sf::CircleShape'
obj\Release\main.o:main.cpp:(.text.startup+0x35b): undefined reference to `vtable for sf::CircleShape'
obj\Release\main.o:main.cpp:(.text.startup+0x360): undefined reference to `sf::Shape::~Shape()'
obj\Release\main.o:main.cpp:(.text.startup+0x375): undefined reference to `sf::RenderWindow::~RenderWindow()'
collect2.exe: error: ld returned 1 exit status
Sorry, I'll have to get the log for the other computers tomorrow.
Thanks in advance for info/help.
Edit: Oh shoot! I'm dumb lol. I forgot to link sfml-graphics... I DID do this on the other computers, though, so I have no clue on those. I'll have to get the logs tomorrow.