Hi everyone,
I'm a medium-to-low experienced programmer, and I'm trying to compile
Doomsday, a source port of Doom (the game):
https://sourceforge.net/projects/deng/
I am on Windows XP.
The problem I'm having is with linking. This project is organized so
the core engine resides in an exe (doomsday.exe) and game-specific code
contained in a dll (jDoom.dll). The import/export between them is
two-way, and both have .DEF files included with their source. According
to the defs, the exe exports approximately 400 functions to the dll, and
the dll exports just one to the exe.
I *think* how it's supposed to work is that an import library is created
from the exe, (using __cdecl), and linked by the dll when the dll is
compiled. This has me a bit confused, as the stuff I've read online
describe the process as being the other way around. The exe on the
other hand dynamically links to the dll with LoadLibrary.
After I successfully compiled the engine, I realized that I needed an
import library. So I executed this command, not really expecting it to work:
dlltool -D doomsday.exe -d ../../engine/api/doomsday.def -l libdoomsday.a
Surprising to me at least, this seemed to generate a valid file. When I
compiled the dll, I then added "-ldoomsday", and it too seemed to
complete successfully.
The problem comes when I try to run it. The engine calls
LoadLibrary(<path>\jDoom.dll); it fails and pops out a GetLastError 193.
I'm not even sure what I'm doing wrong. Can someone help me?
|