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

Author Topic: Undefined reference to...  (Read 4194 times)

0 Members and 1 Guest are viewing this topic.

NekoFuu

  • Newbie
  • *
  • Posts: 12
    • View Profile
Undefined reference to...
« on: July 12, 2012, 12:21:06 pm »
Alright, so it is completely possible I'm doing something terribly wrong.. but here we go:
SFML version: 2.0 snapshot
OS: Windows 7 64-bit
IDE: Codeblocks
Compiler: MinGW32

If I try using SFML dynamically, it works fine. I don't get any errors or anything. However, if I try linking everything statically, I get the following errors found here: PasteBin

Under project settings I have the SFML_STATIC in the #define tab thing. And under the linker settings I have these libraries added in this order:
sfml-graphics-s
sfml-audio-s
sfml-window-s
sfml-network-s
sfml-system-s

Since everything works dynamically, I'm led to believe the problem lies in the project settings, or the static .a files(possibly generated them wrong or something). I thought I followed two separate tutorials exactly, but similar errors, if not the same appeared both times.

Any ideas?
« Last Edit: July 12, 2012, 08:22:51 pm by Laurent »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [unasnwered]Undefined reference to...
« Reply #1 on: July 12, 2012, 01:05:46 pm »
Which version of SFML 2 did you download? Did you compile it yourself?

Have you tried the precompiled RC?
Laurent Gomila - SFML developer

NekoFuu

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [unasnwered]Undefined reference to...
« Reply #2 on: July 12, 2012, 01:38:54 pm »
On the website, I went to the Downloads page, and clicked on "SFML 2.0 snapshot" under "Latest development snapshot".. so whichever version that is.

I used Cmake and I first tried doing it manually through the command prompt , and then tried using the Cmake-gui in order to do it.

I was unaware of a precompiled release candidate though?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [unasnwered]Undefined reference to...
« Reply #3 on: July 12, 2012, 01:53:41 pm »
Quote
I was unaware of a precompiled release candidate though?
It's below on the download page.
Laurent Gomila - SFML developer

NekoFuu

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [unasnwered]Undefined reference to...
« Reply #4 on: July 12, 2012, 02:06:18 pm »
Alright I tried the RC and this was what I got in response:

http://pastebin.com/MUHnW9YY

If nothing else, I don't need to use static libraries. It is, however, something I'd like to see working in case I ever needed to use it.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [unasnwered]Undefined reference to...
« Reply #5 on: July 12, 2012, 02:51:23 pm »
Are you really sure that you got these errors with the RC? They are still the same as before.
Laurent Gomila - SFML developer

NekoFuu

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [unasnwered]Undefined reference to...
« Reply #6 on: July 12, 2012, 03:00:12 pm »
Actually the new errors are displayed because of an undefined reference to something inside of GLCheck.cpp (and later on shader.cpp) whereas the first time around it was logging something about undefined references to something inside of Font.cpp (I assume the graphics library).

I tried to 'Rebuild Workstation' rather than just build, and that's when I received those errors.

Keep note that these errors only occur when attempting to create a static link through the files. If used dynamically, and inserting the .dlls into their correct directories, everything works fine.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [unasnwered]Undefined reference to...
« Reply #7 on: July 12, 2012, 03:22:55 pm »
What is the output of the "gcc -v" command in a terminal?
Laurent Gomila - SFML developer

NekoFuu

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [unasnwered]Undefined reference to...
« Reply #8 on: July 12, 2012, 03:37:02 pm »
Using built-in specs.
Target: mingw32
Configured with: ../../gcc-4.4.1/configure --prefix=/mingw --build=mingw32 --enable-languages=c,ada,c++,fortran,objc,obj-c++ --disable-nld --disable-win32-registry --enable-libgromp --enable-cxx-flags='-fno-function-sections -fno-data-sections' --disable-werror --enable-threads --disable-symvers --enable-version-specific-runtime-libs --enable-fully-dynamic-string --with-pkgversion='TDM-2 mingw32' -enable-sjlj-exceptions --with-bugurl=http://www.tdragon.net/recentgcc/bugs.php
Thread model: win32
gcc version: 4.4.1 <TDM-2 mingw32>

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [unasnwered]Undefined reference to...
« Reply #9 on: July 12, 2012, 04:08:21 pm »
And which archive of the RC did you download (there are several variants available for gcc under Windows)?
Laurent Gomila - SFML developer

NekoFuu

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [unasnwered]Undefined reference to...
« Reply #10 on: July 12, 2012, 08:10:42 pm »
I downloaded the one that said "(Codeblocks)" beside it.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Undefined reference to...
« Reply #11 on: July 12, 2012, 08:23:31 pm »
So it should definitely work. Delete everything, read the tutorial step by step and restart from scratch.
Laurent Gomila - SFML developer

NekoFuu

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Undefined reference to...
« Reply #12 on: July 12, 2012, 08:32:03 pm »
I have already done that several times, but I will try that again. Just in case.

I got curious, so I created a new project, this time with both Debug and Release(my previous project didn't have a debug). I put in the linker settings and everything for both, again attempting to use static linking.

The debug works perfectly. No problem whatsoever. When I switch build option over to Release, however, I receive the same error as before.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Undefined reference to...
« Reply #13 on: July 12, 2012, 08:43:21 pm »
Can you upload your Code::Blocks project (.cbp file)?
Laurent Gomila - SFML developer

NekoFuu

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Undefined reference to...
« Reply #14 on: July 12, 2012, 08:51:47 pm »

 

anything