如何在Objective C / XCode中使用cim
How to use CImg in Objective C / XCode?
我知道clang可以将c++文件编译为.mm
,但是cml只是一个单独的.h
文件。无论我是否将扩展更改为.mm
或将其保留为.h
,它都不起作用。
首先,它抱怨找不到cstdio.h
。因此,我将所有cstd..
导入更改为c对应的
// Include standard C++ headers.
// This is the minimal set of required headers to make CImg-based codes compile.
#include <stdio.h> // (was #import <cstdio>)
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <exception.h>
在引入x11库之后,我将导入错误转化为语法错误:
namespace cimg_library_suffixed {
错误:未知类型名称"namespace"
这是因为我把cstdio
改成了stdio
吗?我困惑. .
答案形式,以备将来参考:
将头文件从obj - c++编译为 #include
d,头文件将被视为c++代码。
相关文章:
- ld:bind_at_load和-bitcode_bundle(Xcode设置ENABLE_bitcode=YES)不能
- 在没有Xcode的情况下在Mac捆绑包中嵌入框架
- Xcode 语义问题引用或以前定义的代码
- 使用 Xcode 将双精度存储在数组C++中
- Xcode 9.4.1 中的 Apple Mach-O 链接器 (id) 错误
- 各种版本的 Mac OSX 向后兼容性如何?(Xcode C++
- MacOS 上的 Xcode 11 项目不在一个函数中使用 sin 和 cos:未定义的符号"___sincosf_stret"
- macOS 是内置在 clang 编译器中还是内置于 xcode ide 中?
- Qt - 从XCode上传到MacOS AppStore
- 在 xcode 10 上找不到 stdlibc++ 标头错误
- cmake add_custom_command + Xcode:多输出 = 多命令调用
- 在 xcode 上使用 stdlib.h
- 我可以在没有Xcode的情况下在Mac上使用带有C++的虚幻引擎吗?
- 为什么不支持 Xcode 1.5?
- C++ Xcode 9 - 无法从 Cimg 调用函数 display()
- Xcode 中的加速框架以获得 A 的 QR 分解,但找不到 zgeqrf
- 如何将 PhysX 库与 Xcode 链接
- C++ 和 WMI:在 IWbemClassObject::P ut 方法中传递对 CIM 类的引用
- Xcode Test Navigator 如何在纯C++项目中显示 Google 测试
- 如何在Objective C / XCode中使用cim