Hello to all.I am making an application with sfml and I try to compile the example with codeblocks but I got 20 undefined reference to.I am using codeblocks 13.12 and the tdm suited with this version,the 4.8.1 x64.
So I downloaded the x64 package for windows of sfml and I got this while trying to compile the example:
-------------- Clean: Debug in Barco (compiler: GNU GCC Compiler test)---------------
Cleaned "Barco - Debug"
-------------- Build: Debug in Barco (compiler: GNU GCC Compiler test)---------------
g++.exe -Wall -fexceptions -g -IC:\SFML-2.1\include -c "C:\Users\Carlos\Documents\CodeBlocks Projects\Barco\Barco\main.cpp" -o obj\Debug\main.o
g++.exe -LC:\SFML-2.1\lib -o bin\Debug\Barco.exe obj\Debug\main.o -lsfml-graphics-d -lsfml-window-d -lsfml-system-d
obj\Debug\main.o: In function `main':
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:5: undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:5: undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:5: undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:6: undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:7: undefined reference to `_imp___ZN2sf5Color5GreenE'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:7: undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:15: undefined reference to `_imp___ZN2sf6Window5closeEv'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:12: undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:18: undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:18: undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:19: undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:19: undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:20: undefined reference to `_imp___ZN2sf6Window7displayEv'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:9: undefined reference to `_imp___ZNK2sf6Window6isOpenEv'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
obj\Debug\main.o: In function `ZN2sf11CircleShapeD1Ev':
C:/SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `_imp___ZTVN2sf11CircleShapeE'
C:/SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `_imp___ZTVN2sf11CircleShapeE'
C:/SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `_imp___ZN2sf5ShapeD2Ev'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
20 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Thanks
EDIT:
If I put SFML_STATIC this is what I get
-------------- Clean: Debug in Barco (compiler: GNU GCC Compiler)---------------
Cleaned "Barco - Debug"
-------------- Build: Debug in Barco (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -fexceptions -DSFML_STATIC -g -IC:\SFML-2.1\include -c "C:\Users\Carlos\Documents\CodeBlocks Projects\Barco\Barco\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -LC:\SFML-2.1\lib -o bin\Debug\Barco.exe obj\Debug\main.o -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d
obj\Debug\main.o: In function `main':
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:5: undefined reference to `sf::String::String(char const*, std::locale const&)'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:5: undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:5: undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:6: undefined reference to `sf::CircleShape::CircleShape(float, unsigned int)'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:7: undefined reference to `sf::Color::Green'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:7: undefined reference to `sf::Shape::setFillColor(sf::Color const&)'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:15: undefined reference to `sf::Window::close()'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:12: undefined reference to `sf::Window::pollEvent(sf::Event&)'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:18: undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:18: undefined reference to `sf::RenderTarget::clear(sf::Color const&)'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:19: undefined reference to `sf::RenderStates::Default'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:19: undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:20: undefined reference to `sf::Window::display()'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:9: undefined reference to `sf::Window::isOpen() const'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:23: undefined reference to `sf::RenderWindow::~RenderWindow()'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:23: undefined reference to `sf::RenderWindow::~RenderWindow()'
C:/Users/Carlos/Documents/CodeBlocks Projects/Barco/Barco/main.cpp:23: undefined reference to `sf::RenderWindow::~RenderWindow()'
obj\Debug\main.o: In function `ZN2sf11CircleShapeD1Ev':
C:/SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `vtable for sf::CircleShape'
C:/SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `vtable for sf::CircleShape'
C:/SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `sf::Shape::~Shape()'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
20 error(s), 0 warning(s) (0 minute(s), 0 second(s))