Cosmos
جمعه 15 خرداد 1388, 19:25 عصر
دوستان من یک Namespace دارم که در آن مثل کد زیر یکسری آرایه ایستا دارم
در ++VC مشکلی نیست و اجرا میشه بدون هیچ مشکلی اما در C++ Builder 2009
موقع کامپایل گیر میدهد و میگوید:
W8058 Cannot Create pre-compiled header : initialized data in header
در فایل project.h داریم:
#include <string>
#include <iostream>
using namespace std;
namespace MyNamespace
{
enum Type { Type1=0, Type2 };
const static string TypeName[] = { "Type1", "Type2" };
const static unsigned short int TypeValue[] = { 10, 100 };
class Class1 { ... };
class Class2 { ... };
}:متفکر:
در ++VC مشکلی نیست و اجرا میشه بدون هیچ مشکلی اما در C++ Builder 2009
موقع کامپایل گیر میدهد و میگوید:
W8058 Cannot Create pre-compiled header : initialized data in header
در فایل project.h داریم:
#include <string>
#include <iostream>
using namespace std;
namespace MyNamespace
{
enum Type { Type1=0, Type2 };
const static string TypeName[] = { "Type1", "Type2" };
const static unsigned short int TypeValue[] = { 10, 100 };
class Class1 { ... };
class Class2 { ... };
}:متفکر: