未定义的Eclipse C ++引用 [英] Undefined reference to Eclipse C++

查看:153
本文介绍了未定义的Eclipse C ++引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了越来越多的时间,但是我也遇到了同样的错误。
当我使用外部lib时,例如我试图使用openssl和crypto ++,我收到错误:undefined reference to(function)。



我不知道为什么Eclipse这样做,这个没有,#include都是正确的。
我甚至尝试添加从属性C / C ++通用路径&符号,但没有。



有人可以帮助我吗?

解决方案

你必须指定必须链接到可执行文件的共享库的名称。



假设您正在使用GNU工具链,可以按照以下步骤进行操作: p>


  1. 右键单击项目,然后选择属性

  2. 转到 C / C ++ Build - > 设置

  3. 选择 GCC C链接器 - >

  4. 库(-l),添加您的库的名称

  5. 如果需要,将您的库托管的目录放在图书馆搜索路径(-L)


I've tried more and more time, but I got the same error. When I use an external lib, for example I'm try to work on openssl and crypto++, I receive the error: "undefined reference to (function)".

I dunno why Eclipse do that neverthless the #include are all correct. I've tried even to add the path from Properties-C/C++ General-Path & Symbols but nothing.

Can anybody help me?

解决方案

You must specify the name of the shared libraries which must be linked to the executable.

Assuming you are using the GNU toolchain, you can do it by following these steps:

  1. Right-click on the project, then select Properties
  2. Go under C/C++ Build -> Settings
  3. Select GCC C Linker -> Libraries
  4. In Libraries (-l), add the name of your libraries,
  5. If needed, put the directory where your libraries are hosted in Library search path (-L).

这篇关于未定义的Eclipse C ++引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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