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

Author Topic: Unresolved linker externals  (Read 3297 times)

0 Members and 1 Guest are viewing this topic.

tokiwotomare

  • Newbie
  • *
  • Posts: 21
    • View Profile
Unresolved linker externals
« on: April 07, 2011, 05:33:41 am »
Since I'm sure you guys get tons and tons of linker questions, I'll try and keep this snappy!

Environment:
- SFML 2 (latest Git download as of ~2330 EST on april 6th)
- Used CMake to generate a VS2010 project
- Used make and make-install in said VS2010 project; everything appeared to propagate correctly (odd sidenote: VS2010 didn't load an appropriate "make clean" build?)

Settings:
Preprocessor: SFML_STATIC
Linked files:
Code: [Select]
sfml-window-s-d.lib
sfml-graphics-s-d.lib
sfml-system-s-d.lib
sfml-audio-s-d.lib

Build type: Debug

The build output:
EDIT: Since the output was waaaaay larger than I thought, I put it all in a pastebin here.

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
Unresolved linker externals
« Reply #1 on: April 07, 2011, 06:37:41 am »
I'm having the same issues you are, (more or less)
trying to use a new build, but when i compile my project using it, i get a re-donk-you-less, amount of linking errors, was about to post the same question so an answer to this would be sweet.
John Carmack can Divide by zer0.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Unresolved linker externals
« Reply #2 on: April 07, 2011, 08:00:53 am »
Did you set the FORCE_STATIC_VCRT CMake variable to TRUE, or did you leave it to FALSE?

What option do you have in "project settings -> C/C++ -> code generation -> C runtime": "multithreaded debug DLL" or "multithreaded debug"?
Laurent Gomila - SFML developer

tokiwotomare

  • Newbie
  • *
  • Posts: 21
    • View Profile
Unresolved linker externals
« Reply #3 on: April 08, 2011, 12:53:49 am »
I left both as they were on default -- FORCE_STATIC_VCRT is false; the runtime is multithreaded debug DLL.

I tried changing it to multithreaded debug, and I tried setting FORCE_STATIC_VCRT to true (I also tried changing one and not the other, and vice versa).

The problem still remains. :(

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Unresolved linker externals
« Reply #4 on: April 08, 2011, 07:54:43 am »
Looks like a bad compiler configuration, or a bad mix between compilers.

Try searching on Google, it has lots of results for this kind of error.
Laurent Gomila - SFML developer

tokiwotomare

  • Newbie
  • *
  • Posts: 21
    • View Profile
Unresolved linker externals
« Reply #5 on: April 09, 2011, 06:32:50 pm »
Just thought I'd note that I fixed it -- although I wish I was totally certain about what, exactly, I did!

When switching to static libs (and when switching to the multi-threaded debug runtime), I found that Visual Studio 2010 was keeping the wrong default libraries loaded -- I don't know if you're having the same problem I was, WitchD0ctor, but I had to specifically invoke the correct default libraries for my configuration, while specifically telling it to ignore the wrong ones, which it was previously using correctly.

You have to invoke different ones depending on which runtime you're using; make sure you're invoking the correct ones.

drakelord

  • Newbie
  • *
  • Posts: 22
    • View Profile
Unresolved linker externals
« Reply #6 on: April 14, 2011, 07:53:47 pm »
When I switch between libraries and such I often times get this issue.  The easiest way by far is to just recompile everything, making sure that all of the settings are 100% uniform across the entire board.

What that means is, if your final product is going to be Multi-threaded Debug/Release Static, make sure that all of the libraries compiled beforehand follow this.  Most of the errors come from one of the libraries being compiled under a different setting such as being dynamically linked.

 

anything