K
K
Kiril-cloud2022-02-24 21:31:10
C++ / C#
Kiril-cloud, 2022-02-24 21:31:10

SFML doesn't work, throws an error. What to do?

Good afternoon, I can not do anything on sfml. I installed the library in MyGV and unpacked all folders (lib, include, bin), but still gives an error.
My code:

#include <SFML/Graphics.hpp>
 
int main(int argc, const char * argv[])
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
    return 0;
}


I run:
g++ main.cpp

And I get the error:
C:\Users\kirill\AppData\Local\Temp\ccZyQPqY.o:main.cpp:(.text+0x7c): undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
C:\Users\kirill\AppData\Local\Temp\ccZyQPqY.o:main.cpp:(.text+0xa2): undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:\Users\kirill\AppData\Local\Temp\ccZyQPqY.o:main.cpp:(.text+0xde): undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:\Users\kirill\AppData\Local\Temp\ccZyQPqY.o:main.cpp:(.text+0x109): undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
collect2.exe: error: ld returned 1 exit status

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2022-02-24
@SaNNy32

https://stackoverflow.com/questions/6532400/linkin...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question