Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - justAuser

Pages: [1]
1
General / Re: Build fails; 'undefined reference to..'
« on: December 12, 2021, 12:34:28 pm »
Edit, I've solved this now. For anyone finding this sub in the future, you cant run the 32-bit sfml if you are using the 64 bit codeblocks

So, instead of "GCC 5.1.0 TDM (SJLJ) - Code::Blocks - 32-bit" version of SFML, I should use the "GCC 7.3.0 MinGW (SEH) - 64-bit" version for "codeblocks-20.03mingw-setup.exe" version of Code::Blocks?

2
General / Re: Code::Blocks linking issues
« on: December 10, 2021, 03:27:54 pm »
I do have multiple files but I am not sure if they have been linked to the main file. I simply installed this project from the Internet and went ahead and opened the main.cpp file on Code::Blocks.

Here is the verbose build output:
g++.exe -std=c++11 -DSFML_STATIC -I"C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\SFML-2.5.1\include" -c "C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.cpp" -o "C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o"
g++.exe -L"C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\SFML-2.5.1\lib" -o "C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.exe" "C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o"   "C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\SFML-2.5.1\lib\libsfml-graphics-s.a" "C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\SFML-2.5.1\lib\libsfml-window-s.a" "C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\SFML-2.5.1\lib\libsfml-system-s.a" "C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\SFML-2.5.1\lib\libopenal32.a" "C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\SFML-2.5.1\lib\libfreetype.a"
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x70e): undefined reference to `sf::String::String(char const*, std::locale const&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x72e): undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x777): undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x7d4): undefined reference to `sf::View::View(sf::Rect<float> const&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x7ee): undefined reference to `sf::RenderTarget::setView(sf::View const&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x7fd): undefined reference to `GhostManager::GhostManager()'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x80c): undefined reference to `Pacman::Pacman()'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x844): undefined reference to `convert_sketch(std::array<std::string, 21ull> const&, std::array<Position, 4ull>&, Pacman&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x88f): undefined reference to `GhostManager::reset(unsigned char, std::array<Position, 4ull> const&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x972): undefined reference to `sf::Window::close()'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x988): undefined reference to `sf::Window::pollEvent(sf::Event&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x9a9): undefined reference to `Pacman::get_dead()'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x9eb): undefined reference to `Pacman::update(unsigned char, std::array<std::array<Cell, 21ull>, 21ull>&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xa15): undefined reference to `GhostManager::update(unsigned char, std::array<std::array<Cell, 21ull>, 21ull>&, Pacman&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xb24): undefined reference to `Pacman::set_animation_timer(unsigned short)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xb33): undefined reference to `sf::Keyboard::isKeyPressed(sf::Keyboard::Key)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xb51): undefined reference to `Pacman::get_dead()'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xb95): undefined reference to `convert_sketch(std::array<std::string, 21ull> const&, std::array<Position, 4ull>&, Pacman&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xbe0): undefined reference to `GhostManager::reset(unsigned char, std::array<Position, 4ull> const&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xbef): undefined reference to `Pacman::reset()'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xc27): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xc41): undefined reference to `sf::RenderTarget::clear(sf::Color const&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xc5e): undefined reference to `Pacman::get_dead()'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xc8f): undefined reference to `draw_map(std::array<std::array<Cell, 21ull>, 21ull> const&, sf::RenderWindow&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xc9e): undefined reference to `Pacman::get_energizer_timer()'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xcc1): undefined reference to `GhostManager::draw(bool, sf::RenderWindow&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xd25): undefined reference to `draw_text(bool, unsigned short, unsigned short, std::string const&, sf::RenderWindow&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xd63): undefined reference to `Pacman::draw(bool, sf::RenderWindow&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xd72): undefined reference to `Pacman::get_animation_over()'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xddd): undefined reference to `draw_text(bool, unsigned short, unsigned short, std::string const&, sf::RenderWindow&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xe57): undefined reference to `draw_text(bool, unsigned short, unsigned short, std::string const&, sf::RenderWindow&)'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xe84): undefined reference to `sf::Window::display()'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xea3): undefined reference to `sf::Window::isOpen() const'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0xeba): undefined reference to `sf::RenderWindow::~RenderWindow()'
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp:(.text+0x12ec): undefined reference to `sf::RenderWindow::~RenderWindow()'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 6 second(s))
36 error(s), 0 warning(s) (0 minute(s), 6 second(s))

3
General / Re: Code::Blocks linking issues
« on: December 08, 2021, 01:36:40 pm »
I only have these:

4
General / Re: Code::Blocks linking issues
« on: December 08, 2021, 01:26:05 pm »
The other files are included using #include "file.hpp" . Do I have to do something else? Also, most of the issues are from the sf namespace, which I think is from the SFML libraries, right?

5
General / Code::Blocks linking issues
« on: December 08, 2021, 12:02:08 pm »
After following the linking tutorial for SFML in Code::Blocks, I am still having trouble to run the code. Here are the errors that I get:
||=== Build file: "no target" in "no project" (compiler: unknown) ===|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::String::String(char const*, std::locale const&)'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::View::View(sf::Rect<float> const&)'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::RenderTarget::setView(sf::View const&)'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `GhostManager::GhostManager()'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `Pacman::Pacman()'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `convert_sketch(std::array<std::string, 21ull> const&, std::array<Position, 4ull>&, Pacman&)'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `GhostManager::reset(unsigned char, std::array<Position, 4ull> const&)'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::Window::close()'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::Window::pollEvent(sf::Event&)'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `Pacman::get_dead()'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `Pacman::update(unsigned char, std::array<std::array<Cell, 21ull>, 21ull>&)'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `GhostManager::update(unsigned char, std::array<std::array<Cell, 21ull>, 21ull>&, Pacman&)'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `Pacman::set_animation_timer(unsigned short)'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::Keyboard::isKeyPressed(sf::Keyboard::Key)'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `Pacman::get_dead()'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `convert_sketch(std::array<std::string, 21ull> const&, std::array<Position, 4ull>&, Pacman&)'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `GhostManager::reset(unsigned char, std::array<Position, 4ull> const&)'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `Pacman::reset()'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::RenderTarget::clear(sf::Color const&)'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `Pacman::get_dead()'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `draw_map(std::array<std::array<Cell, 21ull>, 21ull> const&, sf::RenderWindow&)'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `Pacman::get_energizer_timer()'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `GhostManager::draw(bool, sf::RenderWindow&)'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `draw_text(bool, unsigned short, unsigned short, std::string const&, sf::RenderWindow&)'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `Pacman::draw(bool, sf::RenderWindow&)'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `Pacman::get_animation_over()'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `draw_text(bool, unsigned short, unsigned short, std::string const&, sf::RenderWindow&)'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `draw_text(bool, unsigned short, unsigned short, std::string const&, sf::RenderWindow&)'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::Window::display()'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::Window::isOpen() const'|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::RenderWindow::~RenderWindow()'
|
C:\Users\...\Dropbox\PC\Documents\Project Task 2\Pacman-Main\Source\Main.o:Main.cpp|| undefined reference to `sf::RenderWindow::~RenderWindow()'|
||error: ld returned 1 exit status|
||=== Build failed: 36 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

Pages: [1]
anything