DesideriusPapp
New member
- Joined
- May 23, 2009
- Messages
- 21
- Reaction score
- 0
- Points
- 0
Hi all,
I'm still vying with my first .dll addon. My problem is with InitModule and ExitModule. I gather from the API Guide and Reference that the presence of #define ORBITER_MODULE at the head of my main .cpp file should cause the .dll to call both.
My point is, it doesn't - I guess due to something I'm doing wrong. I've got an header file in which I
Then in the main .cpp file I have the following:
It compiles all right and it works, but InitModule and ExitModule are never called. I see in the code samples that #define ORBITER_MODULE is at the top of the file, i.e.: above the #include lines, but if I move it I get the following error:
1>------ Build started: Project: Strelka, Configuration: Release Win32 ------
1>Compiling...
1>Strelka.cpp
1>Linking...
1> Creating library ..\..\..\Orbiter\Modules\Strelka.lib and object ..\..\..\Orbiter\Modules\Strelka.exp
1>Orbitersdk.lib(Orbitersdk.obj) : error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj)
1>..\..\..\Orbiter\Modules\Strelka.dll : fatal error LNK1169: one or more multiply defined symbols found
1>Build log was saved at "file://d:\Strelka Design Project\Strelka\Strelka\Release\BuildLog.htm"
1>Strelka - 2 error(s), 0 warning(s)
Anyone is so kind and patient as to give me a clue of what I'm getting wrong this time?
Thank you!
I'm still vying with my first .dll addon. My problem is with InitModule and ExitModule. I gather from the API Guide and Reference that the presence of #define ORBITER_MODULE at the head of my main .cpp file should cause the .dll to call both.
My point is, it doesn't - I guess due to something I'm doing wrong. I've got an header file in which I
Code:
#include"orbitersdk.h"
Code:
#include"Strelka.h"
#include<stdio.h>
#include<math.h>
#define ORBITER_MODULE
1>------ Build started: Project: Strelka, Configuration: Release Win32 ------
1>Compiling...
1>Strelka.cpp
1>Linking...
1> Creating library ..\..\..\Orbiter\Modules\Strelka.lib and object ..\..\..\Orbiter\Modules\Strelka.exp
1>Orbitersdk.lib(Orbitersdk.obj) : error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj)
1>..\..\..\Orbiter\Modules\Strelka.dll : fatal error LNK1169: one or more multiply defined symbols found
1>Build log was saved at "file://d:\Strelka Design Project\Strelka\Strelka\Release\BuildLog.htm"
1>Strelka - 2 error(s), 0 warning(s)
Anyone is so kind and patient as to give me a clue of what I'm getting wrong this time?
Thank you!
Last edited: