- 积分
- 9
- 注册时间
- 2003-2-26
- 仿真币
-
- 最后登录
- 1970-1-1
|
我又把HELP文件看了一遍,感觉有点长进,生成了DLL文件,configuration也设置了,可是程序还是断的,我在前面板中给各个输入参数赋了值,函数的输出也有indicator,我点那个断的箭头,它提示说:function not founed in library,然后我继续查资料,资料上 有个标题引起了我的注意Preventing C++ Name Decoration,,就是说用VC编译的时候,可能编译器会把函数的名字改动,从而在目标DLL文件中,可能函数名遍了,关键就是在这里,我不是很懂了,资料上,是这样实现的,
When you build shared libraries for C++, you must prevent the C++
compiler from decorating the function names in the final object code. To
do this, wrap the function declaration in an extern "C" clause, as shown
in the following prototype.
extern "C" {
long MyDLLFunction(long nInput, unsigned long nOutput,
void *arg1);
}
long MyDLLFunction(long nInput, unsigned long nOutput,
void *arg1)
{
/* Insert Code Here */
我不是很懂它的这个“C“是什么意思,我就直接在我的函数前面加了一个extern
可是结果还是不行,我现在想,可能就是这块的问题,所以来问问,请高手给点指点,谢谢 :) |
|