C ++ NetBeans:如何将.o文件链接到我的项目? [英] C++ NetBeans: How to link my .o file to my project?

查看:98
本文介绍了C ++ NetBeans:如何将.o文件链接到我的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我买了一堂课.我有标头(.h)和目标文件(.o). 如何在NetBeans IDE中链接.o文件?

I've bought a class. I have the header (.h) and an object-file (.o). How do I link the .o file in my NetBeans IDE ?

谢谢!

推荐答案

您需要将.o文件添加为外部库.我可以通过以下步骤完成此任务:

You need to add your .o file as an external library. I was able to accomplish this using the following steps:

  1. 转到项目属性
  2. Build->Linker选项下,将库添加到库"部分
  3. 点击添加库文件"
  4. 导航到您的.o文件,然后选择absolute path选项
  5. 重建
  1. Go to Project Properties
  2. Under the Build->Linker options, add a library to the Libraries section
  3. Click 'Add Library File'
  4. Navigate to your .o file and select the absolute path option
  5. Rebuild

希望这对您也有用.

这篇关于C ++ NetBeans:如何将.o文件链接到我的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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