How do I include a statically linked library in my

2019-01-24 16:32发布

I have an open-source library that's distributed in source form. After I run the Makefile, I end up with a .h file and a .a file that I then want to include in a project that I'm working on. I'm familiar with how I can add these by editing a Makefile manually or by invoking the compiler from the command line, but I'm not sure how I can add these to my Eclipse C++ project, created using the CDT.

I'm currently using Eclipse Indigo. I found some instructions for older versions of Eclipse, but the menus aren't what are described. I poked around a bit, and didn't see anything familiar.

2条回答
乱世女痞
2楼-- · 2019-01-24 17:22

How do I add an external library to my C++ project?

Go to Your Project's Properties by right clicking on project's name and selecting properties. Click on "C/C++ Build". Under Settings->Tool Settings Tab, click on GCC C Linker / Libraries. Then add a library and a search path.

查看更多
Animai°情兽
3楼-- · 2019-01-24 17:31

right click on the project name in the project explorer with the project being opened, select project properties. Then select C/C++ General -> Paths and Symbols -> includes -> GNU C++ and add the path to your header file. You should do the same for you library under : C/C++ General -> Paths and Symbols -> Libraries -> Add , and add your library file path.

查看更多
登录 后发表回答