开发者

netbeans projects that depends on other projects and their includes

开发者 https://www.devze.com 2023-03-19 14:34 出处:网络
I have a certain c++ (library) project in netbeans 7.0. Lets call it the A project. Now i have a c++ (application) project called B.

I have a certain c++ (library) project in netbeans 7.0. Lets call it the A project.

Now i have a c++ (application) project called B.

B depends on A:

1) at compile-time for some includes in A project

2) at link-time for the libA.so

2) is pretty easy, since i just need to go to project properties-> build(linker) -> libraries and click "Add Project.."

However its not that clear what the best nice, clever approach开发者_如何学Python for 1) is. I've created pkg-config entries in the past to help projects find third-party libraries, but is a bit more work to do it for projects themselves. I could also include existing file directly, but i would have to add ugly ../../A/ in the includes which is PRECISELY what i'm trying to avoid

So I would like to hear about people solving this problem in the past and what was the best solution they found


You can add "an additional library directory" in the linker portion of the project properties. Then you can refer to library file "A" without the path specifier. This is a command line option to the linker to search that directory for libraries it has not found.

I'm not sure if they've added that option to the project properties for Qt projects in 7.0 or not. It's missing for those projects in 6.9.1

0

精彩评论

暂无评论...
验证码 换一张
取 消