c++ FFTW3链接错误
C++ FFTW3 linking error
每当我试图用FFTW3实现编译c++程序时,我都会得到非常奇怪的错误。
我正在编译如下
g++ - 03 -lfftw3 myFile.cpp -o myFileFFTW
我还包括我的头文件如下
#include <math.h> #include "fftw3.h"
错误如下
(.text+0x63):对fftw_malloc的未定义引用
有什么建议吗?
编辑:
HMJD的建议对我有用。编译glib时链接器错误…?
我想一个人不应该连续工作3天,否则头脑不工作!!特别感谢hmjd!!你拯救了我的一天,我可以按时完成我的项目!!
我猜问题是-lfftw3不存在于您的系统,您也没有正确指定库。
编译器命令末尾的库:
gcc -I/usr/lib/x86_64-linux-gnu/lib-2.0/include re.c -o re -lglib-2.0
From GCC Link Options:
-llibrary- l图书馆链接时搜索名为library的库。(第二种选择是将库作为单独的参数仅用于POSIX兼容,不推荐使用。)
It makes a difference where in the command you write this option;
the linker searches and processes libraries and object files in the
order they are specified.
Thus, `foo.o -lz bar.o' searches library `z' after file foo.o but
before bar.o. If bar.o refers to functions in `z', those functions
may not be loaded.
编译时链接器错误的片段…?
相关文章:
- Netbeans 10:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
- CMake 错误:链接器命令失败,退出代码为 1 和 cpp.o 文件
- clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用) - 体系结构的未定义符号 x86_64:
- 如何修复 clang: 错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
- Android NDK.Build命令失败.未定义的引用.clang++:错误:链接器命令失败,退出代码为1
- 使用cmake错误链接boost日志
- 错误:链接器命令失败,退出代码为 1(使用 -v 查看调用):在 Macbook 上
- C++ XCODE ld:找不到体系结构x86_64 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -
- clang:错误:链接器命令失败,C++代码中的退出代码为 1(使用 -v 查看调用)
- 静态库中的 g++ 错误链接函数
- 未定义的参考错误链接天然函数Android
- C++编译错误:ld:找不到体系结构x86_64 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -v
- QT Q_PROPERTY错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
- ld:找不到体系结构x86_64 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
- OSX MOJAVE -LD:架构X86_64 clang找不到符号:错误:链接器命令失败,出口代码1
- C 错误链接器命令失败了出口代码1(使用-V查看调用)
- LD:架构x86_64 clang找不到符号:错误:链接器命令失败,出口代码1(使用-v to See
- 聚输出错误 - 链接列表
- Xcode链接器错误:链接器命令失败,退出代码为1(使用-v查看调用)
- 尝试构建C DLIB示例无法与数百个未定义的参考错误链接