www.digitalmars.com         C & C++   DMDScript  

c++.beta - error 42 symbol undefined ...::scal_del_dtor

reply Gilles Depeyrot <gilles_depeyrot mac.com> writes:
Hi,

I have a link error concerning ??_GMYCLASS MYNAMESPACE  QAEPAXI Z (void 
*syscall MYNAMESPACE::MYCLASS::scal_del_dtor(unsigned)) for one of my 
classes when linking. The same code compiles and links fine with both 
MSVC6 and Mingw gcc.

Anything I should look for or change so that my code links with DM?

Regards,
Gilles
Dec 14 2003
parent reply "Walter" <walter digitalmars.com> writes:
Try shrinking your code to the smallest possible example and post it / email
it so I can have a look. -Walter

"Gilles Depeyrot" <gilles_depeyrot mac.com> wrote in message
news:brhrd9$24vj$1 digitaldaemon.com...
 Hi,

 I have a link error concerning ??_GMYCLASS MYNAMESPACE  QAEPAXI Z (void
 *syscall MYNAMESPACE::MYCLASS::scal_del_dtor(unsigned)) for one of my
 classes when linking. The same code compiles and links fine with both
 MSVC6 and Mingw gcc.

 Anything I should look for or change so that my code links with DM?

 Regards,
 Gilles

Dec 14 2003
parent reply Gilles Depeyrot <gilles_depeyrot mac.com> writes:
Hi,

I will try to do that but the code is rather complex including DLLs with 
classes that are imported or exported according to whether the DLLs 
define them or use them (using __declspec(dllimport) and 
__declspec(dllexport)) and templates.

I have determined that it is related to the use of both 
dllimport/dllexport and templates but I am having trouble producing a 
small test case.

I already have a difference in the code for Visual C++ versus GNU C++ 
because the template classes need to be explicitly exported for Visual 
C++. I do this using macros that export the instantiated templates for 
Visual C++:

#ifdef __GNUC__
#  define DefineScalarArray(name, element, range, export) \
       typedef MY_ScalarArray<element, range> name
#else
#  define DefineScalarArray(name, element, range, export) \
       typedef MY_ScalarArray<element, range> name; \
       template class export MY_BaseArray<element, range>; \
       template class export MY_ScalarArray<element, range>
#endif

Any chance there would be some similar problem with DigitalMars C++?

Regards,
Gilles

Walter wrote:

 Try shrinking your code to the smallest possible example and post it / email
 it so I can have a look. -Walter
 
 "Gilles Depeyrot" <gilles_depeyrot mac.com> wrote in message
 news:brhrd9$24vj$1 digitaldaemon.com...
 
Hi,

I have a link error concerning ??_GMYCLASS MYNAMESPACE  QAEPAXI Z (void
*syscall MYNAMESPACE::MYCLASS::scal_del_dtor(unsigned)) for one of my
classes when linking. The same code compiles and links fine with both
MSVC6 and Mingw gcc.

Anything I should look for or change so that my code links with DM?


Dec 15 2003
parent "Walter" <walter digitalmars.com> writes:
"Gilles Depeyrot" <gilles_depeyrot mac.com> wrote in message
news:brlbeg$19qs$1 digitaldaemon.com...
 Hi,

 I will try to do that but the code is rather complex including DLLs with
 classes that are imported or exported according to whether the DLLs
 define them or use them (using __declspec(dllimport) and
 __declspec(dllexport)) and templates.

My experience with such things, though, is no matter how complex they look, they nearly always boil down to 20 lines of code or less that shows the problem.
 Any chance there would be some similar problem with DigitalMars C++?

I don't know.
Jan 03 2004