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

Author Topic: Errors using VS 2008  (Read 6015 times)

0 Members and 1 Guest are viewing this topic.

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Errors using VS 2008
« on: December 16, 2007, 09:29:18 pm »
I upgraded to VS 2008 last week, and now SFML won't work. I get a bunch of unresolved external errors even though I'm 99.9% sure I installed it the same way as I did for VS 2005 EE. I have followed the steps in the guide at the website.

Does anyone else use VS 2008? Have I missed something or is it because of VS 2008?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Errors using VS 2008
« Reply #1 on: December 17, 2007, 03:26:53 am »
If you use VS 2008 you need the VS 2008 version of the libraries, it won't link with the VS 2005 ones.

You can get the latsest sources from SVN and compile SFML from scratch, the VS 2008 project files are provided.

The VS 2008 libraries will also be included in the next release.
Laurent Gomila - SFML developer

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Errors using VS 2008
« Reply #2 on: December 17, 2007, 10:47:23 am »
I tried that, but it didn't work. But I'm no expert on this so I must be doing something wrong. I tried to compile the static version but I get these lovely unresolved external symbol errors.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Errors using VS 2008
« Reply #3 on: December 17, 2007, 10:53:35 am »
Which ones ?
Laurent Gomila - SFML developer

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Errors using VS 2008
« Reply #4 on: December 17, 2007, 12:34:15 pm »
I managed to get rid of a couple of errors, here's the build log:
Code: [Select]
1>------ Build started: Project: test, Configuration: Debug Win32 ------
1>Compiling...
1>cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
1>main.cpp
1>Linking...
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>sfml-window.lib(OpenGLCaps.obj) : error LNK2019: unresolved external symbol __imp__glewIsSupported referenced in function "public: static bool __cdecl sf::OpenGLCaps::CheckExtension(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?CheckExtension@OpenGLCaps@sf@@SA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>sfml-window.lib(OpenGLCaps.obj) : error LNK2019: unresolved external symbol __imp__glewInit referenced in function "private: static void __cdecl sf::OpenGLCaps::Initialize(void)" (?Initialize@OpenGLCaps@sf@@CAXXZ)
1>C:\Daniel\SFML\test\test\Debug\test.exe : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\Daniel\SFML\test\test\Debug\BuildLog.htm"
1>test - 3 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Here's the code I'm trying to compile:
Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>

using namespace std;

int main()
{
sf::RenderWindow App(sf::VideoMode(1024, 768), "SFML window", sf::Style::Fullscreen, 0);

sf::Image ImgBkg;

if (!ImgBkg.LoadFromFile("./background.jpg"))
{
cout << "error loading image." << endl;
         return EXIT_FAILURE;
}

sf::Sprite SprBkg(ImgBkg, 0.f, 0.f);

bool Running = true;

    while (Running)
    {
sf::Event Event;
        while (App.GetEvent(Event))
        {
if((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
Running = false;
}

App.Draw(SprBkg);
 
        App.Display();
}

    return EXIT_SUCCESS;
}


This is what I have as additional dependencies:
sfml-graphics.lib sfml-window.lib sfml-audio.lib sfml-system.lib sfml-main.lib sfml-network.lib

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Errors using VS 2008
« Reply #5 on: December 18, 2007, 09:53:58 pm »
Apparently I didn't have glew on my computer, now when I have downloaded it SFML runs fine. How come it worked without it in VS 2005 EE?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Errors using VS 2008
« Reply #6 on: December 19, 2007, 02:12:39 am »
GLEW is included in the SFML sources and headers, you shouldn't have to install it externally.

apparently, there's a bad configuration on the VS 2008 project files (maybe a missing preprocessor symbol). I'll check it as soon as possible.
Laurent Gomila - SFML developer