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

Author Topic: SFML 2.0 Static Debug Libraries, warning LNK4098,, Not sure what the issue is...  (Read 6980 times)

0 Members and 1 Guest are viewing this topic.

Flash619

  • Full Member
  • ***
  • Posts: 142
    • View Profile
       So today, Since I wasn't that far in on my project on SFML 1.6, I decided to restart with 2.0 for the fun of it. I setup the libraries, includes, and all my settings as I had them on 1.6:

C++ > Aditional Included Directories > "C:\SFML-2.0-rc\include;%(AdditionalIncludeDirectories)"

C++ > Preproccesor > "WIN32;SFML_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)"

Linker > Aditional Library Directories > "C:\SFML-2.0-rc\lib;%(AdditionalLibraryDirectories)"

Linker > Input > "sfml-audio-s-d.lib;sfml-graphics-s-d.lib;sfml-network-s-d.lib;sfml-system-s-d.lib;sfml-window-s-d.lib;%(AdditionalDependencies)"

Upon compile, I get a wall of text full of a bunch of warnings, needless to say, the program spouts out debug errors the moment it starts.

The wall of text:
Quote
1>  Generating Code...
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(Font.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(Font.cpp.obj)' or at 'C:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(RenderStates.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(RenderStates.cpp.obj)' or at 'C:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(Text.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(Text.cpp.obj)' or at 'C:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(Transformable.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(Transformable.cpp.obj)' or at 'C:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
1>sfml-graphics-s-d.lib(VertexArray.cpp.obj) : warning LNK4099: PDB 'sfml-graphics-s-d.pdb' was not found with 'sfml-graphics-s-d.lib(VertexArray.cpp.obj)' or at 'C:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\Debug\sfml-graphics-s-d.pdb'; linking object as if no debug info
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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\Debug\sfml-system-s-d.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(String.cpp.obj) : warning LNK4099: PDB 'sfml-system-s-d.pdb' was not found with 'sfml-system-s-d.lib(String.cpp.obj)' or at 'C:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\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:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\Debug\sfml-window-s-d.pdb'; linking object as if no debug info
1>  Genesis.vcxproj -> C:\Users\Flash619\documents\visual studio 2010\Projects\Genesis\Debug\Genesis.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

The error I get on running:

Quote
Unhandled exception at 0x770215de (ntdll.dll) in Genesis.exe: 0xC0000005: Access violation writing location 0x00000004.

^Not sure if thats related or not, just thought I would include it for safety sake.  Not even sure why that dll is causing a big issue unless its the conflicts above causing it.

I'm not entirely sure what I'm doing right or wrong. I used the -s-d Libraries in the 1.6 version without this much error. :/ It does work with the dynamic libraries, but I would rather stick close to what I was using. At this point however. I'm open for any suggestion or question.

I look foreward to hearing from you on this matter!

Thank you for your time, and huge thanks in advance! :)

« Last Edit: July 11, 2012, 06:40:04 pm by Flash619 »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
The warning is ok, just ignore it. You can read more about it on the MSDN if you're curious.

We need more details about the error:
- run the debugger and tell use where it crashes
- show your code
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10914
    • View Profile
    • development blog
    • Email
Yeah the *.pdb files are not included in the RC release. :-\
But you can safely ignore those warnings.

LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
Did you change the runtime library for your project?
The RC binaries are compiled with: Multithreaded-Debug-DLL (/MDd) and your project should also make use of that. (Otherwise you'll have to compile the source on your own...)
But the warning can usally also be ignored, although you can get rid of the warning by explicitly disallowing some of the runtime libraries.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Flash619

  • Full Member
  • ***
  • Posts: 142
    • View Profile
The warning is ok, just ignore it. You can read more about it on the MSDN if you're curious.

We need more details about the error:
- run the debugger and tell use where it crashes
- show your code

Its pointing me to:
Quote
>   Genesis.exe!`dynamic initializer for 'Genesis::_mainWindow''()  Line 55 + 0x28 bytes   C++

The entire stack is as a attachment.

Genesis.cpp:
#include "stdafx.h"
#include "Genesis.h"
#include "BetweenScreens.h"
#include "SplashScreen.h"

//Entry Point
int _tmain(int argc, _TCHAR* argv[])
{
        Genesis::Initialize();
        return 0;
}
//Initial Method
void Genesis::Initialize(void)
{
        if(_engineState != Genesis::InitialLoad)
                return;

        _mainWindow.create(sf::VideoMode(1024,786,32),"Genesis");
        _engineState = Genesis::Starting;

        //Throwing a initial loading screen.
        BetweenScreens::ColdLoadingScreen(_mainWindow);

        while(!isClosing())
        {
                EngineStateCollaborator();
        }
}
void Genesis::EngineStateCollaborator(void)
{
        switch (_engineState){
        case Genesis::Starting:
                showSplashScreen();
                break;
        case Genesis::Menu:
                break;
        }
}
void Genesis::showSplashScreen(void)
{
        //Not implamented yet.
}
bool Genesis::isClosing(void)
{
        if(_engineState == Genesis::Closing)
                return true;
        else
                return false;
}
Genesis::EngineState Genesis::_engineState = InitialLoad;
sf::RenderWindow Genesis::_mainWindow;
 

Genesis.h:

#ifndef GENESIS_H
#define GENESIS_H
class Genesis
{
public:
        enum EngineState{InitialLoad,Starting,SplashScreen,Menu,Playing,Saving,Reloading,Closing,ShowingStatisticsData,ShowingConsoleWindow};
        static EngineState _engineState;

        static void Initialize();
private:
        static void showSplashScreen();
        static void EngineStateCollaborator();
        static bool isClosing();
        static sf::RenderWindow _mainWindow;
};
#endif
 

There ya go, if you need anything else please don't be afraid to ask! :)

Yeah the *.pdb files are not included in the RC release. :-\
But you can safely ignore those warnings.

LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
Did you change the runtime library for your project?
The RC binaries are compiled with: Multithreaded-Debug-DLL (/MDd) and your project should also make use of that. (Otherwise you'll have to compile the source on your own...)
But the warning can usally also be ignored, although you can get rid of the warning by explicitly disallowing some of the runtime libraries.


Yes, my runtime library is "Multi-threaded Debug DLL (/MDd)" ^_^

[attachment deleted by admin]

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10914
    • View Profile
    • development blog
    • Email
I'm not sure if it's a good idea to use stdafx.h and _tmain(), is this even in the standard?

But your problem lies somewhere else and that is global variables!
You're defining and initializing your render window in the global scope. Using global variables should always be avoided, unless you really know what you're doing. Initializing in the global scope will lead to undefined behaviour, so it's a big DON'T.

Redesign your class to include the render window instead of hosting it in the global scope!
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Flash619

  • Full Member
  • ***
  • Posts: 142
    • View Profile
I'm not sure if it's a good idea to use stdafx.h and _tmain(), is this even in the standard?

But your problem lies somewhere else and that is global variables!
You're defining and initializing your render window in the global scope. Using global variables should always be avoided, unless you really know what you're doing. Initializing in the global scope will lead to undefined behaviour, so it's a big DON'T.

Redesign your class to include the render window instead of hosting it in the global scope!

I figured that the stdafx.h and the tmain was fine. I was unaware of the concerns around it since VS2010 put it in automatically. Is there anything you would recomend to standardize it?

About the global variable. I was attempting to follow a tutorial that had it as a global variable. I'm not sure why they made it global since it didn't seem to be used anywere else besides the main class, and was just transfered from method to method outside of the main class.

I also was a bit un aware that it as a global variable would make it so un predictable.

When you say "include" the render window instead of "hosting" it what do you mean by that? Just launch the render window normally and pass it on to methods that require it manually instead of using a global variable?


EDIT

#include "stdafx.h"
#include "Genesis.h"
#include "BetweenScreens.h"
#include "SplashScreen.h"

//Entry Point
int _tmain(int argc, _TCHAR* argv[])
{
        Genesis::Initialize();
        return 0;
}
//Initial Method
void Genesis::Initialize(void)
{
        if(_engineState != Genesis::InitialLoad)
                return;

        sf::RenderWindow mainWindow(sf::VideoMode(1024,786,32),"Genesis");
        _engineState = Genesis::Starting;

        //Throwing a initial loading screen.
        BetweenScreens::ColdLoadingScreen(mainWindow);

        while(!isClosing())
        {
                EngineStateCollaborator();
        }
}
void Genesis::EngineStateCollaborator(void)
{
        switch (_engineState){
        case Genesis::Starting:
                showSplashScreen();
                break;
        case Genesis::Menu:
                break;
        }
}
void Genesis::showSplashScreen(void)
{
        //Not implamented yet.
}
bool Genesis::isClosing(void)
{
        if(_engineState == Genesis::Closing)
                return true;
        else
                return false;
}
Genesis::EngineState Genesis::_engineState = InitialLoad;
 

That seemed to work flawlessly. Thank you for your help! Let me know if there is anything else you would recommend as I'm still trying to learn the proper ways of doing things. :)
« Last Edit: July 11, 2012, 08:32:24 pm by Flash619 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10914
    • View Profile
    • development blog
    • Email
I figured that the stdafx.h and the tmain was fine. I was unaware of the concerns around it since VS2010 put it in automatically. Is there anything you would recomend to standardize it?
I've quickly googled and the conclusion is that you don't really need it unless your compile time is unmanagenable big. Also read this answer on StackOverflow. ;)

When you say "include" the render window instead of "hosting" it what do you mean by that? Just launch the render window normally and pass it on to methods that require it manually instead of using a global variable?
Yes. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/