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

Author Topic: Setting up SFML with visual c++ 2010 express  (Read 2038 times)

0 Members and 1 Guest are viewing this topic.

rasen58

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Email
Setting up SFML with visual c++ 2010 express
« on: August 29, 2012, 11:59:08 pm »
Hi, I know that this has been asked before, but I can't get sfml to work with 2010 express. I'm on windows 7 64 bit. I have tried so many different ways of setting it up and none of them worked completely.
1.I tried using the vs 2008 package with 2010. I had minimal success. Only the clock example in the sfml tutorial worked. Using another package like graphics made me get a ton of errors/warnings.
2.I opened the C:\SFML-1.6\build\vc2008\sfml.sln with 2010. I then used the updater wizard to make the libs/dlls compatible with2010.
     a. I rebuilt in debug dll, debug static, release dll, release static.
      b. I also tried rebuilding only the debug and release versions.
     I then replaced the old files with the new ones that were rebuilt. I tried compiling a program and I got     tons of errors/warnings.

For both methods, I then went to project properties and tried different ways
1. Adding the path to the include and lib folders in the configuration properties--> VC++ directories. Then added the sfml-system-s-d.lib, etc.. to linker-->input > additional dependencies
2. Adding the path to linker-->general > additional library directories and c/c++ > additional include directories.  and then the sfml-system-s-d.lib,etc.. to linker-->input > additional dependencies
3. Doing either of the above and then adding SFML_STATIC to c/c++ --> preprocessor > preprocessor definitions.
4. Doing any of the above and then going to c/c++ --> code generation > runtime library, changed it to multi-threaded debug, instead of the default multi-threaded debug dll

I don't want to do it dynamically, only statically. What do I do?
I have made it work with 2008, but it lacks intellisense, so i want 2010.

Just some of the errors that i get when I run this code
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>


int main()
{
        sf::RenderWindow screen(sf::VideoMode(820, 640, 32), "SFML Window");
        screen.Display();

        while(screen.IsOpened())
        {
                sf::Event event;
                while(screen.GetEvent(event))
                {
                        if(event.Type == sf::Event::Closed)
                                screen.Close();
                }
        }

        return 0;
}
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Close(void)" (?Close@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (?GetEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@QBE_NXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Setting up SFML with visual c++ 2010 express
« Reply #1 on: August 30, 2012, 09:47:01 am »
I strongly advice you against the use of SFML 1.6 and even stronger against building it on your own. The last update that SFML 1.6 has seen is over two years old and in the meantime a lot of new things got fixed and added and are soon to be released as SFML 2.0. At the moment there are even SFML 2.0rc binaries so you don't need to compiler SFML 2 on your own, but can just start using the library.

There's a tutorial on how to setup VS to work with SFML.
And if you want to build SFML 2 on your own anyways then you can take a look at the other tutorial.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/