本文介绍了如何将VC ++ DLL链接到MinGW Application?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我使用.h文件创建DLL.
Hi ALL
I Create the DLL Using .h file.
#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文件
.cpp file
#include "StdAfx.h"
#include "ExportedClass.h"
CExportedClass::CExportedClass(void)
{
}
CExportedClass::~CExportedClass(void)
{
}
void CExportedClass::TestMessage()
{
AfxMessageBox(L"Success");
}
我遵循链接步骤
http://www.mingw.org/wiki/MSVC_and_MinGW_DLLs
命令:
reimp DLLTest.lib
pexports DLLTest.dll> DLLTest.def
dlltool -U -d DLLTest.def -l DLLTest.a
使用上述命令0kb会生成一个文件.
请让我知道如何解决此问题.
谢谢
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
推荐答案
这篇关于如何将VC ++ DLL链接到MinGW Application?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!