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

Author Topic: SFML2 and Visual C++ 2003 - possible!  (Read 4798 times)

0 Members and 1 Guest are viewing this topic.

T.T.H.

  • Full Member
  • ***
  • Posts: 112
    • View Profile
SFML2 and Visual C++ 2003 - possible!
« on: November 04, 2009, 11:41:49 am »
The year 2009, the whole world is using modern compilers. Well, not entirely? One small programmer still holds out against the adherence to standards, thanks to a pretty old compiler made by Microsoft.

At work I'm (still) using Visual C++ .NET 2003 (compiler version 7.1.6030, "Professional" edition) - for good reasons and with many headaches.

Nevertheless I think about using SFML at work, too, and today simply tried it out (updates of 11. June 2010 in red):
[list=1]
  • I got SFML2 ( https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2 revision 1258 )
  • I got Visual Studio Project Converter ( http://sourceforge.net/projects/vspc/ version 0.9.3 )
  •  I converted "build\vc2008\SMFL.sln" from VS2008 to VS2003 project format with that tool
  • I opened the converted file "SFML.sln" with Visual C++ 2003
  • I manually removed the compile option "/MP" from "Configuration Properties", "C++", "Command Line"
  • I added the compile option "/Zc:wchar_t" to "Configuration Properties", "C++", "Command Line" ( based on hints in this thread at the Ogre forums)
  • I added the following code into Image.cpp between the header includes and the first namespace::sf definition:
    Code: [Select]
    ////////////////////////////////////////////////////////////
    // HACK FOR VS2003
    // http://software.intel.com/en-us/forums/showthread.php?t=60003
    extern "C" {
    long _ftol( double );
    long _ftol2_sse( double dblSource ) { return _ftol( dblSource ); }
    }

  • I set the project "opengl" as startup project
  • I compiled the "opengl" project in the modes "Release static" and "Debug static" which then automatically built the dependencies "sfml-graphics", "sfml-window", "sfml-system" and "sfml-main"
  • I ignored a huge list of compiler warnings
  • I started "opengl.exe" and "opengl-d.exe" from the command line
  • I happily jumped around seeing the rotating cube in front of the green landscape[/list:o]
    I have no clue how this experiment will go on further but I just wanted to let you know that as of now it is still possible to compile SFML with Visual C++ 2003 (at least the graphics part which is of interest for me).

    As of 11. June 2010 this works with https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2 revision 1523 and was tested with "Release static" and "Debug static".

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
SFML2 and Visual C++ 2003 - possible!
« Reply #1 on: November 05, 2009, 08:12:21 am »
Well, the only thing that differs between MSVC++ releases is the splash image, isn't it?

SCNR ;)

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML2 and Visual C++ 2003 - possible!
« Reply #2 on: November 05, 2009, 09:58:58 am »
Quote from: "Tank"
Well, the only thing that differs between MSVC++ releases is the splash image, isn't it?

SCNR ;)
:lol:
SFML / OS X developer

T.T.H.

  • Full Member
  • ***
  • Posts: 112
    • View Profile
SFML2 and Visual C++ 2003 - possible!
« Reply #3 on: November 05, 2009, 10:16:36 am »
In contrary to VC++ 2003 my VC++ 2008 does not crash on a daily basis...

forrestcupp

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
SFML2 and Visual C++ 2003 - possible!
« Reply #4 on: December 05, 2009, 12:16:54 am »
Do you need MFC or ATL enough to not upgrade to the newest free Visual C++ Express?  It's really not lacking that much from the pro version, and it seems a lot snappier and more stable.

But if you need the extra features and can't afford an upgrade, you shouldn't have any problems using 2003.  The fundamentals work pretty much the same way; the settings just look a little different.

T.T.H.

  • Full Member
  • ***
  • Posts: 112
    • View Profile
SFML2 and Visual C++ 2003 - possible!
« Reply #5 on: June 11, 2010, 06:02:11 pm »
Just made an update to my tutorial in the first post after updating SFML2 to the latest revision. After making a small modification due to a linker issue regarding external libraries and SSE2 it seems that SFML2 is actually still working in Visual C++ 2003.