Re: AW: [Acdk-developer] Compiling problem
Brought to you by:
kommer
|
From: Miroslav N. <mi...@sp...> - 2005-06-10 12:58:37
|
Dear Roger,
Can you check the attached code with the project settings? I try
your suggestions but without success. Just 1st, the 2nd I can't
understand.
When I start the same application I found the following problems:
1. System::out->println(this->getClass()->getName());
The result of this is "acdk::lang::Object".
I expect to be "NewObjects".
2. This code can't be runned:
RStringBuffer sb1 = new StringBuffer("M");
RStringBuffer sb2 = sb1->clone();
Best Regards,
Miroslav Nachev
RRK> Hi,
>> ...
RRK> ...obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
RRK> const MyClass::`vftable'{for `acdk::lang::InterfaceBase'}"
RRK> (__imp_??_7MyClass@@6BInterfaceBase@lang@acdk@@@)
>> ...
RRK> ...\include\acdk\lang\sys\refholder3inl.h(18) : warning C4541:
RRK> 'dynamic_cast' used on polymorphic type 'class acdk::lang::Object' with
RRK> /GR-; unpredictable behavior may result
>> ...
RRK> 1.
RRK> You have to enable RTTI in your compiler settings, otherwise nothing will
RRK> work - even if you eventually able to link the executable.
RRK> This aplies to all compiler on all platforms.
RRK> 2.
RRK> On Windows you have to export classes/methods from you DLL you want to use
RRK> them outside the DLL.
RRK> Create a header in your library:
RRK> #ifndef mylib_Config_h
RRK> #define mylib_Config_h
RRK> #include <acdk.h>
RRK> #if defined(IN_MYLIB_LIB)
RRK> # define ACDK_MYLIB_PUBLIC ACDK_DLL_EXPORT
RRK> #else
RRK> # define ACDK_MYLIB_PUBLIC ACDK_DLL_IMPORT
RRK> #endif
RRK> #endif //mylib_Config_h
RRK> Now for the class inside your mylib:
RRK> class ACDK_MYLIB_PUBLIC MyClass
RRK> : extends acdk::lang::Object
RRK> {
RRK> // ...
RRK> };
RRK> In the compiler settings for the mylib.dll project you have to define
RRK> IN_MYLIB_LIB.
RRK> In the compiler settings for the executable, which make use of mylib.dll,
RRK> you don't need to define this symbol.
RRK> Hope this helps,
RRK> Roger Rene Kommer
RRK> -----Ursprüngliche Nachricht-----
RRK> Von: acd...@li...
RRK> [mailto:acd...@li...] Im Auftrag von Miroslav
RRK> Nachev
RRK> Gesendet: Donnerstag, 9. Juni 2005 12:37
RRK> An: acd...@li...
RRK> Betreff: [Acdk-developer] Compiling problem
RRK> Hi,
RRK> Yesterday everything works OK, but today without any changes I have the
RRK> following errors:
RRK> ...obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
RRK> const MyClass::`vftable'{for `acdk::lang::InterfaceBase'}"
RRK> (__imp_??_7MyClass@@6BInterfaceBase@lang@acdk@@@)
RRK> ...obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
RRK> const MyClass::`vftable'" (__imp_??_7MyClass@@6B@) ...obj : error LNK2001:
RRK> unresolved external symbol "__declspec(dllimport) const
RRK> MyClass::`vftable'{for `acdk::lang::ObjectBase'}"
RRK> (__imp_??_7MyClass@@6BObjectBase@lang@acdk@@@)
RRK> ...obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
RRK> const MyClass::`vbtable'" (__imp_??_8MyClass@@7B@) ...obj : error LNK2001:
RRK> unresolved external symbol "__declspec(dllimport) public: void __thiscall
RRK> MyClass::`vbase destructor'(void)" (__imp_??_DMyClass@@QAEXXZ)
RRK> Debug/acdktest1.exe : fatal error LNK1120: 5 unresolved externals Error
RRK> executing link.exe.
RRK> acdktest1.exe - 6 error(s), 413 warning(s)
RRK> Also I have too many warning like this:
RRK> ...\include\acdk\lang\sys\heapframe.h(108) : warning C4251: '_top' : class
RRK> 'SysRefHolder<class acdk::lang::sys::HeapFrame>' needs to have dll-interface
RRK> to be used by clients of class 'acdk::lang::sys::HeapFrame'
RRK> ...\include\acdk\lang\sys\heapframe.h(109) : warning C4251: '_name' : class
RRK> 'acdk::lang::sys::core_string' needs to have dll-interface to be used by
RRK> clients of class 'acdk::lang::sys::HeapFrame'
RRK> ...\include\acdk\lang\sys\core_string.h(39) : see declaration of
RRK> 'core_string'
RRK> ...\include\acdk\lang\sys\allocator.h(97) : warning C4251: 'name' : class
RRK> 'acdk::lang::sys::core_string' needs to have dll-interface to be used by
RRK> clients of class 'acdk::lang::sys::AllocatorInfo'
RRK> ...\include\acdk\lang\dmi\metainfo.h(194) : warning C4800: 'int' : forcing
RRK> value to bool 'true' or 'false' (performance warning)
RRK> ...\include\acdk\lang\sys\refholder3inl.h(18) : warning C4541:
RRK> 'dynamic_cast' used on polymorphic type 'class acdk::lang::Object' with
RRK> /GR-; unpredictable behavior may result
RRK> ...\include\acdk\lang\sys\refholder3inl.h(67) : see reference to function
RRK> template instantiation 'class acdk::lang::String *__cdecl dmi_cast(class
RRK> acdk::lang::ObjectBase *)' being compiled
RRK> Any help?
RRK> Best Regards,
RRK> Miroslav Nachev
RRK> -------------------------------------------------------
RRK> This SF.Net email is sponsored by: NEC IT Guy Games. How far can you
RRK> shotput a projector? How fast can you ride your desk chair down the office
RRK> luge track?
RRK> If you want to score the big prize, get to know the little guy.
RRK> Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
RRK> _______________________________________________
RRK> Acdk-developer mailing list
RRK> Acd...@li...
RRK> https://lists.sourceforge.net/lists/listinfo/acdk-developer
RRK> -------------------------------------------------------
RRK> This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
RRK> a projector? How fast can you ride your desk chair down the office luge track?
RRK> If you want to score the big prize, get to know the little guy.
RRK> Play to win an NEC 61" plasma display: http://www.necitguy.com/?r
RRK> _______________________________________________
RRK> Acdk-developer mailing list
RRK> Acd...@li...
RRK> https://lists.sourceforge.net/lists/listinfo/acdk-developer |