Click here to Skip to main content
15,844,155 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ALL

I Create the DLL Using .h file.
C++
#pragma once
#ifdef USBINTERFACE_EXPORTS
#define USBINTERFACE_API __declspec(dllexport)
#else
#define USBINTERFACE_API __declspec(dllimport)
#endif

class USBINTERFACE_API CExportedClass
{
public:
	CExportedClass(void);
	void TestMessage();
public:
	~CExportedClass(void);
};

.cpp file

C++
#include "StdAfx.h"
#include "ExportedClass.h"

CExportedClass::CExportedClass(void)
{
}

CExportedClass::~CExportedClass(void)
{
}

void CExportedClass::TestMessage()
{
AfxMessageBox(L"Success");
}


I follow the link step
http://www.mingw.org/wiki/MSVC_and_MinGW_DLLs

Command:
reimp DLLTest.lib
pexports DLLTest.dll > DLLTest.def
dlltool -U -d DLLTest.def -l DLLTest.a

With the use of above command 0kb .a file generated .
Please let me know how to solve this problem.

Thanks
Posted
Updated 18-Aug-11 2:56am
v3

Does this[^] help?
 
Share this answer
 
Just a thought, but maybe you also need include some "extern C" wrappings around the header declaration so the functions are exported without any name mangling. :)
 
Share this answer
 
Comments
GAJERA 18-Aug-11 8:32am    
extern "C"
{
class SLTUSBINTERFACE_API CExportedClass
{
public:
CExportedClass(void);
void TestMessage();
public:
~CExportedClass(void);
};
};
same it also not working ,same error
Philippe Mori 25-Aug-11 19:49pm    
Extern C is mainly for C code (plain functions).
Ten years ago, COM (Active X) was used to communicate between library written by different compilers. If MinGW support it, then it might be an internative to investigate.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900