【求助】总是说 “函数未定义”,都有些什么原因啊?多谢

c00der 2007-09-11 10:50:38
我是调用的一个Dll里的函数,
已经包含了它的头文件和 Lib文件,
但是编译时还是找不到它,
不知道在 project->settings里还要如何设置?
而在另一个程序里就没有问题。。。
ncb文件删除重编译也不行。。。

多谢
...全文
646 26 打赏 收藏 转发到动态 举报
写回复
用AI写文章
26 条回复
切换为时间正序
请发表友善的回复…
发表回复
xaobao 2007-10-24
  • 打赏
  • 举报
回复
#ifdef _VIEW
是什么东东?
liuxiuk 2007-09-22
  • 打赏
  • 举报
回复
...

这个错误开始都容易犯..!

^.^
c00der 2007-09-22
  • 打赏
  • 举报
回复
终于搞定了,那个头文件里有个
#ifdef _VIEW

然后在 setting-c/c++ /preprocessor definitions里
加上一个_VIEW就好了。。。

不知道这个预编译指令是做什么用的?
liuxiuk 2007-09-21
  • 打赏
  • 举报
回复
1.DLL单独编译, 看生存了*.lib没

2.看看DLL的导出函数使用的宏对不对?

3.project-->setting c/c++选项里的预编译定义设置选项添加了没?
manbaum 2007-09-21
  • 打赏
  • 举报
回复
Compiler Error C2065

Error Message
'identifier' : undeclared identifier


A variable's type must be specified in a declaration before it can be used. The parameters that a function uses must be specified in a declaration, or prototype, before the function can be used.

Possible causes:

You are compiling with a debug version of the C runtime, declaring a Standard C++ Library iterator variable in a for loop, and then trying to use that iterator variable outside the scope of the for loop. Compiling Standard C++ Library code with a debug version of the C runtime implies /Zc:forScope. See Debug Iterator Support for more information.

You may be calling a function in an SDK header file that is currently not supported in your build environment.

Omitting necessary include files, especially if you define VC_EXTRALEAN, WIN32_LEAN_AND_MEAN, or WIN32_EXTRA_LEAN. These symbols exclude some header files from windows.h and afxv_w32.h to speed compiles. (Look in windows.h and afxv_w32.h for an up-to-date description of what's excluded.)

Identifier name is misspelled.

Identifier uses the wrong uppercase and lowercase letters.

Missing closing quote after a string constant.

Improper namespace scope. To resolve ANSI C++ Standard Library functions and operators, for example, you must specify the std namespace with the using directive. The following example fails to compile because the using directive is commented out and cout is defined in the std namespace:

搞不明白楼主了。自己看看msdn吧。
c00der 2007-09-21
  • 打赏
  • 举报
回复
定义那个函数的头文件我肯定是引用了的。。。还不至于那么失误。。。。呵呵
c00der 2007-09-20
  • 打赏
  • 举报
回复
>>编译不过,那说明你的头文件没引对。
请问 应该如何正确引用啊?
manbaum 2007-09-20
  • 打赏
  • 举报
回复
编译不过,那说明你的头文件没引对。
c00der 2007-09-20
  • 打赏
  • 举报
回复
各位老大,编译时出的错,还没有开始 link呢,
是不是与lib等link的部分无关啊?
manbaum 2007-09-20
  • 打赏
  • 举报
回复
>>#pragma comment(lib,"your.lib")
好像不是这个原因吧。。。
另一个程序没用这个,也可以,
我在编译时就出错 ,还不到连接

那你应该仔细比较一下这两个项目文件中link部分的配置有何不同。
c00der 2007-09-20
  • 打赏
  • 举报
回复
错误如故。。。哪位高手还有高见啊?
多谢了。。。
wjkgz 2007-09-20
  • 打赏
  • 举报
回复
看看是否道出的名字不一致
wltg2001 2007-09-20
  • 打赏
  • 举报
回复
先找一下这个函数定义在哪个头文件中,看看这个头文件有没有被包含,是不是拼错了
jennifergiant 2007-09-20
  • 打赏
  • 举报
回复
编译错误和LIB无关的,一个可能是拼写或头文件引用的地方错
还有个可能是在声名前使用。
manbaum 2007-09-20
  • 打赏
  • 举报
回复
error C2065: 'CDBGetExtents' : undeclared identifier

查查哪个头文件里定义了 CDBGetExtents,看看你引了没有。
c00der 2007-09-13
  • 打赏
  • 举报
回复
>>#pragma comment(lib,"your.lib")
好像不是这个原因吧。。。
另一个程序没用这个,也可以,
我在编译时就出错 ,还不到连接
wltg2001 2007-09-13
  • 打赏
  • 举报
回复
error C2065: 'CDBGetExtents' : undeclared identifier
==========================
这不是链接错误,而是编译错误,所以不会是库库文件的问题,库出错都是链接错误,看一下头文件,是不是拼错了.
c00der 2007-09-13
  • 打赏
  • 举报
回复
郁闷地顶一下。。。
hahabaker 2007-09-12
  • 打赏
  • 举报
回复
要在用到函数的地方声明它
sjdev 2007-09-12
  • 打赏
  • 举报
回复
按楼上的来吧。
加载更多回复(6)

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧