Public Group

# Building a simple engine using SDL in a dll

This topic is 4507 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello. I am using Visual Studio 2005 Professional on Windows XP SP2. I am trying to create a very simple engine packaged in a windows dll. My example .exe code is as follows
#include &lt;Daedalus.h&gt;

int main(int argc, char* argv[])
{
Daedalus::Engine* engine = new Daedalus::Engine();
engine-&gt;Initialize(true, Daedalus::RES_640x480);

while (engine-&gt;Run())
{

}

delete engine;

return 0;
}


However, I wish to use SDL in the dll just for creating the window and initialize OpenGL. I can compile the dll fine in debug and release mode. I can compile an example application in release mode fine. However, when I try compile an example application in debug mode I receive the following errors.
Error	1	error LNK2019: unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) referenced in function __unwindfunclet$_main$0	example.obj
Error	2	error LNK2019: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) referenced in function _main	example.obj
Error	3	error LNK2019: unresolved external symbol ___security_cookie referenced in function _main	example.obj
Error	4	error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __ehhandler$_main example.obj Error 5 error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function __ehhandler$_main	example.obj
Error	6	error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function _main	example.obj
Error	7	error LNK2001: unresolved external symbol __RTC_Shutdown	example.obj
Error	8	error LNK2001: unresolved external symbol __RTC_InitBase	example.obj
Error	9	error LNK2001: unresolved external symbol "const type_info::vftable'" (??_7type_info@@6B@)	example.obj
Error	10	error LNK2001: unresolved external symbol _mainCRTStartup	example


I have tried compiled the .exe and the .dll with msvcrt.lib and msvcrtd.lib excluded from the builds. I have tried a debug .exe with a release .dll. I have changed the code generation options from multi-threaded debug dll to multi-threaded dll. Maybe I am missing the right combination or maybe it is something else entirely. Any thoughts?

##### Share on other sites
I seem to have solved the problem only to encounter a different one. I had at one point specified not to include any default libraries with the project. This caused the failure at build time for the .exe.

However, now I get an error at runtime and only with the debug application.

---------------------------example.exe - Unable To Locate Component---------------------------This application has failed to start because MSVCR80D.dll was not found. Re-installing the application may fix this problem. ---------------------------OK   ---------------------------`

I have queried for similar errors and I have found references to excluding MSVCRT.lib from the build process. Excluding this from the project building the exe causes the errors that I had before. Basically, I want to be able to compile a debug dll and run it in a debug .exe and to compile a release .dll and run it in a release.exe.

What combination of settings do I need to be able to accomplish this?

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 11
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
632924
• Total Posts
3009232
• ### Who's Online (See full list)

There are no registered users currently online

×