HP aC++ Release Notes Version A.03.95 (5900-1789; September 2011)

HP aC++ Release Notes
New Features in Version A.03.33
Chapter 144
5. If an inline member function of a class is called from outside the shared library where
the class is defined and that function happens to reference another member of the same
class, you should make sure that the referenced member also is exported. Otherwise the
linker will fail to resolve.
6. Ensure that the virtual member functions of a class defined in a shared library are
exported as needed. If virtual member functions are not exported and another class
derives from this class but does not override these virtual functions, then there will be
link-time errors. See example 8 below for an example scenario.
Examples
1. In the following program, global variable glob is imported:
class Hello
{
public:
int x;
};
__declspec(dllimport) extern Hello glob;
int main() { glob.x = 10; return 0;}
2. In the following program, symbols export_me and export_me_func() will be exported; the rest of
the symbols are hidden:
__declspec(dllexport) int export_me;
int iam_hidden;
__declspec(dllexport) int export_me_func() { }
void iam_hidden_func() { }
3. In the following program, class ImportME is imported from outside the current load module:
class __declspec(dllimport) ImportME
{
public:
void print();
};
4. In the following program, only member function mem() is exported:
class Test
{
public: