C++ qt编译错误:未找到架构x86_64的符号

C++ qt编译错误:未找到架构x86_64的符号,c++,macos,qt,compiler-errors,C++,Macos,Qt,Compiler Errors,尝试在mac上使用Qt5.4 64位编译程序。该程序包括使用Opal Kelly.dylib文件和头文件与通过USB连接的FPGA进行对话。该程序在具有windows版本的.dylib(.dll)和windows头文件的windows上编译良好,但在mac上,我在尝试编译时遇到以下错误: :-1: error: symbol(s) not found for architecture x86_64 编译器输出为: Undefined symbols for architecture x86_6

尝试在mac上使用Qt5.4 64位编译程序。该程序包括使用Opal Kelly.dylib文件和头文件与通过USB连接的FPGA进行对话。该程序在具有windows版本的.dylib(.dll)和windows头文件的windows上编译良好,但在mac上,我在尝试编译时遇到以下错误:

:-1: error: symbol(s) not found for architecture x86_64
编译器输出为:

Undefined symbols for architecture x86_64:
  "_okFrontPanelDLL_LoadLib", referenced from:
      MainWindow::AllocateMemory() in ProcessingFunctions.o
  "_okFrontPanelManager_Destruct", referenced from:
      OpalKelly::FrontPanelManager::~FrontPanelManager() in main.o
      OpalKelly::FrontPanelManager::~FrontPanelManager() in fpga.o
      OpalKelly::FrontPanelManager::~FrontPanelManager() in graphing.o
      OpalKelly::FrontPanelManager::~FrontPanelManager() in FPGAScanner.o
      OpalKelly::FrontPanelManager::~FrontPanelManager() in ProcessingFunctions.o
      OpalKelly::FrontPanelManager::~FrontPanelManager() in mainwindow.o
      OpalKelly::FrontPanelManager::~FrontPanelManager() in moc_mainwindow.o
      ...
  "_okFrontPanel_ConfigureFPGA", referenced from:
      OpalKellyLegacy::okCFrontPanel::ConfigureFPGA(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in mainwindow.o
  "_okFrontPanel_Construct", referenced from:
      OpalKellyLegacy::okCFrontPanel::okCFrontPanel() in ProcessingFunctions.o
  "_okFrontPanel_Destruct", referenced from:
      OpalKellyLegacy::okCFrontPanel::~okCFrontPanel() in mainwindow.o
  "_okFrontPanel_GetDeviceCount", referenced from:
      OpalKellyLegacy::okCFrontPanel::GetDeviceCount() in ProcessingFunctions.o
  "_okFrontPanel_GetDeviceID", referenced from:
      OpalKellyLegacy::okCFrontPanel::GetDeviceID() in ProcessingFunctions.o
  "_okFrontPanel_GetSerialNumber", referenced from:
      OpalKellyLegacy::okCFrontPanel::GetSerialNumber() in ProcessingFunctions.o
  "_okFrontPanel_GetWireOutValue", referenced from:
      OpalKellyLegacy::okCFrontPanel::GetWireOutValue(int) in FPGAScanner.o
  "_okFrontPanel_IsFrontPanelEnabled", referenced from:
      OpalKellyLegacy::okCFrontPanel::IsFrontPanelEnabled() in ProcessingFunctions.o
  "_okFrontPanel_LoadDefaultPLLConfiguration", referenced from:
      OpalKellyLegacy::okCFrontPanel::LoadDefaultPLLConfiguration() in mainwindow.o
  "_okFrontPanel_OpenBySerial", referenced from:
      OpalKellyLegacy::okCFrontPanel::OpenBySerial(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in ProcessingFunctions.o
  "_okFrontPanel_ReadFromPipeOut", referenced from:
      OpalKellyLegacy::okCFrontPanel::ReadFromPipeOut(int, long, unsigned char*) in FPGAScanner.o
  "_okFrontPanel_SetWireInValue", referenced from:
      OpalKellyLegacy::okCFrontPanel::SetWireInValue(int, unsigned int, unsigned int) in fpga.o
      OpalKellyLegacy::okCFrontPanel::SetWireInValue(int, unsigned int, unsigned int) in FPGAScanner.o
  "_okFrontPanel_UpdateWireIns", referenced from:
      OpalKellyLegacy::okCFrontPanel::UpdateWireIns() in fpga.o
      OpalKellyLegacy::okCFrontPanel::UpdateWireIns() in FPGAScanner.o
  "_okFrontPanel_UpdateWireOuts", referenced from:
      OpalKellyLegacy::okCFrontPanel::UpdateWireOuts() in FPGAScanner.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: *** [AFE-MP-512.app/Contents/MacOS/AFE-MP-512] Error 1
13:38:18: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project AFE (kit: Clone of Desktop Qt 5.4.0 clang 32bit)
When executing step "Make"
13:38:18: Elapsed time: 00:31.
架构x86_64的未定义符号: “_-okFrontPanelDLL_-LoadLib”,引用自: ProcessingFunctions.o中的MainWindow::AllocateMemory() “_-okFrontPanelManager_-Destruct”,引用自: OpalKelly::FrontPanelManager::~FrontPanelManager()位于main.o中 OpalKelly::FrontPanelManager::~FrontPanelManager()在fpga.o中 OpalKelly::FrontPanelManager::~FrontPanelManager()在graphing.o中 OpalKelly::FrontPanelManager::~FrontPanelManager()在FPGAScanner.o中 OpalKelly::FrontPanelManager::~FrontPanelManager()位于ProcessingFunctions.o中 OpalKelly::FrontPanelManager::~FrontPanelManager()位于mainwindow.o中 OpalKelly::FrontPanelManager::~FrontPanelManager()位于moc_主窗口中 ... “\u ok FrontPanel\u ConfigureFPGA”,引用自: OpalKellyLegacy::okCFrontPanel::在mainwindow.o中配置FPGA(标准:基本字符串) “前面板构造”,引用自: ProcessingFunctions.o中的OpalKellyLegacy::okCFrontPanel::okCFrontPanel() “_okFrontPanel_Destruct”,引用自: OpalKellyLegacy::okCFrontPanel::~okCFrontPanel()位于mainwindow.o中 “_-okFrontPanel_-GetDeviceCount”,引用自: ProcessingFunctions.o中的OpalKellyLegacy::okCFrontPanel::GetDeviceCount() “_-okFrontPanel_-GetDeviceID”,引用自: ProcessingFunctions.o中的OpalKellyLegacy::okCFrontPanel::GetDeviceID() “\u okFrontPanel\u GetSerialNumber”,引用自: ProcessingFunctions.o中的OpalKellyLegacy::okCFrontPanel::GetSerialNumber() “_-okFrontPanel_-GetWireOutValue”,引用自: FPGAScanner.o中的OpalKellyLegacy::okCFrontPanel::GetWireOutValue(int) “\u okFrontPanel\u IsFrontPanelEnabled”,引用自: ProcessingFunctions.o中的OpalKellyLegacy::okCFrontPanel::IsFrontPanelEnabled() “\u ok FrontPanel\u LoadDefaultPLLConfiguration”,引用自: 主窗口中的OpalKellyLegacy::okCFrontPanel::LoadDefaultPLLConfiguration() “_-okFrontPanel_-OpenBySerial”,引用自: ProcessingFunctions.o中的OpalKellyLegacy::okCFrontPanel::OpenBySerial(标准::基本字符串) “\u ok frontpanel\u ReadFromPipeOut”,引用自: OpalKellyLegacy::okCFrontPanel::FPGAScanner.o中的ReadFromPipeOut(int,long,unsigned char*) “_-okFrontPanel_-SetWireInValue”,引用自: fpga.o中的OpalKellyLegacy::okCFrontPanel::SetWireInValue(int,unsigned int,unsigned int) OpalKellyLegacy::okCFrontPanel::FPGAScanner.o中的setwirelinvalue(int,unsigned int,unsigned int) “_-okFrontPanel_-UpdateWireIns”,引用自: fpga.o中的OpalKellyLegacy::okCFrontPanel::UpdateWireIns() FPGAScanner.o中的OpalKellyLegacy::okCFrontPanel::UpdateWireIns() “_-okFrontPanel_-UpdateWireOuts”,引用自: FPGAScanner.o中的OpalKellyLegacy::okCFrontPanel::UpdateWireOuts() ld:找不到架构x86_64的符号 叮当声:错误:链接器命令失败,退出代码为1(使用-v查看调用) make:**[AFE-MP-512.app/Contents/MacOS/AFE-MP-512]错误1 13:38:18:进程“/usr/bin/make”退出,代码为2。 构建/部署项目AFE时出错(工具包:桌面Qt 5.4.0 clang 32位克隆) 执行步骤“Make”时 13:38:18:运行时间:00:31。 我知道当头文件中有一个插槽或函数未被使用时,可能会发生这种错误,但是我不知道如何找到导致问题的原因

找到Opal Kelly头文件


任何帮助将不胜感激,让我知道如果你需要更多的信息

这意味着存在以下问题:

  • 当您应该链接64位动态库时,您正在链接32位动态库
  • 链接器找不到库
  • 或者库中不存在所需的符号
  • 您可以查看编译器和链接器选项,以确保正在链接库。使用
    nm
    string
    确保库中存在函数

    该程序包括使用Opal Kelly.dylib文件和头文件与通过USB连接的FPGA进行对话。。。。
    std::\uu 1::basic\u字符串的未定义符号

    < > >代码> <1 >代码>表示您正在使用LLVM C++运行时(<代码> LBC++< /COD>)。在某个地方,你可能会与GNU C++运行时混合(匹配):<代码> LBSTDC++<代码>。GNU C++运行时( LBSTSTD++<代码>)在其符号中缺少<代码>“第1”/代码> 您应该检查项目和所有预构建库,并确保它们使用其中一个。对于每一个,您应该使用(1)
    -stdlib=libc++
    (LLVM)或(2)
    -stdlib=libstdc++
    (GNU)中的
    cxflags

    请注意,像Xcode这样的IDE可能使用与像Opal Kelly这样的库不同的
    -stdlib=…
    设置。在这种情况下,让Xcode匹配蛋白石方钻杆库,或者重建蛋白石方钻杆库以匹配Xcode


    如果感兴趣,
    \uu 1
    是用于版本控制的内联命名空间。请参阅和。

    iPhone模拟器:

    CONFIG(iphonesimulator, iphoneos | iphonesimulator)
    QMAKE_APPLE_SIMULATOR_ARCHS = x86_64 #i386 for 32bit
    
    iphoneos:

    CONFIG(iphoneos, iphoneos | iphonesimulator)
    

    你的问题是否与此有关?