I'm making a programming learning game for my senior project and I'm looking for a compiler that can compile a DLL that can then be dynamically loaded into a Visual Studio 2008 C++ application.
The important idea here is that the compiler is redistributable. If VS was redistributable I'd be using that.
So far I'm had some success using MinGW, but that success is limited. Currently I'm only able to get one DLL loaded and working at a time. The moment I try to load a second one the VS C++ app crashes with a Access Violation error.
I've been able to load two DLLs compiled in VS itself without problem so it leads me to believe that it's something specific to MinGW, it's DLL's, and how they interact with LoadLibrary() and whatnot.
I've been working at this problem for quite some time and I'm frusterated. If anyone knows of a different compiler that you know would work instead of MinGW, or if you'd seen this problem perhaps you know why the second DLL crashes it. I'm sure it's related to each DLL stepping on the other in some way but I have no idea what that would be or how to find out.
It could be the way I'm compiling the DLL or how I'm loading it; I have no idea.
I would really appreciate the feedback, thanks!
Edit: These are the simple calls to g++ and dlltool for creating the DLL http://pastebin.com/f675df4b0
This is the source from one of my DLLs. http://pastebin.com/f5c062611
This is the code in my C++ app for loading the DLL. http://pastebin.com/f52f94a18
-Michael