简体   繁体   English

铛:错误:链接器命令失败,退出代码为1(使用-v查看调用)-Qt Creator 3.3

[英]clang: error: linker command failed with exit code 1 (use -v to see invocation) - Qt Creator 3.3

Alright, I know that there are other posts on this error, but I can't seem to find one that fixes my problem. 好的,我知道关于此错误的其他文章,但是我似乎找不到解决此问题的文章。 The issue is that when I try to build my C++ project in Qt Creator I get two errors: 1) symbol(s) not found for architecture x86_64 and 2) linker command failed with exit code 1 (use -v to see invocation) . 问题是,当我尝试在Qt Creator中构建C ++项目时,遇到两个错误:1) symbol(s) not found for architecture x86_64 ,2) linker command failed with exit code 1 (use -v to see invocation) The code builds and runs fine until I try to implement the FFT using the FFTW-3.3.4 library. 在我尝试使用FFTW-3.3.4库实现FFT之前,代码会正常运行。 The complete compiler output is: 完整的编译器输出为:

14:55:10: Running steps for project RFdata...
14:55:10: Configuration unchanged, skipping qmake step.
14:55:10: Starting: "/usr/bin/make" 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr    /bin/clang++ -c -pipe -g -isysroot     /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDK    s/MacOSX10.9.sdk -mmacosx-version-min=10.7 -Wall -W -fPIE -DQT_CORE_LIB -    I../Qt/5.4/clang_64/mkspecs/macx-clang -I../RFdata -I../RFdata/fftw-    3.3.4/libbench2 -I../Qt/5.4/clang_64/lib/QtCore.framework/Versions/5/Headers -I. -    I. -F/Users/Mike/Desktop/Qt/5.4/clang_64/lib -o main.o ../RFdata/main.cpp
../RFdata/main.cpp:93:22: warning: comparison of integers of different signs:     'long' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  for (long i = 0; i < str.length(); ++i)                                                                                        //M:for loop that iterates through the length of the string and                                                                 //replaces each occurance of a ch1 with ch2
                   ~ ^ ~~~~~~~~~~~~
1 warning generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr    /bin/clang++ -c -pipe -g -isysroot     /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDK    s/MacOSX10.9.sdk -mmacosx-version-min=10.7 -Wall -W -fPIE -DQT_CORE_LIB -    I../Qt/5.4/clang_64/mkspecs/macx-clang -I../RFdata -I../RFdata/fftw-    3.3.4/libbench2 -I../Qt/5.4/clang_64/lib/QtCore.framework/Versions/5/Headers -I. -    I. -F/Users/Mike/Desktop/Qt/5.4/clang_64/lib -o display_vector.o     ../RFdata/display_vector.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr    /bin/clang++ -c -pipe -g -isysroot     /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDK    s/MacOSX10.9.sdk -mmacosx-version-min=10.7 -Wall -W -fPIE -DQT_CORE_LIB -    I../Qt/5.4/clang_64/mkspecs/macx-clang -I../RFdata -I../RFdata/fftw-    3.3.4/libbench2 -I../Qt/5.4/clang_64/lib/QtCore.framework/Versions/5/Headers -I. -    I. -F/Users/Mike/Desktop/Qt/5.4/clang_64/lib -o convert_string.o     ../RFdata/convert_string.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr    /bin/clang++ -headerpad_max_install_names -Wl,-    syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/De    veloper/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.7 -Wl,-    rpath,/Users/Mike/Desktop/Qt/5.4/clang_64/lib -o RFdata main.o display_vector.o     convert_string.o   -F/Users/Mike/Desktop/Qt/5.4/clang_64/lib -    L/Users/Mike/Desktop/RFdata/fftw-3.3.4/libbench2/ -lbench2 -framework QtCore -    framework DiskArbitration -framework IOKit 
Undefined symbols for architecture x86_64:
  "_fftw_cleanup", referenced from:
      hilbert() in main.o
  "_fftw_destroy_plan", referenced from:
      hilbert() in main.o
  "_fftw_execute", referenced from:
      hilbert() in main.o
  "_fftw_plan_dft_1d", referenced from:
      hilbert() in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see     invocation)
make: *** [RFdata] Error 1
14:55:11: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project RFdata (kit: Desktop Qt 5.4.0 clang     64bit)
When executing step "Make"
14:55:11: Elapsed time: 00:01.

I have absolutely no experience with linking libraries so any help would be absolutely amazing! 我绝对没有链接库的经验,因此任何帮助都将非常惊人! I should probably show what my .pro file says since from what I can understand, adding the correct lines in the .pro file can be the difference between successfully linking to a library and not being as successful! 我可能应该显示.pro文件的内容,因为据我所知,在.pro文件中添加正确的行可能是成功链接到库与未成功连接之间的区别! .pro: 的.pro:

QT       += core

QT       -= gui

TARGET = RFdata
CONFIG   += console
CONFIG   -= app_bundle

TEMPLATE = app


SOURCES += main.cpp \
    display_vector.cpp \
    convert_string.cpp

HEADERS += \
    display_vector.h \
    convert_string.h

macx: LIBS += -L$$PWD/fftw-3.3.4/libbench2/ -lbench2

INCLUDEPATH += $$PWD/fftw-3.3.4/libbench2
DEPENDPATH += $$PWD/fftw-3.3.4/libbench2

macx: PRE_TARGETDEPS += $$PWD/fftw-3.3.4/libbench2/libbench2.a

So, I guess the overarching question, though I realize it is a very general and possibly simple one, is how do I go about successfully linking the fftw-3.3.4 library to my c++ project in Qt creator 3.3 on my mac (OSX 10.9.5)????? 因此,尽管我意识到这是一个非常普遍且可能很简单的问题,但我猜想最重要的问题是如何在Mac(OSX 10.9)上将fftw-3.3.4库成功链接到Qt creator 3.3中的c ++项目。 .5)????? This has been driving me insane! 这让我发疯了!

It looks like you are trying to link a 32bit library into a 64bit executable. 看来您正在尝试将32位库链接到64位可执行文件。 Either look for a 64bit library or compile it as a 32bit program. 寻找64位库或将其编译为32位程序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 clang:错误:在cmake中链接库时,链接器命令失败,退出代码为1(使用-v查看调用) - clang: error: linker command failed with exit code 1 (use -v to see invocation) when linking library in cmake 铛:错误:链接器命令失败,退出代码为1(使用-v查看调用)*关于全局变量 - clang: error: linker command failed with exit code 1 (use -v to see invocation) *about global variables VSCode:clang:错误:linker 命令失败,退出代码为 1(使用 -v 查看调用) - VSCode: clang: error: linker command failed with exit code 1 (use -v to see invocation) clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)控制台应用程序 - clang: error: linker command failed with exit code 1 (use -v to see invocation) console app 铛:错误:链接器命令失败,退出代码为1(使用-v查看调用)MINIX3 - clang: error: linker command failed with exit code 1 (use -v to see invocation) MINIX3 如何修复 clang:错误:linker 命令失败,退出代码为 1(使用 -v 查看调用) - How do I fix a clang: error: linker command failed with exit code 1 (use -v to see invocation) 编译我的 C++ 程序:clang: error: linker command failed with exit code 1(使用 -v 查看调用) - Compiling my c++ program: clang: error: linker command failed with exit code 1 (use -v to see invocation) Cocos2d-x-铛:错误:链接器命令失败,退出代码为1(使用-v查看调用) - Cocos2d-x - clang: error: linker command failed with exit code 1 (use -v to see invocation) clang++:错误:linker 命令在带有 ffmpeg 的 cpp 中失败,退出代码为 1(使用 -v 查看调用) - clang++: error: linker command failed with exit code 1 (use -v to see invocation) in cpp with ffmpeg QT Q_PROPERTY错误:链接器命令失败,退出代码为1(使用-v查看调用) - QT Q_PROPERTY error: linker command failed with exit code 1 (use -v to see invocation)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM