Hello,
I am trying to use the following video game files project:
https://github.com/Headturna/SFML_RPGIt's an RPG game.
I am not an expert, so what I am going to do is to show you what I have done, and the errors I got, And hopefully I get some guidance on the problems/steps I missed please? Ok here we go:
First, I downloaded SFML and configured it Visual Studio Code using this method:
In summary, i did not use the visual studio preferences menu to link the libraries as shown in the SFML help page (Learn), Instead I call the libraries in a line of code, like this:
g++ -c main.cpp -I"path..\include" -DSFML_STATIC
g++ main.o -o jojo -L"path..\lib" -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lsfml-audio-s -lsfml-network-s -lopengl32 -lfreetype -lwinmm -lgdi32 -lopenal32 -lflac -lvorbisenc -lvorbisfile -lvorbis -logg -lws2_32 -mwindows -lsfml-main
But I make sure the file
c_cpp_properties.json has the path to the "include".
This method worked for the very simple example and I got that green circle. I even tried a example tetris code I found on youtube it worked.
___
The problem the RPG game:
I set visual studio code on the SFML_RPG directroy, the one containing main.cpp and ALL other files.
i try to run it in a similar way bit I get these errors:
main.o:main.cpp:(.text+0x1e): undefined reference to `Game::Game()'
main.o:main.cpp:(.text+0x2a): undefined reference to `Game::run()'
main.o:main.cpp:(.text+0x3b): undefined reference to `Game::~Game()'
main.o:main.cpp:(.text+0x4e): undefined reference to `Game::~Game()'
collect2.exe: error: ld returned 1 exit status
What's the problem?
Are my lines of code short and need to include EVERY cpp file from the SFML_RPG?
Please give me some input to be able to run this.
Thanks!