Sign in to follow this  

Building a simple engine using SDL in a dll

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

If you intended to correct an error in the post then please contact us.

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 <Daedalus.h>

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

	while (engine->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 this post


Link to post
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?

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this