这是什么`ld`错误("未定义的引用")是什么意思? [英] What does this `ld` error ("undefined reference") mean?

查看:600
本文介绍了这是什么`ld`错误("未定义的引用")是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个错误是什么意思?

  /tmp/ccevEqoI.o:在函数'主':
。funcptr.c :(文字+ 0x61):未定义引用'的addAll
collect2:劳工处返回1退出状态

我试图写一个函数将所有整数到了极限
由用户输入


转录'答案',这是从OP评论:


  

我写了一个程序,将添加的所有整数高达规定的限额。对于我只好写一个函数。所以我做了一个名为'的addAll功能,但是当我从我的程序中调用它,我称它为'的addAll。


  
  

请注意: C是区分大小写。最后,当我改变了我在那里调用它的函数的名称。它完美地编译:)


  
  

只是觉得这一块信息将是初学者有用。



解决方案

它告诉你,对于功能的addAll的定义无法找到。请确保您有包含的addAll当你编译/链接的目标文件。

What does this error mean?

/tmp/ccevEqoI.o: In function `main':
funcptr.c:(.text+0x61): undefined reference to `AddALL'
collect2: ld returned 1 exit status

I'm trying to write a function which adds all the integers up to the limit entered by the user.


Transcribed 'answer' which is a comment from the OP:

I wrote a program that would add all the integers upto the limit Specified. For that I had to write a function. So I made a function called 'AddAll' but when I called it from my program I called it as 'AddALL'.

Note: C is case sensitive. Eventually when I changed the name of the function where I was calling it. It compiled perfectly :)

Just thought that this piece of info would be useful to beginners.

解决方案

It tells you that the definition for the function 'AddALL' could not be found. Make sure that you include the object file that contains 'AddALL' when you compile/link.

这篇关于这是什么`ld`错误("未定义的引用")是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆