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

Author Topic: Linker Error with VS2010 RC 2.0 - cannot open file 'sfml-main-d.lib'  (Read 2377 times)

0 Members and 1 Guest are viewing this topic.

chrisciscoioio

  • Newbie
  • *
  • Posts: 17
    • View Profile
So yesterday this worked find up until today.

I followed the tutorial for setting up VS2010, although it left out sfml-main.lib and sfml-main-d.lib.
Everything is setup as it should be with everything pointed to the right file paths and all the includes are right.

It also runs fine in release mode, but if I change the debug mode sfml-main to the release version it will still fail while in debug mode, but release mode works fine, and they are pointing to the same file.

I am sure I will need o provide more information, I will check back every 30 minutes or so while I am in class.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Linker Error with VS2010 RC 2.0 - cannot open file 'sfml-main-d.lib'
« Reply #1 on: September 26, 2012, 02:46:00 pm »
If you're linking dynamically you must place dlls(both -d and release ones) near your project. Also, you don't have to link against main unless you want to keep standard entry point if you created win project instead of win console application.
Actually, it seems main has no dlls. Woopsie.  :-[
Quote
It also runs fine in release mode, but if I change the debug mode sfml-main to the release version it will still fail while in debug mode, but release mode works fine, and they are pointing to the same file.
I don't get what you're trying to say.
« Last Edit: September 26, 2012, 02:56:53 pm by FRex »
Back to C++ gamedev with SFML in May 2023

chrisciscoioio

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Linker Error with VS2010 RC 2.0 - cannot open file 'sfml-main-d.lib'
« Reply #2 on: September 26, 2012, 03:17:56 pm »
Hmm actually I was going through the project file itself to check it, and somehow stuff was corrupted and not what it was suppose to be, no idea how it happened, but it is fixed now.
« Last Edit: September 26, 2012, 03:21:01 pm by chrisciscoioio »

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Linker Error with VS2010 RC 2.0 - cannot open file 'sfml-main-d.lib'
« Reply #3 on: September 26, 2012, 03:21:41 pm »
Quote
If I remove sfml-main-d.lib then it fails to find sfml-system-d.lib, and so on.
Did you dump your lib and hpp files into your compilers vc/include and vc/lib folders?
Switching project between release and debug in solution propeties changes some project settings(like added libs so you dont have to keep adding and removing -d yourself). Might change linker additional paths too.
« Last Edit: September 26, 2012, 03:28:57 pm by FRex »
Back to C++ gamedev with SFML in May 2023

chrisciscoioio

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Linker Error with VS2010 RC 2.0 - cannot open file 'sfml-main-d.lib'
« Reply #4 on: September 26, 2012, 05:40:22 pm »
No I have everything stored at the project level for portability.