Assume I create a DLL in Netbeans according to this youtube tutorial, I am able to proceed and call the DLL from another C++-source file. Here is the step-by-step procedure, though the DLL works fine using Netbeans!
I create a new empty Project (in my case Visual C++ Win32 Console Application). I add a C++ source file to the source folder. Here is my code
#include "..\SampleLib\SampleLib.h"
#include
int main() {
SampleClass *ptr = new SampleClass();
ptr->TestFunc();
return 0; }
I then type in Include directories, library directoy and at linker input finally under additional dependencies the .dll file
However, I cannot call it from a C++-source file from Microsoft Visual Studio 2010 (currently using Express version).
I include the directory and include the header file. Then I link the source file to the DLL at "additional dependencies".
My error message is:
1>C:\Users\misefe\Documents\NetBeansProjects\SampleLib\dist\Debug\MinGW-Windows\libSampleLib.dll : fatal error LNK1107: Ungültige oder beschädigte Datei: Lesen bei 0x2E0 nicht möglich.
I fear the problem is that no *.lib
file is created. I was following another tutorial of how to implement a DLL in MSVS2010. The only difference is instead of adding the *.lib
file at additional dependencies is my *.dll
file. Obviously, that is a bad try, but best I could think of.
Does anybody know how to:
- either create a
*.lib
file in Netbeans - or connect my Netbeans DLL with MSVS2010 properly or solve my problem, respectively?