Answer the question
In order to leave comments, you need to log in
Why is the SFML application not compiling?
I wanted to make a graphical application in SFML (2.5.1), but when compiling the code, the same error constantly occurs.
Development Environment: Eclipse Cpp
15:49:16 **** Incremental Build of configuration Debug for project vanilla ****
Info: Internal Builder is used for build
g++ -o vanilla.exe "src\\log.o" "src\\vanilla.o" "-lC:\\Users\\vsach\\Documents\\cpp-libs\\SFML-2.5.1\\lib"
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lC:\Users\vsach\Documents\cpp-libs\SFML-2.5.1\lib
collect2.exe: error: ld returned 1 exit status
#include <SFML/Graphics.hpp>
int main() {
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
Answer the question
In order to leave comments, you need to log in
I installed Linux, and now I don't suffer with it. (I don't consider this a solution since I ran away from the problem, not solved it)
You need to set the path to the SFML binaries. The undefined reference to error says that it sees the function in .h files, but does not find its implementation in the included libraries
https://codeyarns.com/2013/09/22/how-to-add-librar...
https: //stackoverflow.com/questions/48367503/undef...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question