【发布时间】:2015-09-24 09:07:57
【问题描述】:
TL;DR:如何使项目依赖于 Visual Studio 中的另一个静态库项目
我正在尝试制作一个使用此库的小型 C++ 项目:http://finitetransform.sourceforge.net/
该库包含两个项目。 NTTW 和 FRTW,其中 FRTW 取决于 NTTW。我的项目应该依赖于 FRTW。 NTTW 和 FRTW 以及相对较小且简单的库,没有任何外部依赖(除了 c 标准库)
现在我是 Visual Studio 中 C++ 开发的新手,但我一直在谷歌上搜索好几天,想知道如何设置它。
这就是我想要的: 我想要一个 Visual Studio 中的解决方案,我可以在其中构建 NTTW、FRTW 和我自己的 Playground 应用程序,我可以在其中使用库。我想从源代码构建这两个库,因为我可能想编辑它们。
这就是我所拥有的: 我已经在 Visual Studio 中创建了一个具有我想要的结构的解决方案。我已经创建了自己的项目(一个 c++ 控制台应用程序)和一个用于 NTTW 的项目和一个用于 FRTW 的项目 - 两者都创建了一个“静态库”。
由于库是用 C 语言编写的,因此我禁用了预编译头文件以便构建它们。 然后我将 NTTW 添加为 FRTW 的依赖项,并将 FRTW 添加为我的游乐场项目的依赖项。
什么有效:NTTW 构建得很好。但是,FRTW 没有,因为它无法链接到 NTTW。当我尝试构建它时,我收到这些错误,告诉我它无法从 NTTW 找到头文件
1>------ Build started: Project: FRTW, Configuration: Debug Win32 ------
1> array_complex.c
1> fourier.c
1> ghosts.c
1> mojette.c
1> noise.c
1> radon.c
1> vector.c
1>u:\ct\newproject\fromsource\frtw\ghosts.c(26): fatal error C1083: Cannot open include file: 'nttw/image.h': No such file or directory
1>u:\ct\newproject\fromsource\frtw\radon.c(27): fatal error C1083: Cannot open include file: 'nttw/image.h': No such file or directory
1>u:\ct\newproject\fromsource\frtw\vector.h(29): fatal error C1083: Cannot open include file: 'nttw/array.h': No such file or directory (compiling source file vector.c)
1>u:\ct\newproject\fromsource\frtw\fourier.h(25): fatal error C1083: Cannot open include file: 'fftw3.h': No such file or directory (compiling source file fourier.c)
1>u:\ct\newproject\fromsource\frtw\array_complex.h(30): fatal error C1083: Cannot open include file: 'fftw3.h': No such file or directory (compiling source file array_complex.c)
1>u:\ct\newproject\fromsource\frtw\noise.h(45): fatal error C1083: Cannot open include file: 'nttw/global.h': No such file or directory (compiling source file noise.c)
1>u:\ct\newproject\fromsource\frtw\mojette.c(29): fatal error C1083: Cannot open include file: 'nttw/prime.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
我很不确定从这里该怎么做。任何帮助将不胜感激。谢谢
【问题讨论】:
标签: c++ c visual-studio-2013 msbuild static-libraries