【发布时间】:2017-12-16 07:47:52
【问题描述】:
我正在尝试构建 Bullet Physics 源代码。他们的 cmake 东西都不起作用,所以我只是将 Bullet 源文件直接复制到我的 Visual Studio 项目中并直接构建它。但是,只会构建 64 位版本。当我尝试构建 32 位时,它给出了一堆以“E2474 user-defined literal operator not found”开头的错误——这似乎来自 btScalar.h 中 btAssert 的定义
我的项目必须缺少一些预处理器指令或设置或其他东西。如果有人可以查看这些定义并查看我的 Visual Studio 2017 项目中需要更改哪些设置,那就太棒了。请告诉我,谢谢。
项目链接: https://github.com/mister51213/BulletSetupTest/tree/master/BulletPhysicsTest1
代码:
#ifdef BT_DEBUG
#ifdef _MSC_VER
#include <stdio.h>
#define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);__debugbreak(); }}
//#define btAssert(x)
#else//_MSC_VER
#include <assert.h>
#define btAssert assert
#endif//_MSC_VER
#else
#define btAssert(x)
//#define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);__debugbreak(); }}
#endif
//btFullAssert is optional, slows down a lot
#define btFullAssert(x)
#define btLikely(_c) _c
#define btUnlikely(_c) _c
#else
【问题讨论】:
标签: c++ visual-studio visual-studio-2017 assert preprocessor-directive