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

Author Topic: Linker error using Visual Studio 2013  (Read 3729 times)

0 Members and 1 Guest are viewing this topic.

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Linker error using Visual Studio 2013
« on: May 10, 2014, 05:41:10 pm »
First off, I think I know where this problem stems. Let me start by explaining that I wanted to use SFML master from github so that I can use SFML with Thor. Well, for now I am just planning to use SFML on Visual Studio 2013 Express Edition. So I downloaded CMake to build Thor and SFML from source to give me the required binaries(.dll/lib files). Now there is problem, CMake doesn't have VS2013 express edition option for building so I built mine using VS 2012 in the hopes it will run anyway since I am using an earlier version. But in my surprise it didn't. As you can see I got this following error reading tutorials SFML Vertex Array:

1>------ Build started: Project: SFML Vertex, Configuration: Debug Win32 ------
1>  main.cpp
1>main.obj : error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
1>C:\Users\Neon Warge\documents\visual studio 2013\Projects\SFML vertex\Debug\SFML Vertex.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 

I firmly believe where this problem stems, incompatible versions right? Because the built was supposedly for VS 2012 not 2013. Actually I saw a post right here, about templates binaries for VS 2013. It's a solution, well, great! I can't recall the link by the way but I can google it. I am tired and sleepy right now so I can't do pasting the link here.

I don't know if the solution works, it ask me to download some few stuff about templates and what not. But the binary part is something I do not want. Since, I am using the actual source file on GitHub(for both SFML and Thor).

I hit a snag I no longer know what to do. I can't seem to render anything at all. Even sf::Color::[Color] doesn't even work without throwing linking errors.

So my question is, how can I build SFML and Thor for Visual Studio 2013 Express Edition. If there is no way, I can always switch back to Code::Blocks you know...

I prefer 'ONLY' the master files on github and able to use Thor with SFML on Visual Studio 2013 Express Edition.

That would be all, thanks! While you are reading this, rest assured I am also solving this problem alone. Internet is not helpful, even the MSDN resources. So thanks a lot!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Linker error using Visual Studio 2013
« Reply #1 on: May 10, 2014, 05:44:03 pm »
Now there is problem, CMake doesn't have VS2013 express edition option
It does ("Visual Studio 12"). Update CMake if necessary.

so I built mine using VS 2012 in the hopes it will run anyway since I am using an earlier version. But in my surprise it didn't.
Yes, you can't simply mix compiler versions.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: Linker error using Visual Studio 2013
« Reply #2 on: May 10, 2014, 05:50:39 pm »
Wow, that's good to know! But it doesn't work unfortunately. Well I do know how to read linker errors but this is something fishy for me:

this error:
Error   1       error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
 

I think I just rebuild SFML and Thor with CMake again, and oh I forgot to tell you, I have downloaded latest CMake version. My CMake version is version 2.8.12.2. Is that the latest version? I just downloaded it when I built SFML and Thor using CMake.

I think I just have to rebuild it, but ofcourse that is the last resort. If there is a solution without rebuilding the source files, that'd be great.

I think I have missed something quite important here...

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: Linker error using Visual Studio 2013
« Reply #3 on: May 10, 2014, 06:41:33 pm »
Alright I just build from scratch again and guess what same error. I don't know what to do, I have did the same thing using Code::Blocks and read the tutorials on SFML with Visual Studio but I think this is beyond the scope of tutorials.

It spit out the same error. What do you think is the problem?

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: Linker error using Visual Studio 2013
« Reply #4 on: May 10, 2014, 06:59:04 pm »
I solved it, I just replace it with SFML_DYNAMIC and it works fine now... geez

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Linker error using Visual Studio 2013
« Reply #5 on: May 10, 2014, 07:04:32 pm »
I solved it, I just replace it with SFML_DYNAMIC and it works fine now... geez
You mean SFML_STATIC? The SFML_DYNAMIC macro is ancient, so your version would be extremely outdated.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything