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

Author Topic: [SOLVED] Compilation Problem LNK1112 "x64" conflict "x86"  (Read 8664 times)

0 Members and 1 Guest are viewing this topic.

nCounter

  • Newbie
  • *
  • Posts: 3
    • View Profile
[SOLVED] Compilation Problem LNK1112 "x64" conflict "x86"
« on: September 04, 2017, 12:14:19 pm »
Hello SFML community,

I know I'm not the first one with this error but I found no post that helps me with my problem  :-\.

I'm getting the "LNK1112: module machine type 'x64' conflicts with target machine type 'X86'" error while I'm trying to compile the SFML window test code:

#include "stdafx.h"
#include <SFML\Graphics.hpp>

int main()
{
        sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
        sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);

        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                }

                window.clear();
                window.draw(shape);
                window.display();
        }
    return 0;
}
 

I'm using Visual Studio Community 2017 and the precompiled SFML 2.4.2 in the 32 bit version (I also tried the 64 bit version in a new project but get the same error ???) All prperties are set to x86 (also the machine setting in the linker options).
I'm runnings this on a 64 bit Windows 10 PC.

So what did I wrong? I used SFML earlier without such a problem (at this point thank you for the very good starting tutorials!). I would be happy if someone has a helpful idea  :-\.
« Last Edit: September 04, 2017, 02:47:55 pm by nCounter »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Compilation Problem LNK1112 "x64" conflict "x86"
« Reply #1 on: September 04, 2017, 02:14:40 pm »
Quote
module machine type 'x64'
Means that you link to a 64-bit library in a 32-bit project.
Laurent Gomila - SFML developer

nCounter

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Compilation Problem LNK1112 "x64" conflict "x86"
« Reply #2 on: September 04, 2017, 02:39:54 pm »
Yes, but I don't understand why. What I linked is the SFML 32 bit Version and there dependencies:
sfml-graphics-s-d.lib
sfml-window-s-d.lib
sfml-system-s-d.lib
opengl32.lib
freetype.lib
jpeg.lib
winmm.lib
gdi32.lib
sfml-audio-s-d.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib

kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib

So I see just 32 bit libs  :-\ I earlier also made 32 bit projects on a 64 bit system and had no problems. Sorry I'm just a beginner in this things.

EDIT: The error says its a problem with the sfml-graphics-s-d.lib
« Last Edit: September 04, 2017, 02:42:48 pm by nCounter »

nCounter

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Compilation Problem LNK1112 "x64" conflict "x86"
« Reply #3 on: September 04, 2017, 02:47:39 pm »
...well I solved it...

As always the stupid not working thing is the guy in the front of the pc...
As I tried the 32 bit Version of SFML I copied the SFML again from the 64 bit ZIP folder...

So with the 32 bit Version of SFML 2.4.2 it works just fine.

Sorry!

 

anything