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

Author Topic: [Visual Studio 11] Yet another build problems thread  (Read 2717 times)

0 Members and 1 Guest are viewing this topic.

neb

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
[Visual Studio 11] Yet another build problems thread
« on: May 07, 2013, 07:18:35 am »
I had it working in VS2010 but I am switching to VS2012 but I'm having some problems getting it to work. I am following the tutorial but I will put every step I take here, let me know where I messed it up.

1. New Project (Win32 Console Application/Empty Project)
2. Create main.cpp, I am using the tutorial code.
3. In the properties under All Configuations under C/C++/General I add the include directory
4. I add the lib directory under Linker/General
5. Under Release Linker/Input/Additional Dependencies I add sfml-graphics.lib, sfml-window.lib, sfml-system.lib
6. Under Debug Linker/Input/Additional Dependencies I add sfml-graphics-d.lib, sfml-window-d.lib, sfml-system-d.lib
7. I put the .dll files from sfml path/bin into the project folder with main.cpp
8. Hit build and get this error: sfml-graphics-d.lib(sfml-graphics-d-2.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

I have remade the project a few times just in case I messed something up there, same error. Where am I going wrong?

cristaloleg

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • Email
Re: [Visual Studio 11] Yet another build problems thread
« Reply #1 on: May 07, 2013, 07:46:19 am »
Did You added in Project properties -> C/C++ -> Preprocessor -> Preprocessor Definitions SFML_DYNAMIC or SFML_STATIC ?
Maybe You need also use precompiled libraries for Visual Studio 2012.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [Visual Studio 11] Yet another build problems thread
« Reply #2 on: May 07, 2013, 07:53:23 am »
You downloaded the 64-bits binaries but use them in a 32-bits project (I'm just repeating what the compiler says).
Laurent Gomila - SFML developer

eigengrau

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: [Visual Studio 11] Yet another build problems thread
« Reply #3 on: May 09, 2013, 09:31:02 pm »
Hey, i followed the same instructions with the new SFML 2 in vs2012 and am getting the same error..
Can someone clarify the issue here? Im relatively new to all this.
Should i download the 32 bit version of SFML? i assumed i should download the 64 bit version as i am using a 64 bit pc.
alternately, is there a way to change the project to a 64 bit project in visual studio?
Thanks  :)

Rosme

  • Full Member
  • ***
  • Posts: 169
  • Proud member of the shoe club
    • View Profile
    • Code-Concept
Re: [Visual Studio 11] Yet another build problems thread
« Reply #4 on: May 10, 2013, 01:16:02 am »
It's not because your system is in 64bits that you compiled for 64bits. Unless you've specified in the project configuration that you want x64, it will go with x86. Download the x86 binaries and everything will be alright.
GitHub
Code Concept
Twitter
Rosme on IRC/Discord