SFML community forums

General => General discussions => Topic started by: Xyro on December 12, 2009, 10:07:02 pm

Title: Visuel c++ 2010
Post by: Xyro on December 12, 2009, 10:07:02 pm
Is it possible to let it work, I just tried to use the 2008 libary from the none svn but it ain't working :(
Title: Visuel c++ 2010
Post by: Laurent on December 12, 2009, 10:13:51 pm
You can recompile SFML, it should work.
Title: Visuel c++ 2010
Post by: Xyro on December 12, 2009, 11:26:11 pm
Quote from: "Laurent"
You can recompile SFML, it should work.


Never recompiled a libary :(
Title: Visuel c++ 2010
Post by: Laurent on December 12, 2009, 11:42:55 pm
I guess you've already compiled your own source code? Well, compiling SFML is not more complicated: just open the solution file and press "rebuild all" ;)

It is even explained in the "getting started" tutorial, if you need more details.
Title: Visuel c++ 2010
Post by: Xyro on December 28, 2009, 10:15:46 pm
Quote from: "Laurent"
I guess you've already compiled your own source code? Well, compiling SFML is not more complicated: just open the solution file and press "rebuild all" ;)

It is even explained in the "getting started" tutorial, if you need more details.


Cant get it to work, I downloaded the full sdk then I tried to open it with vc++ 10 I had to convert the file(from the 2008 build) so I did, then I Compiled it all and tried to use the library files but they still don't work.
Title: Visuel c++ 2010
Post by: Laurent on December 28, 2009, 10:17:10 pm
What error do you get?
Title: Visuel c++ 2010
Post by: Xyro on December 28, 2009, 10:22:06 pm
Quote from: "Laurent"
What error do you get?


Code: [Select]

1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main
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: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>C:\Users\Quincy\documents\visual studio 2010\Projects\Neural\Debug\Neural.exe : fatal error LNK1120: 5 unresolved externals


Just tried to build the solution again and replaced all the files but still no luck.
Title: Visuel c++ 2010
Post by: Laurent on December 28, 2009, 10:26:34 pm
You can just press the green arrow (that starts the application with the debugger), it will recompile what's not up-to-date.

Regarding your linker errors, I think that you just forgot to link sfml-window.lib.
Title: Visuel c++ 2010
Post by: Xyro on December 28, 2009, 10:32:10 pm
Quote from: "Laurent"
You can just press the green arrow (that starts the application with the debugger), it will recompile what's not up-to-date.

Regarding your linker errors, I think that you just forgot to link sfml-window.lib.


Wow, Didn't know I had to add the window library to the additional dependencies also, but now its compiling and giving me a popup error : (i'm dutch so i'l try to translate it)

Cannot correctly initialize the application (0xc0150002).  

and then it shuts down the program. I'm trying to compile the basic code the tutorial(graphics) provided for testing.

I really like the new vc++ 10 but on the old one sfml at least worked xD
Title: Visuel c++ 2010
Post by: Laurent on December 28, 2009, 11:31:53 pm
Are you sure that you're not mixing debug mode and release libraries?
Title: Visuel c++ 2010
Post by: Xyro on December 29, 2009, 12:03:26 am
Quote from: "Laurent"
Are you sure that you're not mixing debug mode and release libraries?


I used sfml-graphics-d.lib :S
Title: Visuel c++ 2010
Post by: Laurent on December 29, 2009, 12:14:16 am
Can you give the complete list of libraries for your debug configuration?
Title: Visuel c++ 2010
Post by: Xyro on December 29, 2009, 01:08:00 am
Quote from: "Laurent"
Can you give the complete list of libraries for your debug configuration?


Sorry, I've started programming some months ago and this is the first external library I'm using care to explain ? If you mean what libraries I'm using  these :

sfml-graphics-d.lib;sfml-window-d.lib
Title: Visuel c++ 2010
Post by: blewisjr on December 29, 2009, 01:22:16 am
Yea those are what he is asking for.  What definition of the main function are you using.  if you are using the standard...

int main() or int main(int argc char** argv) you need to also include the sfml-main.lib  or you will get unresolved externals.  Yours look like this might be the issue.
Title: Visuel c++ 2010
Post by: Xyro on December 29, 2009, 01:47:02 am
Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
   
    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}


Added the sfml-main still keeps crashing with the bad init.
Title: Visuel c++ 2010
Post by: blewisjr on December 29, 2009, 03:38:23 am
#include <SFML/Window.hpp>

Not sure if that is causing the problem or not but you should be including the window header as well as the Graphics.hpp
Title: Visuel c++ 2010
Post by: OniLinkPlus on December 29, 2009, 06:49:06 am
Quote from: "blewisjr"
#include <SFML/Window.hpp>

Not sure if that is causing the problem or not but you should be including the window header as well as the Graphics.hpp
No, SFML/Window.hpp is included by SFML/Graphics.hpp, so he should not be including it himself.
Title: Visuel c++ 2010
Post by: Laurent on December 29, 2009, 10:05:07 am
Quote
If you mean what libraries I'm using these :

sfml-graphics-d.lib;sfml-window-d.lib

You don't link to sfml-system?
Title: Visuel c++ 2010
Post by: Xyro on December 29, 2009, 01:12:42 pm
Just added it but it just keeps giving me the same error, also should I add sfml-main-d ? or just sfml-main (tried with both but still a error)
Title: Visuel c++ 2010
Post by: blewisjr on December 30, 2009, 01:14:13 am
if you are in debug mode use -d.

I am stumped what is the full error the app is generating just Bad Init?

The more detail you give us the better our chances of supplying a solid answer.
Title: Visuel c++ 2010
Post by: Xyro on January 22, 2010, 04:33:22 pm
http://www.sfml-dev.org/forum/viewtopic.php?p=8576

I tried using this only I get stuck on the first step, I can find my property manager :S

I looked at views->other windows but I couln't find it. Is it because I have the  expres edition.