当我在visual studio ultimate2010上构建时,我有这个错误,你能让我修复这个错误,非常感谢!
错误1错误C1189:#error:请定义你的 平台。 d:\ dzz \ src \ flexengine \ fxcore \ platform.h 28 1 battleserver
#pragma once
// 平台定义
#if defined __APPLE__
#include "AvailabilityMacros.h"
#include "TargetConditionals.h"
#if TARGET_OS_IPHONE
/* if compiling for iPhone */
#define PLATFORM_IPHONE 1
#else
#define PLATFORM_MACOSX 1
#endif
#elif TARGET_OS_IPHONE
#define PLATFORM_IPHONE 1
#elif ANDROID
#define PLATFORM_ANDROID 1
#elif _WINDOWS
#define PLATFORM_WINDOWS 1
#elif (defined(__linux__))
#define PLATFORM_LINUX 1
#elif (defined(unix))
#define PLATFORM_UNIX 1
#else
#error Please define your platform.
#endif
// 64位检测
#if defined(__x86_64__) || defined(_M_X64) || defined(__LP64__) || defined(__POWERPC64__) || defined( _WIN64 )
#define PLATFORM_64 1
#elif defined(__i386__) || defined(_M_IX86) || defined(_M_PPC) || defined(__LP32__) || defined(__POWERPC__) || IPHONE || ANDROID
#define PLATFORM_32 1
#else
#define PLATFORM_32 1
// #error Please define your platform.
#endif
// 是否支持异常
#if PLATFORM_WINDOWS
#define PLATFORM_EXCEPTIONS 1
#else
#define PLATFORM_EXCEPTIONS 0
#endif
// Platform specific include.
#if PLATFORM_WINDOWS
#include "platform_windows.h"
#elif PLATFORM_IPHONE
#include "platform_iphone.h"
#elif PLATFORM_MACOSX
#include "platform_macosx.h"
#elif PLATFORM_ANDROID
#include "platform_android.h"
#elif PLATFORM_LINUX
#include "platform_linux.h"
#else
#error Unknown platform.
#endif
答案 0 :(得分:0)
看来这个platform.h
尝试使用预定义的宏来检测目标平台。但是,它尝试使用_WINDOWS
宏来检测窗口,这显然是Watcom compiler支持的预处理器宏。
您的选择:
#elif _WINDOWS
替换为#elif _WIN32
来修复标题以使用visual studio。见macros pre-defined by visual studio。我建议采用后一种方法,但是将数据库移植到VS可能(或可能不会)涉及非常重要的工作量。