在 Adobe XMP SDK 中找不到 SXMPMeta

cannot find SXMPMeta in Adobe XMP SDK

本文关键字:找不到 SXMPMeta SDK Adobe XMP      更新时间:2023-10-16

我正在尝试编写一个简单的Qt小部件应用程序,它允许我读写。XMP文件使用Qt框架Adobe XMP SDKOS X 10.10上。

我是一个菜鸟,绝不是C++专业 (并且拥有C++和Qt的基本/中级自学知识,这意味着我在尝试做某事时依赖谷歌,有时最终会使用坏习惯或可以简化的代码)

  1. 我已经从Adobe下载并构建了XMP SDK,并构建了部分示例

(由于某种原因,我无法构建其他的,但现在这不是那么重要)。

  1. 我已经构建了静态的64位版本的库(libXMPCoreStatic.a &&libXMPFilesStatic.h)

  2. 与公共文件夹中的包含文件夹一起,我将它们放在Qt Widget App项目的文件夹中,放入子文件夹框架

  3. 我已将库链接到我的项目(在我的 .pro 文件中):

    LIBS += -L$$PWD/XMPFramework/ -lXMPCoreStatic
    LIBS += -lXMPFilesStatic
    INCLUDEPATH += $$PWD/XMPFramework/include/
    DEPENDPATH += $$PWD/XMPFramework/
    PRE_TARGETDEPS += $$PWD/XMPFramework/libXMPCoreStatic.a
    PRE_TARGETDEPS += $$PWD/XMPFramework/libXMPFilesStatic.a
    
  4. 我已经在我的应用程序中包含了 XMP(基本应用程序仅用于测试我是否可以连接和使用 XMP SDK 的一些基础知识) - 主窗口.cpp :

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <cstdio>
    #include <string>
    #include <cstring>
    #define MAC_ENV 1 //don't know why, but when I don't explicitly
    //define this, then the app won't build
    // Must be defined to instantiate template classes
    //#define TXMP_STRING_TYPE std::string
    //when used, I get whole range of errors, there's a sample at the end of the question
    // Must be defined to give access to XMPFiles
    #define XMP_INCLUDE_XMPFILES 1
    #include <XMP.incl_cpp> //XMP INCLUDE
    #include <XMP.hpp>      //XMP INCLUDE
    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    
    //this if is taken from the sample code
    //for the SDK, the problem is that
    //my project does not know the SXMPMeta
    //but seems to know at least part of the SDK
    //because at least part of the classes and methods
    //are visible through the intellisense
    if(!SXMPMeta::Initialize())
    {
    //the project does not react to SXMPMeta
    //and does not know it, even though the
    //XCode project I've built from the SDK's samples
    //seems to be ok
    ...
    }
    }
    ...the rest omitted for brevity...
    

    您是否看到我犯的一些错误或SXMPMeta类不存在的原因?


我尝试使用#define TXMP_STRING_TYPE std::string时遇到的错误示例。我的想法是它与模板化 XMP 类的初始化有关

Undefined symbols for architecture x86_64:
"_CFBundleCopyExecutableArchitectures", referenced from:
XMP_PLUGIN::IsValidLibrary(std::string const&) in libXMPFilesStatic.a(OS_Utils_Mac.o)
"_CFBundleCopyResourceURL", referenced from:
XMP_PLUGIN::GetResourceDataFromModule(__CFBundle*, std::string const&, std::string const&, std::string&) in libXMPFilesStatic.a(OS_Utils_Mac.o)
"_CFBundleCreate", referenced from:
XMP_PLUGIN::IsValidLibrary(std::string const&) in libXMPFilesStatic.a(OS_Utils_Mac.o)
XMP_PLUGIN::LoadModule(std::string const&, bool) in libXMPFilesStatic.a(OS_Utils_Mac.o)
"_CFBundleGetFunctionPointerForName", referenced from:
XMP_PLUGIN::GetFunctionPointerFromModuleImpl(__CFBundle*, char const*) in libXMPFilesStatic.a(OS_Utils_Mac.o)
"_CFBundleIsExecutableLoaded", referenced from:
XMP_PLUGIN::LoadModule(std::string const&, bool) in libXMPFilesStatic.a(OS_Utils_Mac.o)
"_CFBundleLoadExecutableAndReturnError", referenced from:
XMP_PLUGIN::LoadModule(std::string const&, bool) in libXMPFilesStatic.a(OS_Utils_Mac.o)
"_CFDataGetBytes", referenced from:
XMP_PLUGIN::GetResourceDataFromModule(__CFBundle*, std::string const&, std::string const&, std::string&) in libXMPFilesStatic.a(OS_Utils_Mac.o)
"_CFNumberGetValue", referenced from:
XMP_PLUGIN::GetResourceDataFromModule(__CFBundle*, std::string const&, std::string const&, std::string&) in libXMPFilesStatic.a(OS_Utils_Mac.o)
"_CFRelease", referenced from:
XMP_PLUGIN::IsValidLibrary(std::string const&) in libXMPFilesStatic.a(OS_Utils_Mac.o)
XMP_PLUGIN::LoadModule(std::string const&, bool) in libXMPFilesStatic.a(OS_Utils_Mac.o)
XMP_PLUGIN::UnloadModule(__CFBundle*, bool) in libXMPFilesStatic.a(OS_Utils_Mac.o)
XMP_PLUGIN::GetFunctionPointerFromModuleImpl(__CFBundle*, char const*) in libXMPFilesStatic.a(OS_Utils_Mac.o)
XMP_PLUGIN::GetResourceDataFromModule(__CFBundle*, std::string const&, std::string const&, std::string&) in libXMPFilesStatic.a(OS_Utils_Mac.o)
"_CFStringCreateWithCString", referenced from:
XMP_PLUGIN::GetFunctionPointerFromModuleImpl(__CFBundle*, char const*) in libXMPFilesStatic.a(OS_Utils_Mac.o)
XMP_PLUGIN::GetResourceDataFromModule(__CFBundle*, std::string const&, std::string const&, std::string&) in libXMPFilesStatic.a(OS_Utils_Mac.o)
"_CFURLCreateDataAndPropertiesFromResource", referenced from:
XMP_PLUGIN::GetResourceDataFromModule(__CFBundle*, std::string const&, std::string const&, std::string&) in libXMPFilesStatic.a(OS_Utils_Mac.o)
"_CFURLCreateFromFileSystemRepresentation", referenced from:
XMP_PLUGIN::IsValidLibrary(std::string const&) in libXMPFilesStatic.a(OS_Utils_Mac.o)
When executing step 'Make'

TXMPFiles是一个模板。SXMPFilesTXMPFiles<std::string>.XMP 工具包 2016.07 示例之一的开头显示了以下代码:

// Must be defined to instantiate template classes
#define TXMP_STRING_TYPE std::string 
// Must be defined to give access to XMPFiles
#define XMP_INCLUDE_XMPFILES 1 
// Ensure XMP templates are instantiated
#include "public/include/XMP.incl_cpp"
// Provide access to the API
#include "public/include/XMP.hpp"