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 - robvleugel

Pages: 1 [2]
16
Window / Unhandled exception on window creation
« on: March 01, 2012, 09:02:05 pm »
Quote from: "Laurent"
Quote
So the lesson I learned is to never use static SFML objects, always use pointers and dynamic objects!

Wrong. Never use pointers and dynamically allocated objects, unless you really need to.
The lesson you learnt is to never use global objects ;)


I have some problems occurring only with static SFML objects, I don't have this when I change the sf::Texture and sf::Sprite to pointers instead :) It are just class variables, no globals or anything. The class is a singleton, perhaps that causes the problem?


The code below runs fine, but when I change the Texture and Sprite pointers to real objects, I get trouble!

GS_Menu.h
Code: [Select]

#include "IGameState.h"
#include <SFML\Graphics.hpp>

class GameView;

class GS_Menu : public IGameState
{
public:

bool Init(GameView* gameView, GameEngine* gameEngine, GameLogic* gameLogic);

void DrawBackground();

~GS_Menu();

static GS_Menu* Instance() {
return &m_menuState;
}

protected:
GS_Menu();

private:
static GS_Menu m_menuState;
sf::Texture* m_bg;
sf::Sprite* m_bgs;
bool m_init;
};


GS_Menu.cpp
Code: [Select]

#include "GS_Menu.h"
#include "..\..\GameEngine\GameEngine.h"
#include <SFML\Graphics.hpp>


GS_Menu GS_Menu::m_menuState;

GS_Menu::GS_Menu(){}
GS_Menu::~GS_Menu(){}

bool GS_Menu::Init(GameView* gameView, GameEngine* gameEngine, GameLogic* gameLogic)
{
GView = gameView;
GEngine = gameEngine;
GLogic = gameLogic;

m_bg = new sf::Texture();
m_bgs = new sf::Sprite();

//open BG file
if(!m_bg->LoadFromFile("img\\bg\\mainbg.PNG"))
{
GEngine->WriteLog("mainbg.PNG cannot be loaded");
return false;
}

GEngine->guiManager()->NewButton(1,50,50);

return true; //true on succesfull initialization
}


void GS_Menu::Draw()
{
DrawBackground();
}

void GS_Menu::DrawBackground()
{
m_bgs->SetTexture(*m_bg);
m_bgs->SetPosition(0,0);

GEngine->graphicsManager()->App()->Draw(*m_bgs);
}


17
Window / Unhandled exception on window creation
« on: February 29, 2012, 10:44:33 pm »
Quote from: "Laurent"
Your m_app pointer doesn't point to a valid RenderWindow, you must allocate it first.


Eh.. yeah, stupid.

It seems I had two problems, I also had a similar case with an sf::Texture and sf::Sprite inside a class causing trouble. This made it a bit harder to track down.

So the lesson I learned is to never use static SFML objects, always use pointers and dynamic objects! :)

18
Window / Unhandled exception on window creation
« on: February 29, 2012, 07:02:47 pm »
Making m_app a pointer to a sf::RenderWindow instead, and moving "GraphicsManager gfx;" to main() still doesn't solve my problem. Or isn't that what you meant?

This code still gives me the error:


Code: [Select]

#include "GameEngine\gfx\GraphicsManager.h"

class GraphicsManager
{
public:
sf::RenderWindow* m_app;
GraphicsManager() : m_app(nullptr) {}
};

int main(int argc, char**argv)
{
GraphicsManager gfx;
gfx.m_app->Create(sf::VideoMode(50, 50, 32), "blabla", sf::Style::Fullscreen);

return 0;
}

19
Window / Unhandled exception on window creation
« on: February 28, 2012, 07:12:34 pm »
[Using the latest 2.0 snapshot]

I'm not sure what I'm doing wrong here.

It compiles fine, but when running in debug mode I get:
"Unhandled exception at 0x77a322b2 in myprogram.exe: 0xC0000005: Access violation writing location 0x00000004."

It breaks at the GraphicsManager::GraphicsManager() constructor.
If I take out all code from the GraphicsManager class and put it all in main.cpp I get no errors.


Main.cpp
Code: [Select]


#include "GraphicsManager.h"

GraphicsManager gfx;

int main(int argc, char**argv)
{

gfx.Init();

return 0;
}


GraphicsManager.h
Code: [Select]


#include <SFML\Graphics.hpp>

class GraphicsManager
{
private:
int m_screen_x,m_screen_y,m_bit;
bool m_fullscreen
std::string m_winCaption;

sf::RenderWindow m_app;

public:
GraphicsManager();
~GraphicsManager() {m_app.Close();}

void Init();

};


GraphicsManager.cpp
Code: [Select]

#include "GraphicsManager.h"


GraphicsManager::GraphicsManager()
:m_fullscreen(false),m_screen_x(0),m_screen_y(0),m_bit(0),m_winCaption("not set")
{

}
void GraphicsManager::Init()
{
sf::VideoMode DesktopMode = sf::VideoMode::GetDesktopMode();
m_bit = DesktopMode.GetDesktopMode().BitsPerPixel;
m_screen_x = DesktopMode.GetDesktopMode().Width;
m_screen_y = DesktopMode.GetDesktopMode().Height;
m_winCaption = "MyProgram";
m_fullscreen = true;

m_app.Create(sf::VideoMode(m_screen_x, m_screen_y, m_bit), m_winCaption, sf::Style::Fullscreen);

}

20
General / Linking errors
« on: February 21, 2012, 09:42:11 pm »
All steps for building SFML 2.0 using Cmake and using it staticly on Windows-Visual Studio 10 Express (atleast, this is how I did it)

- Download latest zip archive SFML2 and extract
- Open Visual studio command prompt as administrator (by right clicking and select 'Run as administrator'
- Open Cmake-gui in this command prompt by entering 'cmake-gui', set source code folder to the extracted zip archive, destination folder to whatever you like.
- Press the configure button
- Specify generator: "NMake Makefiles" (using default native compilers)
- BUILD_DOC to FALSE
- BUILD_EXAMPLES to FALSE
- BUILD_SHARED_LIBS to FALSE
- GLEW_INCLUDE_PATH to "[zip-archive]/extlibs/headers"
- GLEW_LIBRARY to "[zip-archive]/extlibs/libs-msvc/x86/glew.lib"
- STATIC_STD_LIBS to FALSE
- CMAKE_BUILD_TYPE to Release
- CMAKE_INSTALL_PREFIX to "C:/Program Files (x86)/SFML" (or whatever you want it installed in)

- Press configure again
- Press generate
- Switch to the VS command prompt, locate the destination folder and type 'nmake install'
- Change 'Release' to 'Debug' in Cmake, press configure again and press generate.
- Type 'nmake install' again in the command prompt.
- Exit cmake and command prompt, check to see if the sfml-xxx-s-d.lib and sfml-xxx-s.lib files are created.
- Open a new SFML project, define SFML_STATIC in the preprocessor and link to the correct libraries.

If it still doesn't work, something is wrong :)

21
General / Linking errors
« on: February 20, 2012, 10:05:58 pm »
Try building the libraries in Cmake with STATIC_STD_LIBS disabled, than define SFML_STATIC in the preprocessor.

22
General / SFML linking problems
« on: February 19, 2012, 06:03:47 pm »
Quote from: "Laurent"
Quote
The cmake description of STATIC_STD_LIBS is a little deceiving as it tells you need it for static libraries

Where did you see such a statement?

Quote
So this means you will build SFML2.0 using statics instead of dll's and has nothing to do with the usage of SFML staticly or dynamicly after being build.

This is exactly what the tutorial explains ;)


When you hoover your mouse over it. I can't remember what it said exactly but it got me confused :)

Yeah I've read the tutorial again, guess I've missed that part.
I understand it all now...I guess

Thanks once again for your time!

23
General / SFML linking problems
« on: February 19, 2012, 01:26:20 pm »
Ah ok that makes some sense, I deleted the .pdb files because I tought they were only needed for the compiling of SFML.

The cmake description of STATIC_STD_LIBS is a little deceiving as it tells you need it for static libraries. So this means you will build SFML2.0 using statics instead of dll's and has nothing to do with the usage of SFML staticly or dynamicly after being build.

Anyway, I rebuild anything with STATIC_STD_LIBS disabled, changed the Code Generation>RunTime Library back to /MDd and now it compiles without errors, just the following warning:

Code: [Select]

1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library


Ill try to dig into it, but atleast it compiles now!
Now I can try to fix the "app.exe has triggered a breakpoint" error I get when running the project that I tried to convert from 1.6, programming is so much fun :)
Thanks again!

-Rob

24
General / SFML linking problems
« on: February 19, 2012, 10:52:34 am »
I've always used SFML 1.6 and everything worked fine.
Recently I tried to fool around in Linux and build the latest SFML 2.0 from the repository, everything works fine.

But now I'm trying to make the switch from 1.6 to 2.o on Windows and I'm running into some problems using Visual Studio 2011 Express.

I've build the libraries with cmake. I want only the static ones, so I've configured with BUILD_SHARED_LIBS to FALSE, STATIC_STD_LIBS to TRUE, and CMAKE_BUILD_TYPE to both Debug and Release.
I've obtained the sfml-xxx-s.lib and sfml-xxx-s-d.lib.
I've set the correct paths and included the sfml-system-s-d.lib to my project under debug settings.

When I compile the following code:
Code: [Select]

#include <iostream>
#include <SFML\System.hpp>

int main()
{
sf::Clock myClock;
while(myClock.GetElapsedTime().AsSeconds() < 5) {}
    return 0;
}


It gives me the following errors:
Code: [Select]

1>  LINK : C:\Dev\Projects\SFML2 test\Debug\SFML2 test.exe not found or not built by the last incremental link; performing full link
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: float __thiscall sf::Time::AsSeconds(void)const " (__imp_?AsSeconds@Time@sf@@QBEMXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Time __thiscall sf::Clock::GetElapsedTime(void)const " (__imp_?GetElapsedTime@Clock@sf@@QBE?AVTime@2@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Clock::Clock(void)" (__imp_??0Clock@sf@@QAE@XZ) referenced in function _main
1>C:\Dev\Projects\SFML2 test\Debug\SFML2 test.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



Than I've read I had to set the SFML_STATIC, so I did:

Code: [Select]

1>------ Build started: Project: SFML2 test, Configuration: Debug Win32 ------
1>  main.cpp
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>sfml-system-s-d.lib(Clock.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(Clock.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(Time.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(Time.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(ClockImpl.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(ClockImpl.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>  SFML2 test.vcxproj -> C:\Dev\Projects\SFML2 test\Debug\SFML2 test.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========


Ok, it compiles. But I generally don't like to see warnings :)
So what do they mean? I've read basicly all of the tutorials and youtube videos on how to set up sfml and I can't seem to find this problem.


Now I've compiled a little fancier program:

Code: [Select]

#include <iostream>
#include <SFML\System.hpp>
#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.IsOpen())
    {
        // Process events
        sf::Event Event;
        while (App.PollEvent(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;
}


I've added the sfml-system-s-d.lib,sfml-window-s-d.lib and sfml-graphics-s-d.lib as additional dependencies. I get the following error:


Code: [Select]

1>------ Build started: Project: SFML2 test, Configuration: Debug Win32 ------
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::~_Container_base12(void)" (??1_Container_base12@std@@QAE@XZ) already defined in sfml-window-s-d.lib(VideoMode.cpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::_Container_base12(void)" (??0_Container_base12@std@@QAE@XZ) already defined in sfml-window-s-d.lib(VideoMode.cpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: void __thiscall std::_Container_base12::_Orphan_all(void)" (?_Orphan_all@_Container_base12@std@@QAEXXZ) already defined in sfml-window-s-d.lib(VideoMode.cpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: class std::locale::facet * __thiscall std::locale::facet::_Decref(void)" (?_Decref@facet@locale@std@@QAEPAV123@XZ) already defined in sfml-graphics-s-d.lib(GLCheck.cpp.obj)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)" (?_Facet_Register@facet@locale@std@@CAXPAV123@@Z) already defined in msvcprtd.lib(locale0_implib.obj)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(ios.obj) : error LNK2005: "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(ios.obj) : error LNK2005: "public: static void __cdecl std::ios_base::_Addstd(class std::ios_base *)" (?_Addstd@ios_base@std@@SAXPAV12@@Z) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP100D.dll)
1>LIBCMTD.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __free_dbg already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetCheckCount already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(lconv.obj) : error LNK2005: _localeconv already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf_s already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in MSVCRTD.lib(crtexe.obj)
1>LIBCMTD.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(tolower.obj) : error LNK2005: _tolower already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(strtol.obj) : error LNK2005: _strtol already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(_file.obj) : error LNK2005: ___iob_func already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(_file.obj) : error LNK2005: __lock_file already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(_file.obj) : error LNK2005: __unlock_file already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>C:\Dev\Projects\SFML2 test\Debug\SFML2 test.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


When I set Code Generation>RunTime Library in VS to Multi-threaded Debug (/MTd) (I have no idea when this does and what effect's it will have on my program)

Code: [Select]

1>------ Build started: Project: SFML2 test, Configuration: Debug Win32 ------
1>  main.cpp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>sfml-system-s-d.lib(Clock.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(Clock.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(Err.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(Err.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(Lock.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(Lock.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(Mutex.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(Mutex.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(Sleep.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(Sleep.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(ThreadLocal.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(ThreadLocal.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(Time.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(Time.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(ClockImpl.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(ClockImpl.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(MutexImpl.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(MutexImpl.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(SleepImpl.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(SleepImpl.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(ThreadLocalImpl.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(ThreadLocalImpl.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-window-s-d.lib(GlContext.cpp.obj) : warning LNK4099: PDB 'sfml-window-s-d.pdb' was not found with 'sfml-window-s-d.lib(GlContext.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-window-s-d.pdb'; linking object as if no debug info
1>sfml-window-s-d.lib(GlResource.cpp.obj) : warning LNK4099: PDB 'sfml-window-s-d.pdb' was not found with 'sfml-window-s-d.lib(GlResource.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-window-s-d.pdb'; linking object as if no debug info
1>sfml-window-s-d.lib(JoystickManager.cpp.obj) : warning LNK4099: PDB 'sfml-window-s-d.pdb' was not found with 'sfml-window-s-d.lib(JoystickManager.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-window-s-d.pdb'; linking object as if no debug info
1>sfml-window-s-d.lib(VideoMode.cpp.obj) : warning LNK4099: PDB 'sfml-window-s-d.pdb' was not found with 'sfml-window-s-d.lib(VideoMode.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-window-s-d.pdb'; linking object as if no debug info
1>sfml-window-s-d.lib(Window.cpp.obj) : warning LNK4099: PDB 'sfml-window-s-d.pdb' was not found with 'sfml-window-s-d.lib(Window.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-window-s-d.pdb'; linking object as if no debug info
1>sfml-window-s-d.lib(WindowImpl.cpp.obj) : warning LNK4099: PDB 'sfml-window-s-d.pdb' was not found with 'sfml-window-s-d.lib(WindowImpl.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-window-s-d.pdb'; linking object as if no debug info
1>sfml-window-s-d.lib(WglContext.cpp.obj) : warning LNK4099: PDB 'sfml-window-s-d.pdb' was not found with 'sfml-window-s-d.lib(WglContext.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-window-s-d.pdb'; linking object as if no debug info
1>sfml-window-s-d.lib(JoystickImpl.cpp.obj) : warning LNK4099: PDB 'sfml-window-s-d.pdb' was not found with 'sfml-window-s-d.lib(JoystickImpl.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-window-s-d.pdb'; linking object as if no debug info
1>sfml-window-s-d.lib(VideoModeImpl.cpp.obj) : warning LNK4099: PDB 'sfml-window-s-d.pdb' was not found with 'sfml-window-s-d.lib(VideoModeImpl.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-window-s-d.pdb'; linking object as if no debug info
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : warning LNK4099: PDB 'sfml-window-s-d.pdb' was not found with 'sfml-window-s-d.lib(WindowImplWin32.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-window-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(Color.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(Color.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(GLCheck.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(GLCheck.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(Image.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(Image.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(ImageLoader.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(RenderTarget.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(RenderTarget.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(RenderWindow.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(RenderWindow.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(Shader.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(Texture.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(Texture.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(TextureSaver.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(TextureSaver.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(Transform.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(Transform.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(View.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(View.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(Vertex.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(Vertex.cpp.obj)' or at 'C:\Dev\Projects\SFML2 test\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>  SFML2 test.vcxproj -> C:\Dev\Projects\SFML2 test\Debug\SFML2 test.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped =========



It compiles, it works but still lots of warnings. Is this normal?
Does anyone have a clue how to get rid of them?
I've spend hours already but can't seem to find a solution.


Greetings,
Rob

25
General / SFML 2.0 in Linux giving linking errors
« on: February 12, 2012, 09:24:11 pm »
Thanks for the info, this has been a great help!

26
General / SFML 2.0 in Linux giving linking errors
« on: February 12, 2012, 07:48:04 pm »
Quote from: "Laurent"
1. SFML supports static build on Windows only. It doesn't make sense on other OSes, it is strongly recommended to build shared libraries.

2. Read the doc :)


On 1.: Why is it strongly recommended to build shared libraries and doesn't it make sense on other OS's?

On 2.: Stupid, should've checked the docs first. I didn't really expected to see changes in existing classes and functions while upgrading to 2.0. Guess I'll have some conversion to do in my existing projects.

27
General / SFML 2.0 in Linux giving linking errors
« on: February 12, 2012, 06:27:55 pm »
Hello,

I've been using SFML (1.6) on Windows for a while now and I love it!
However, I'm having trouble setting it up in Linux (ubuntu 11.10). I
m facing two problems.
I downloaded the latest 2.0 version from github, ran cmake and make to build the libraries. The first problem that I encountered is that I can't seem to make the libsfml-XXX-s-d.a files. For instance, I have libsfml-system.so,libsfml-system.so.2.0,libsfml-system-d.so,libsfml-system-d.so.2.0 and sfmlsystem-d.a.

I find this strange, I did configure with CMake in Debug with BUILD_SHARED_LIBS disabled prior to running make, I tried it again in case I forgot to ran make with this configuration but still no *-s-d.a files.

Next, when I try to compile the code below, it gives me the following errors:

Code: [Select]
Compiling: src/main.cpp
/home/robvleugel/Dev/Projects/XML Test/src/main.cpp: In function ‘int main(int, char**)’:
/home/robvleugel/Dev/Projects/XML Test/src/main.cpp:11:12: error: ‘class sf::Window’ has no member named ‘IsOpened’
/home/robvleugel/Dev/Projects/XML Test/src/main.cpp:14:16: error: ‘class sf::Window’ has no member named ‘GetEvent’
/home/robvleugel/Dev/Projects/XML Test/src/main.cpp:21:77: error: ‘sf::Key’ has not been declared
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 0 warnings



I hope anyone knows a solution for my problems.
Keep up the good work!

Greetings, Rob


Code: [Select]

#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>

int main(int argc, char** argv) {

sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");


while (App.IsOpened())
{
    sf::Event Event;
    while (App.GetEvent(Event))
    {
        // Window closed
        if (Event.Type == sf::Event::Closed)
            App.Close();

        // Escape key pressed
        if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
            App.Close();
    }
}

return 0;
}


28
Window / Window resize
« on: December 28, 2011, 07:49:26 pm »
Thanks for the quick answer, it works now!

The only thing that bothers me now is that I'm no longer able to use just the sf::input, I have to give classes acces to the RenderWindow in order to use ConvertCoordinates.

Thanks for the help!

29
Window / Window resize
« on: December 28, 2011, 05:55:49 pm »
Hello,

I'm writing a small game, I set up a window and placed some buttons on it. The buttons are sf::sprite objects using an sf::image of a button, some .PNG image file. At this moment, the buttons use a fixed X and Y position. I can click the button and everything works fine.

However, if the window is resized, the buttons stretch out, which is actually what I want to happen. However, the position checking uses the button's SF::image width and height to check for button presses, but these are no longer accurate after they are being resized.

My question is, why are the buttons being stretched? Although I want this to happen I'm not sure what actually causes it right now.
Is this happening automaticly for sf:sprite objects? And how could I solve my problem about the images being scaled, but not the sprite.GetPosition() and GetHeight()?

Do I need to use a virtual screen or something? And if so, what kind of class to I need to use for this virtual screen, another sf::RenderWindow or can I use a sf::image for that purpose?

Greetings,
Rob

Pages: 1 [2]