Mingw FFTW3找不到库/头文件 [英] Mingw FFTW3 cannot find a library/header file

查看:1316
本文介绍了Mingw FFTW3找不到库/头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows机器上,我试图让Mingw(使用gcc / g ++ 4.9.2)来识别我已经安装了一个库。

I am on a Windows machine, and I am trying to get Mingw (with gcc/g++ 4.9.2) to recognize that I have a library installed.

图书馆是这里的fftw3(快速傅里叶变换)库:

The library is the fftw3 (fast fourier transform) library here :

http://www.fftw.org/install/windows.html

我下载的文件夹有三个重要的DLL和一些其他头文件也

I downloaded the folder which has three important dlls and some other header files too

libfftw3-3.dll
libfftw3l-3.dll
libfftw3f-3.ll

libfftw3-3.dll libfftw3l-3.dll libfftw3f-3.ll

但是我对于他们怎么做都很失落。

But I'm at a loss as to what to do with them.

我有另一个需要库的作者的C ++代码,当我运行

I have C++ code from another author that requires the library, and when I run

waf配置
waf build

我收到错误-libfftw3没有找到。

I get the error that "-libfftw3" is not found.

我已经把dll的目录放到我的Windows路径中,这似乎是一个这么简单的问题,弄清楚如何让编译器找到预编译的DLL。 (我也尝试只是让gcc编译器进行默认搜索,而不指定一个库,但它说fftw.h没有找到,这是奇怪的,因为我已经把该目录放在我的路径。

I have already put the directory where the dlls are into my Windows path, and this seems like such a simple problem but I can't figure out how to get the compiler to find the pre-compiled DLLs. (I also tried just having the gcc compiler do a default search without specifying a library but it said "fftw.h" not found, which is strange because I already put that directory in my path.

任何帮助将不胜感激;我已经阅读了网站的说明,但对于Windows,它只会告诉您使用Visual Studio的一些命令(但是我没有使用该编译器),而且我已经浏览了其他网站问题,但我找不到这个具体问题的解决方案。

Any help would be appreciated; I did read the website's instructions but for Windows it only tells you to use some commands for Visual Studio (but I'm not using that compiler) and I have browsed other sites for similar issues but I can't find a solution to this specific issue.

推荐答案

你必须把头文件,以及GCC / G ++将会找到它们的DLL;(它不搜索Windows路径,而是使用'-i path / to / headers'和' - 编译器命令中的L路径/到/ libs选项本身)。

You have to put both the header file(s), and the DLLs somewhere that GCC/G++ will look for them; (it does not search the Windows path for these, but rather paths specified with the '-I path/to/headers' and '-L path/to/libs' options in the compiler commands themselves).

基本上,这里有三个选项:

You have, basically, three options here:


  1. 明确指定每个
    上的相应的-I和-L选项单独的编译器命令本身。

  2. 为头文件设置CPATH,C_INCLUDE_PATH和CPLUS_INCLUDE_PATH等环境变量,以及库的LIBRARY_PATH。

  3. 安装将头文件和DLL复制到标准目录中,这些目录已经被编译器自动搜索。

请参考< a href =http://mingw.org/wiki/IncludePathHOWTO =nofollow> http://mingw.org/wiki/IncludePathHOWTO
http://mingw.org/wiki/LibraryPathHOWTO 获取更全面的详细信息。

Please refer to http://mingw.org/wiki/IncludePathHOWTO and http://mingw.org/wiki/LibraryPathHOWTO for fuller details.

注意在DLL的情况下,您安装它们的目录也必须出现在应用程序的(.EXE)默认DLL搜索路径中。

Note that, in the case of DLLs, the directories in which you install them must also appear in your application's (.EXE's) default DLL search path.

另请注意,如果这些都是您尚未编译的DLL,可能是使用除MinGW GCC / G ++,之外的任何编译器编译的,它们导出C ++符号,它们可能不符合您的应用程序,您使用MinGW的G ++编译。

Also note that, if these are DLLs which you have not compiled yourself, which may have been compiled with any compiler other than MinGW's GCC/G++, and they export C++ symbols, they may not be compatible with your application, which you are compiling with MinGW's G++.

这篇关于Mingw FFTW3找不到库/头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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