C++ NetBeans: How to link my .o file to my project

2020-07-17 08:11发布

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 ?

Thanks!

标签: c++ netbeans
1条回答
你好瞎i
2楼-- · 2020-07-17 08:26

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

  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

Hopefully this will work for you also.

查看更多
登录 后发表回答