SFML community forums

Help => General => Topic started by: Putarda on December 13, 2016, 11:04:38 pm

Title: Fatal error in project. (using dll engine)
Post by: Putarda on December 13, 2016, 11:04:38 pm
Created new empty C++ project and added inc dir, lib dir, input... of my engine .dll and in C++>General in Additional Inc Dire added location of SFML includes. I compiled it and got this (http://i.imgur.com/EG3NPKB.png)

and output is:
'TestDLL.exe' (Win32): Loaded 'E:\JAVA DEVELOPER\CSHARP Workspace\TestDLL\Debug\TestDLL.exe'. Symbols loaded.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll'
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'E:\JAVA DEVELOPER\CSHARP Workspace\TestDLL\TestDLL\Light Speed Engine.dll'. Symbols loaded.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'E:\JAVA DEVELOPER\CSHARP Workspace\TestDLL\TestDLL\sfml-graphics-2.dll'. Module was built without symbols.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'E:\JAVA DEVELOPER\CSHARP Workspace\TestDLL\TestDLL\sfml-window-2.dll'. Module was built without symbols.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'E:\JAVA DEVELOPER\CSHARP Workspace\TestDLL\TestDLL\sfml-system-2.dll'. Module was built without symbols.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\opengl32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\glu32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ddraw.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\winmmbase.dll'
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dciman32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp_win.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nvoglv32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\windows.storage.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wtsapi32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dbghelp.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wintrust.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msasn1.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntmarta.dll'. Cannot find or open the PDB file.
The thread 0x1cd4 has exited with code 0 (0x0).
The thread 0x1fe8 has exited with code 0 (0x0).
The thread 0xf50 has exited with code 0 (0x0).
The thread 0xe50 has exited with code 0 (0x0).
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file.
'TestDLL.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winsta.dll'. Cannot find or open the PDB file.
Exception thrown at 0x6F7BCF5E (vcruntime140.dll) in TestDLL.exe: 0xC0000005: Access violation reading location 0x00CC4000.

GameTest (project) main class:
#include <Engine.h>
#include <Window.h>
#include <iostream>

int main() {

        ls::Engine* engine = new ls::Engine;

        ls::Window_Blueprint window_blueprint("Intros Manager", ls::Vector(1920, 1080));

        //window_blueprint.icon_source = "icon.png";

        engine->initialize(window_blueprint);

        delete engine;

        return 0;
}
 

And opens Window.h (heade of engine):
#ifndef WINDOW
#define WINDOW

#include "Vector.h"
#include <string>

#ifdef LIGHTSPEEDENGINE_EXPORTS
#define LIGHTSPEEDENGINE_API __declspec(dllexport)
#else
#define LIGHTSPEEDENGINE_API __declspec(dllimport)
#endif

namespace ls {

        struct LIGHTSPEEDENGINE_API Window_Blueprint {

                std::string name;

                Vector resolution;

                bool resizable = true;

                bool fullscreen = false;

                int framerate = 30;

                std::string icon_source;

                Window_Blueprint() = default;

                Window_Blueprint(std::string window_build_name, Vector window_build_resolution) : name(window_build_name), resolution(window_build_resolution) {}

        };

        sf::View LIGHTSPEEDENGINE_API getLetterboxView(sf::View window_view, sf::Vector2u* window_resolution_vector2f);

}

#endif
 

I hope if someone can help me :). Thanks.
Title: Fatal error in project. (using dll engine)
Post by: eXpl0it3r on December 14, 2016, 02:00:05 am
Build in debug mode and run it through the debugger and get a stack trace at the crash location.

What exactly is your setup with your DLL and how do you link SFML?
Title: Re: Fatal error in project. (using dll engine)
Post by: Putarda on December 14, 2016, 10:22:16 pm
Created Win32 project (Engine) and normaly added SFML to project (include dir, lib dir, debug>input...) and in all headers I have this code
#ifdef LIGHTSPEEDENGINE_EXPORTS
#define LIGHTSPEEDENGINE_API __declspec(dllexport)
#else
#define LIGHTSPEEDENGINE_API __declspec(dllimport)
#endif
and compiled it as release. Then I created empty project "TestDLL" and added in include dir. location of engine headers and lib dir. of engine like in Engine project. Copied dll from engine release to TestDLL project and in C/C++>General>Additional Include sfml include dir.
Title: Re: Fatal error in project. (using dll engine)
Post by: Putarda on December 14, 2016, 10:55:39 pm
Oh, my mistake. Error is because I compiled dll as release but tesdll was running debug. Thank you!