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

Author Topic: Problem Compiling After Installing SFML (As Per Official Tutorial) [Screenshots]  (Read 2029 times)

0 Members and 1 Guest are viewing this topic.

cm3rt

  • Newbie
  • *
  • Posts: 4
    • View Profile
I am running Windows 8.1. I am using Microsoft Visual Studio 2010. I downloaded the "Visual C++ 10 (2010) - 64 bits" version of SFML. I extracted it to C:\, and then followed the "http://www.sfml-dev.org/tutorials/2.0/start-vc.php" tutorial exactly. I have also read similar posts, but after trying several fixes, none have worked.

Here are various screenshots of my setup. (All images are uploaded here as well: http://pho.to/7xJYZ)

Additional Dependencies:


Additional Includes:


Additional Libraries:


Where my SFML Folder is located:


Screen of lib folder:


Inside SFML Library folder:


Preprocessor Definition:


Picture of Download:


Target Machine


My System:




When I inserted the sample code into my main.cpp and then compiled, I received the following error.


1>------ Build started: Project: SFML_Project, Configuration: Debug Win32 ------
1>Build started 11/18/2014 7:54:10 PM.
1>InitializeBuildStatus:
1>  Touching "Debug\SFML_Project.unsuccessfulbuild".
1>ClCompile:
1>  main.cpp
1>ManifestResourceCompile:
1>  All outputs are up-to-date.
1>sfml-graphics-d.lib(sfml-graphics-d-2.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.77
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

When I changed the Target Machine to x64, I received the following error:

1>------ Build started: Project: SFML_Project, Configuration: Debug Win32 ------
1>Build started 11/18/2014 8:10:00 PM.
1>InitializeBuildStatus:
1>  Touching "Debug\SFML_Project.unsuccessfulbuild".
1>ClCompile:
1>  All outputs are up-to-date.
1>ManifestResourceCompile:
1>  All outputs are up-to-date.
1>Debug\main.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.11
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Can anyone give me some advice as to why this is happening?

Gambit

  • Sr. Member
  • ****
  • Posts: 283
    • View Profile
You can find the solution to this problem here.

cm3rt

  • Newbie
  • *
  • Posts: 4
    • View Profile
I was just about to say I already did that, but when I read the first article I failed to understand one of the checklist comments,

"Select Build > Configuration Manager from the main menu in visual studio. Make sure your project has the correct platform specified. It is possible for the IDE to be set to build x64 but an individual project in the solution can be set to target win32. So yeah, visual studio leaves a lot of rope to hang yourself, but that's life."

Just in case someone doesn't understand this like me at first, you just open the Properties of the Project. Then I went into Linker and then System. I changed the subsystem to Console:/SUBSYSTEM:CONSOLE. Then I clicked on the Configuration Manager, dropped down the Platform list (Currently at Win32), and clicked new. A new window appeared and I could then select x64 as my main Platform.

After that, the only error I got was that I was missing .dll files for the project, which I then just copied the .dll files from the SFML directory into my C:\Windows\System32 folder, recompiled, and it worked.

Thanks for pointing out my blindness.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11000
    • View Profile
    • development blog
    • Email
Don't copy DLLs into system32! Copy them next to your binary or if you really must, add the directory to PATH.

As for the problem, it's obvious that when you use x64 libraries, you also need to use a x64 compilet. The same goes if you use x86 (32 bit) libraries, you need to use a x86 compiler.
That your system itself is x64 doesn't matter, except that you probably can't run the x64 compiler on a x86 system.
« Last Edit: November 19, 2014, 07:49:21 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/