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

Author Topic: Compiling SFML2 on 64-bit  (Read 1830 times)

0 Members and 1 Guest are viewing this topic.

Aval

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Compiling SFML2 on 64-bit
« on: December 31, 2010, 04:01:42 am »
So I got a new laptop a few days ago (64-bit Windows 7), and I tried to install SFML2. I have Visual Studio 2010 Professional, and I have the 64-bit compiler already installed.

Using CMake, I tried both the Visual Studio 10 compiler and Visual Studio 10 64-bit, and while the standard compiler works fine, some of the examples didn't work. e.g. the shaders example immediately closes after I start it. So then I tried the 64-bit, and SFML doesn't even compile. I get a 130 linker errors for SFML graphics and audio. Example:


Error   83   error LNK2019: unresolved external symbol jpeg_set_defaults referenced in function "private: bool __cdecl sf::priv::ImageLoader::WriteJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?WriteJpg@ImageLoader@priv@sf@@AEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator
@D@2@@std@@AEBV?$vector@EV?$allocator@E@std@@@5@II@Z)   C:\Users\Zack\sfml2\build\src\SFML\Graphics\ImageLoader.obj   sfml-graphics


I suspect it has to do with the external libraries that sfml-graphics and sfml-audio use, but I'm at a loss at what to do. And why don't the 32-bit compiled SFML samples work right?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Compiling SFML2 on 64-bit
« Reply #1 on: December 31, 2010, 08:08:00 am »
For 64 bits, maybe the external libraries needs to be compiled in 64 bits mode as well. I'm not sure and unfortunately I can't test.

Quote
And why don't the 32-bit compiled SFML samples work right?

I don't know, they should work. Can you use the debugger and see what happens exactly?
Laurent Gomila - SFML developer

Silvah

  • Guest
Compiling SFML2 on 64-bit
« Reply #2 on: December 31, 2010, 11:57:11 am »
Quote from: "Laurent"
For 64 bits, maybe the external libraries needs to be compiled in 64 bits mode as well.
That's the case, 64 bit and 32 bit code cannot be mixed within one program. Theoretically they could, but the performance would be horrific due to repeated mode switching, so it's probably better they can't.

 

anything