dll问题(50分)

  • 主题发起人 zhangxiaoping
  • 开始时间
Z

zhangxiaoping

Unregistered / Unconfirmed
GUEST, unregistred user!
写了一个non-mfc dll,测试不了,请帮助:
dll工作区下有mydll工程及dlltest工程(windows console application):
//mydll.cpp--dll工程源文件
#include <iostream>
#include <string>
__declspec(dllexport) void go()
{
std::cout<<"go to --";
}
//main.cpp--dlltest源文件
#include <iostream>
#include <string>
__declspec(dllimport) void go();
void main()
{
go();
}
我想在主程序中调用dll,采用隐式调用,上面的代码是错的,
请问代码应该是怎样的??
 
加一句
#pragma comment(lib, "你dll的Lib")
 
导入导出函数前面都加上extern "C"因为C++写的函数名导出以后都会变得乱七八糟,加上extern "C"以后保证了名字不变,嘿嘿
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
567
import
I
I
回复
0
查看
406
import
I
顶部