NOOB QUESTION INCOMING
Does the 3.9NDK work with C++ or just C?
It works fine with both, with one caveat. In C++, the use of the struct keyword when referring to a type is deprecated. This can lead to an ambiguity (it happened to me once) where you have global variables and structures with the same name.
Somewhere in your NDK, you have:
extern struct IntuitionBase* IntuitionBase;
Now, this is isn't great. It isn't a good idea to mix up variable names and structure names.
However, in C:
IntuitionBase = (
struct IntutionBase*)OpenLibary("intuition.library", 0);
is fine. The global variable on the left of the assignment is completely distinct from the typename on the right, due to the
struct keyword.
In C++, this above use of the
struct keyword is deprecated and can cause your compiler to moan. However, removing it, can cause a problem:
IntuitionBase = (IntutionBase*)OpenLibary("intuition.library", 0); // huh?
The compiler may not know how to interpret the left hand side. Is it an incomplete reference to something?
The solution that worked for me is to disambiguate the reference by explicitly pointing out the global namespace, using the scope of resolution operator ( :: ), thus:
::IntuitionBase = (IntuitionBase*)OpenLibrary("intuition.library, 0);
Now the compiler knows you mean the global variable called IntuitionBase, and not the type name IntuitionBase.
A few of the headers may require modification to work under C++ but don't ask me which ones. They will all work under C though.
If you keep the caveat above in mind, this isn't the case.