Howto EXPORT_C const int..?
| Mon, 2006-03-27 13:40 | |
|
I have a Visual C++ (using Carbide.VS) problem..
This is my code, witten in a static-interface-dll: ** headerfile** namespace x { IMPORT_C extern const TInt8* const aaa; } ** cpp ** namespace x { EXPORT_C const TInt8* const aaa = (const TInt8*)("bbb"); } With the error -> error C2201: 'aaa' : must have external linkage in order to be exported/imported This is working in CodeWarrior, and I cannot see what other options I have here..? I think my code can be narrowed down to these cases -> 1) __declspec(dllexport) int bar = 42; // OK 2) extern __declspec(dllexport) const int baz; const int baz = 42; //OK 3) __declspec(dllexport) const int foo = 42; // ERROR 4) extern __declspec(dllexport) const int faz; __declspec (dllexport) const int faz = 42; // ERROR I must be able to access "aaa" both internally and externally of this dll/lib.. my current standpoint is that this is a incompatibility issue MSVC/Carbide.VS. Anyone who can prove me wrong? |
|






Forum posts: 2
This is my code, witten in a static-interface-dll:
....
I must be able to access "aaa" both internally and externally of this dll/lib.. my current standpoint is that this is a incompatibility issue MSVC/Carbide.VS.
Anyone who can prove me wrong?
I quote myself.. it was shown that it didn't work in CodeWarrior either, but no warning/error is issued. I guess the only solution to this is a complete redisign, could make a #define instead.. but that is so C..
Forum posts: 162
http://www.tanzim.co.uk