c++ Boost Mix with objective-c
c++ Boost Mix with objective-c
我正在尝试使用boosts构建c ++项目。我创建了一个使用 OSX-SDK-9 的 objective-c++ 类,我计划从普通的 c++ 类中得到提升,包括。使用 SDK 框架的对象 c++:
AppKit.framework
CoreGraphics.framework
它包含
#include <ApplicationServices/ApplicationServices.h>
#include <Carbon/Carbon.h>
#include <AppKit/AppKit.h>
#include <AppKit/NSEvent.h>
当我将 object-c++ 的包含添加到提升类时,我看到编译错误错误当我删除提升包括构建成功时
引导在静态库中编译
使用以下参数生成代码
xcode 6.3.2(6D2105)
compiler Apple LLVM6.1
GUN++11 [-std=gun++11]
libc++(LLVM c++ standard library with c++11 support)
我做错了什么?我如何在同一个程序中使用 c++ boost 和 OSK SDK
看起来这是 Boost 的集合类型和碳收集管理器之间的名称冲突。
"集合"在此标头中定义:
#include <CarbonCore/Collections.h>
并且符号"集合"在提升的几个地方使用。
构建日志应显示导致问题的确切提升标头。您可以包含较小的 boost 标头子集以避免"集合"符号,或者可以在单独的源代码文件中编写使用 boost 的函数以避免冲突。
在 Boost 标头之前包含 AppKit 标头可以解决此特定问题。
另一个问题会出现——expected unqualified-id
,可以通过以下方式解决——
#include <AppKit/AppKit.h>
#undef nil
#include "boost headers here"
#define nil nullptr
相关文章:
- Problems with std::cin.fail()
- 如何将数组从Objective-C发送到C++函数
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- 这对"With a stackless coroutine, only the top-level routine may be suspended."意味着什么
- Boost.TEST with CLion: "Test framework quit unexpectedly"
- 避免碎片化的ClientHellos with OpenSSL (DTLS)
- Issues with Win32 ReadProcessMemory API
- Qt with WinAPI MouseProc
- [[maybe_unused]] with structured_binding?
- Issue with WriteProcessMemory
- OpenCV RTP-Stream with FFMPEG
- "Unable to start debugging. No process is associated with this object." - 在Visual Studio Code中使用GDB
- std::adjacent_difference with std::chrono time_point
- DLL Made with CMake 使程序崩溃
- using c++ (.cpp) with objective-c (.m)
- 苹果的 Using C++ with Objective-C 文章已经消失了......谁能给我一篇新文章,或者帮我找到旧文章?
- Firebreath project with objective-c++
- c++ Boost Mix with objective-c
- OpenCV with Objective C vs Objective C++
- Objective-C in Qt with Mavericks