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

Author Topic: [Solved] Undefine reference to loadFromFile  (Read 2063 times)

0 Members and 1 Guest are viewing this topic.

ondrej008

  • Newbie
  • *
  • Posts: 8
    • View Profile
[Solved] Undefine reference to loadFromFile
« on: September 12, 2017, 06:17:57 pm »
Hi guys,
I've tried displaying text or textures on the screen, but it just doesn't work, and when I try I get the following erorr:
||=== Build: Debug in SFMLLOADTEST (compiler: GNU GCC Compiler) ===|
obj\Debug\Source\main.o||In function `main':|
D:\C++\Projects\New folder\Source\main.cpp|13|undefined reference to `_imp___ZN2sf4Font12loadFromFileERKSs'|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

I've reinstalled the correct version of MinGW and SFML already, and checked that they are the correct ones.
But still no success.

Building my own SFML was even worse.

How could I make this work?

I am using Codeblocks, running Windows 64bit, building for 32bit.
SFML version 2.4.2 and MinGW is 6.1.0 (checked with ./gcc.exe -v)
« Last Edit: September 13, 2017, 05:10:50 pm by ondrej008 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11029
    • View Profile
    • development blog
    • Email
Re: Undefine reference to loadFromFile
« Reply #1 on: September 12, 2017, 07:21:04 pm »
Is the MinGW version, the one we link on the download page?

Do you link SFML statically or dynamically?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

ondrej008

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Undefine reference to loadFromFile
« Reply #2 on: September 12, 2017, 07:28:20 pm »
@eXpl0it3r:
1. The time dates and sizes are exactly same, so yes.

2. I'd say Dynamid as I have DLL (Dynamically Linked Libraries) in my project files.


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11029
    • View Profile
    • development blog
    • Email
Re: Undefine reference to loadFromFile
« Reply #3 on: September 12, 2017, 07:40:46 pm »
Do you link the graphics module?

What's your linking order?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

ondrej008

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Undefine reference to loadFromFile
« Reply #4 on: September 12, 2017, 07:59:50 pm »
Here they are

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11029
    • View Profile
    • development blog
    • Email
Re: Undefine reference to loadFromFile
« Reply #5 on: September 12, 2017, 10:09:15 pm »
Try to do a clean rebuild.

By matching date and size of MinGW you mean the package or what has the same size and date?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

ondrej008

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Undefine reference to loadFromFile
« Reply #6 on: September 13, 2017, 05:10:37 pm »
Codeblocks was using the old compiler somewhere in my computer, instead of the compiler in the codeblocks folder.

Sorry...