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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Stewbond

Pages: [1]
1
General / Linking errors
« on: February 21, 2012, 05:40:07 pm »
I'm sure you've better things to do than help another guy with linking problems.  I've decided that it will be easier for me to just include the source files from SFML that I am using and build it locally with my project.  You can consider this issue resolved.

This isn't the first time I've decided to link SFML this way. I don't know why this library is always so hard for me to link.  Even Boost took more time to download and compile than install.

2
General / Linking errors
« on: February 20, 2012, 10:37:26 pm »
Say, are there any OpenGL requirements for this?  I just want to use RenderWindow in 2D to display some shapes (circles) that bounce around.  I don't think I have any OpenGL libs installed although this doesn't explain why I am getting unresolved clock issues.

3
General / Linking errors
« on: February 20, 2012, 10:14:05 pm »
Thanks robvleugel

I just disabled STATIC_STD_LIBS in CMake, recompiled SFML and tried to compile my project with and without the SFML_STATIC preprocessor.  In both cases, I got the unresolved external symbol error.

I don't really care if I use static or dynamic libraries.  At this point I just want something.

4
General / Linking errors
« on: February 20, 2012, 09:47:48 pm »
Okay, so I can't quite figure out how to make the static libraries.  That's okay, I just want it to work with the libraries that I have.

I accidently forgot to save the file that I had copied my original code into when I had trimmed the original down for the sake of this post, meaning I just lost my 400 lines of code.  Dang.  I've written a skeleton back and I am still getting my linking errors:

This time I am using the non-static release libraries in my additional dependencies and I've taken out the SFML_STATIC preprocessor define.
Quote
C:\Dev\SFML\build\lib\Release\sfml-graphics.lib
C:\Dev\SFML\build\lib\Release\sfml-window.lib
C:\Dev\SFML\build\lib\Release\sfml-system.lib  


When I declare sf::Clock Clock; It compiles fine, but I found that when I use Clock.GetElapsedTime(); I now have unresolved external symbols.  The same is true for any object I use from any class from Graphics, window or system.
Code: [Select]
1>Snippets.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::IsOpened(void)const " (__imp_?IsOpened@Window@sf@@QBE_NXZ)
1>Snippets.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Clock::Reset(void)" (__imp_?Reset@Clock@sf@@QAEXXZ)
1>Snippets.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall sf::Clock::GetElapsedTime(void)const " (__imp_?GetElapsedTime@Clock@sf@@QBEIXZ)
1>C:\Users\Stew\Documents\Visual Studio 2010\Projects\Snippets\Release\Snippets.exe : fatal error LNK1120: 3 unresolved externals


Are there any ideas where I may have gone wrong?

5
General / Linking errors
« on: February 20, 2012, 08:48:11 pm »
I am fairly confident that it was.  I've used these libs before in December so I can't remember, but I do recall that my CMake looked exactly like the one in the tutorial.  I will try and recompile just in case.

6
General / Linking errors
« on: February 20, 2012, 08:29:50 pm »
I'm running SFML 2.0 with VS2010.  I've done a few SFML projects before so the libraries themselves should be good.  I am trying to statically link some libraries but can't figure out what is wrong.

This will compile:
Code: [Select]
#include <SFML/System.hpp>
int main()
{
sf::Clock Clock;
Clock.GetElapsedTime();
return 0;
}


But as soon as I do:
Code: [Select]
#include <SFML/Window.hpp>
int main()
{
sf::Window App;
return 0;
}


I get 27 linking errors of the form:
Code: [Select]
xxxx.lib(XXXX.dll) : error LNK2005: XXXXXXX already defined in XXXX.lib(XXXXX.dll)
and
Code: [Select]
: fatal error LNK1169: one or more multiply defined symbols found

I have the libraries linked as additional dependancies. I've tried /NODEFAULTLIB as the warnings recommend, but that causes more errors. I've also defined SFML_STATIC and STATIC_STD_LIBS in my Preprocessor.  I've also tried it without STATIC_STD_LIBS with no change.

Am I missing something?

7
Graphics / RenderWindow object crashes during Graphics Tutorial.
« on: October 09, 2011, 11:44:47 am »
Ah ha!

I just recompiled SFML 1.6 by opening the .SLN file and then playing around a bit.  I've got everything working with is static libraries and the release DLLs.  This was my first time compiling someone else's solution so it took me a little while.

The Rendering Window tutorial now runs properly!

8
Graphics / RenderWindow object crashes during Graphics Tutorial.
« on: October 09, 2011, 09:26:45 am »
I've spent the last 10 hours attempting to get a compiled version of SFML with Visual C++ and so far I am unsuccessful.

CMake was actually pretty easy to use.  The actual compilation went okay without errors (except that my DLLs all have a "-2" suffix).  

My problem now is I can't compile my current code with the headers included in the SFML 2.0 package.

It gives me errors such as GetEvent() is not a member of sf::Window or sf::RenderWindow.  When I compare the headers from 1.6 and 2.0, I find that these definitions are indeed missing.  Therefore it appears that the SFML 1.6 code that I've taken from the tutorial is not compatible with SFML 2.0.

I've reverted back to SFML 1.6 because I can compile my code now.  The problem still remains that it was built using VC++ 2008 while I am using 2010.  I am thinking of just installing Visual Studio 2008 but I need to confirm that this is the problem.

Like I said earlier, the other guy who used 2010 had his problems with the sf::RenderWindow App() line.  I don't have my problem in the same spot so it may not be the same issue.

Are there any other potential things I could try before I take this step?

9
Graphics / RenderWindow object crashes during Graphics Tutorial.
« on: October 08, 2011, 01:47:45 pm »
Hello,

I'm on my second day of learning SFML.  I got through the window tutorial without issue, however I am having problems with the graphics tutorial.  Sample code from the sprites tutorial is given below.  I can compile this without issue, however when I run this, the program crashes when I use
    App.GetEvent(Event)
    App.Clear()
    App.Display()
    App.Close()

These worked fine when App was defined as sf::Window but doesn't work with sf::RenderWindow.  I've read through the forums a bit and found that someone had a similar problems which were solved by updating their video card driver.  I've run other games on this PC with more complicated graphics so I'm not sure why my video-card would not work for this very specific case.  Regardless I've tried updating my driver and found that it is the most recent one available.  I've also read that someone needed to re-compile SFML 1.6 for VC++ 2010 because his definition of the RenderWindow didn't work.  I'm not sure quite how to do that, but my RenderWindow definition works so I don't think that is the problem.

Does anyone have any ideas?  I am running SFML 1.6 (built for VC++ 2008) with MS Visual C++ 2010 in Windows 7.  I'm compiling in Debug mode. I'm using the SFML release libraries and DLLs.  My video card is an NVIDIA GeForce 8600 GT with NVIDIA driver version 8.17.12.6099.

Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

    sf::Image Image;
    if (!Image.LoadFromFile(".//Images//Katie.png")) //This file exists and is loaded.
        return EXIT_FAILURE;

    sf::Sprite Sprite(Image);

    Sprite.SetColor(sf::Color(0, 255, 255, 128));
    Sprite.SetPosition(200.f, 100.f);
    Sprite.SetScale(2.f, 2.f);

    while (App.IsOpened())
    {
        sf::Event Event;
        while (App.GetEvent(Event)) // This line crashes
            if (Event.Type == sf::Event::Closed) App.Close();

        float ElapsedTime = App.GetFrameTime();

        if (App.GetInput().IsKeyDown(sf::Key::Left))  Sprite.Move(-100 * ElapsedTime, 0);
        if (App.GetInput().IsKeyDown(sf::Key::Right)) Sprite.Move( 100 * ElapsedTime, 0);

        App.Clear(); // This line crashes
        App.Draw(Sprite);
        App.Display(); // This line crashes
    }
    return EXIT_SUCCESS;
}


[EDIT:] Here is the debug error provided by Visual Studio's Debug tool:
A buffer overrun has occurred in GraphicsTutorial.exe which has corrupted the program's internal state.

Pages: [1]
anything