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

Author Topic: SFML linking problems  (Read 7506 times)

0 Members and 1 Guest are viewing this topic.

robvleugel

  • Newbie
  • *
  • Posts: 29
    • View Profile
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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML linking problems
« Reply #1 on: February 19, 2012, 11:38:10 am »
Quote
So what do they mean?

They mean that debug information for SFML won't be available if you use the debugger, because VC++ couldn't find the corresponding .pdb files.

Quote
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)

Because you enabled STATIC_STD_LIBS (which is not recommended unless you know what you do), you must set the same option in your project, which is /MTd.

Quote
It compiles, it works but still lots of warnings. Is this normal?

This is still the same warning.

Quote
Does anyone have a clue how to get rid of them?

Copy the .pdb files where the debugger will be able to find them. The executable directory should be ok.
Or ignore it: you probably won't need to debug inside SFML.
Laurent Gomila - SFML developer

robvleugel

  • Newbie
  • *
  • Posts: 29
    • View Profile
SFML linking problems
« Reply #2 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML linking problems
« Reply #3 on: February 19, 2012, 05:10:51 pm »
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 ;)
Laurent Gomila - SFML developer

robvleugel

  • Newbie
  • *
  • Posts: 29
    • View Profile
SFML linking problems
« Reply #4 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!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML linking problems
« Reply #5 on: February 19, 2012, 06:06:35 pm »
It says:
Quote
TRUE to statically link to the standard libraries, FALSE to use them as DLLs

You probably missed the "standard" word ;)
Laurent Gomila - SFML developer

 

anything