C++ OS X 的 Builder STL 失败?
有人在用 XE2 编译的 Mac 应用程序中尝试过像 #include
这样简单的东西吗?
C++ Builder 的 XE2 更新 1 中的某些基本功能是否已损坏,或者是我的安装已损坏?
只需将 #include
添加到新的 Fire Monkey HD 应用程序中,我就会遇到构建失败:
[BCC32 Error] cstdlib(43): E2015 Ambiguity between 'ldiv_t' and 'Posix::Stdlib::ldiv_t'
Full parser context
Unit1.cpp(7): #include C:\Program Files\Embarcadero\RAD Studio\9.0\include\boost_1_39\boost\tr1\tr1\vector
vector(16): #include C:\Program Files\Embarcadero\RAD Studio\9.0\include\boost_1_39\boost/tr1/detail/config_all.hpp
config_all.hpp(48): #include c:\program files\embarcadero\rad studio\9.0\include\dinkumware\cstdlib
cstdlib(32): namespace std
从代码中:
//---------------------------------------------------------------------------
#include <fmx.h>
#pragma hdrstop
#include "Unit1.h"
#include <vector>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
Has anybody tried something as simple as #include <vector>
in an application for the Mac compiled with XE2?
Is something so basic broken in XE2 update 1 for C++ Builder or is my install broken?
Simply adding #include <vector>
to a new fire monkey HD app, I get build failures:
[BCC32 Error] cstdlib(43): E2015 Ambiguity between 'ldiv_t' and 'Posix::Stdlib::ldiv_t'
Full parser context
Unit1.cpp(7): #include C:\Program Files\Embarcadero\RAD Studio\9.0\include\boost_1_39\boost\tr1\tr1\vector
vector(16): #include C:\Program Files\Embarcadero\RAD Studio\9.0\include\boost_1_39\boost/tr1/detail/config_all.hpp
config_all.hpp(48): #include c:\program files\embarcadero\rad studio\9.0\include\dinkumware\cstdlib
cstdlib(32): namespace std
From the code:
//---------------------------------------------------------------------------
#include <fmx.h>
#pragma hdrstop
#include "Unit1.h"
#include <vector>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Embarcadero 的解决方案(仅适用于更新 2):
using _CSTD size_t;使用_CSTD div_t; using _CSTD ldiv_t;
现在可以将 STL 编译为 FMX C++ 应用程序
Solution from Embarcadero (this is for update 2 only):
using _CSTD size_t; using _CSTD div_t; using _CSTD ldiv_t;
The STL can now be compiled into an FMX C++ application
尝试从包含路径中删除 $(CG_BOOST_ROOT) 。
try removing $(CG_BOOST_ROOT) from your include paths.