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

Author Topic: Build fails; 'undefined reference to..'  (Read 60387 times)

0 Members and 2 Guests are viewing this topic.

justAuser

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Build fails; 'undefined reference to..'
« Reply #15 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?

andrei186

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: Build fails; 'undefined reference to..'
« Reply #16 on: December 12, 2021, 04:39:59 pm »
Is there anything that is not actually explained in the tutorial? If so I'd be glad to add it.

If you mean https://www.sfml-dev.org/tutorials/2.5/start-cb.php then indeed it wants adding in.
For example itn says:
-------
There are multiple variants of GCC for Windows, which are incompatible with each other (different exception management, threading model, etc.). Make sure you select the package which corresponds to the version that you use.
----------
Does this mean SFML version should match Code::Blocks version. If so would you add more detail on this?

konijn

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: Build fails; 'undefined reference to..'
« Reply #17 on: October 06, 2024, 04:17:29 pm »
Example:
Code: [Select]
g++ main.o -o main -ilib/sfml/include -Llib/sfml/lib -lsfml-graphics -lsfml-window -lsfml-system

First time compiling C++ here, this helped. Just noting that it is
Code: [Select]
-Ilib not
Code: [Select]
-ilib

 

anything