|
![](/i/fill.gif) |
On 16/05/2013 08:39 AM, Orchid Win7 v1 wrote:
>>> class PrivateClass;
>>
>>> class MyClass
>>> {
>>> std::shared_ptr<PrivateClass> privateObject;
>>> };
>
> OK. That seems easy enough.
I entered this into VisualStudio, and it worked great.
However, when I tried to compile it under Linux, GCC refused to accept it.
First, VS seems to somehow allow you to compile things even without
actually importing the necessary include files. (E.g., it will happily
accept std::shared_ptr even though I didn't #include <memory>.) GCC
demands that you actually specify the include files [like you'd expect].
Weird, but true.
Second, it seems this "feature" only exists in C++11. I don't know what
GCC is defaulting to, but apparently you have to add a switch to tell it
to accept C++11. And when I do that, my code compiles perfectly, but the
rest of the codebase breaks spectacularly.
So, in summary, I had to revert everything back to how it was. *sigh*
Post a reply to this message
|
![](/i/fill.gif) |