which library needs to be linked to, that has implementation code for ErrorInfo::IsA

nicholas ferguson nicholasferguson at wingarch.com
Sun Sep 28 18:56:00 PDT 2014


One of these preprocessors prevented a code, below, from kicking out an
error similar to 

1>testdefine.obj : error LNK2001: unresolved external symbol "public:
virtual void * (__cdecl*__thiscall ErrorInfo::Type(void)const )(void)"
(?Type at ErrorInfo@@UBEP6APAXXZXZ)

1>testdefine.obj : error LNK2001: unresolved external symbol "public:
virtual bool __thiscall ErrorInfo::IsA(void * (__cdecl*)(void))const "
(?IsA at ErrorInfo@@UBE_NP6APAXXZ at Z)

 

Here are the preprocessors. can anyone explain which one and how?   

 

INTEL;_DEBUG;_X86_;SAL_LOG_INFO;_CRT_NONSTDC_NO_DEPRECATE;

EDITENG_DLLIMPLEMENTATION;CPPU_ENV;WNT;NOMINMAX;DBG_UTIL;_CRT_SECURE_NO_DEPR
ECATE;

WIN32;RTL_USING;BOOST_MEM_FN_ENABLE_CDECL;_WIN32_IE;_DLL;_REENTRANT;WINVER>0
x0400;S

AL_LOG_WARN;OSL_DEBUG_LEVEL;_MT;_CRT_NON_CONFORMING_SWPRINTFS;SUPD;LIBO_INTE
RNAL_ONLY

 

Essentially I searched for a module that used StringErrorInfo, and then
copied its preprocessors.and that worked.

 

//============================================

 

#include "stdafx.h"

#include <rtl/ustring.hxx>

#include <include/tools/rtti.hxx>

#include <include/tools/errinf.hxx>

int main(int argc, char* argv[])

{

                sal_uIntPtr t = 4;

                sal_uIntPtr lUserId = 4;

                sal_uInt16 nMask = 4;

                DynamicErrorInfo err(lUserId,nMask);

 

                return 0;

}

// libs  itl.lib  ( tools )

 

 

From: LibreOffice [mailto:libreoffice-bounces at lists.freedesktop.org] On
Behalf Of nicholas ferguson
Sent: Sunday, September 28, 2014 9:37 PM
To: 'libreoffice'
Subject: which library needs to be linked to, that has implementation code
for ErrorInfo::IsA

 

 

this is a better example of the error msg.  This example does not introduce
extraneous class definitions.

I assume I get unresolved externals.because  of a preprocessor directive?
This example linkes with the tools.lib (itl.lib)

 

//============================================

 

#include "stdafx.h"

#include <rtl/ustring.hxx>

#include <include/tools/rtti.hxx>

#include <include/tools/errinf.hxx>

int main(int argc, char* argv[])

{

                sal_uIntPtr t = 4;

                sal_uIntPtr lUserId = 4;

                sal_uInt16 nMask = 4;

                DynamicErrorInfo err(lUserId,nMask);

 

                return 0;

}

// libs  itl.lib  ( tools )

 

/*

error output:

1>testdefine.obj : error LNK2001: unresolved external symbol "public:
virtual void * (__cdecl*__thiscall ErrorInfo::Type(void)const )(void)"
(?Type at ErrorInfo@@UBEP6APAXXZXZ)

1>testdefine.obj : error LNK2001: unresolved external symbol "public:
virtual bool __thiscall ErrorInfo::IsA(void * (__cdecl*)(void))const "
(?IsA at ErrorInfo@@UBE_NP6APAXXZ at Z)

*/

 

From: LibreOffice [mailto:libreoffice-bounces at lists.freedesktop.org] On
Behalf Of nicholas ferguson
Sent: Sunday, September 28, 2014 9:23 PM
To: 'libreoffice'
Subject: RE: which library needs to be linked to, that has implementation
code for ErrorInfo::IsA

 

Not a library...probably a preprocessor directive?  

 

From: LibreOffice [mailto:libreoffice-bounces at lists.freedesktop.org] On
Behalf Of nicholas ferguson
Sent: Sunday, September 28, 2014 7:19 PM
To: 'libreoffice'
Subject: which library needs to be linked to, that has implementation code
for ErrorInfo::IsA

 

 

My env.  Cygwin + Visual Studio.  Windows 7

 

(1)    IsA in ErrorInfo comes from a macro in rtti.hxx

a.       /include/tools/errinfo.hxx

                                                               i.      class
ErrorInfo has as member, macro TYPEINFO() to include 5 methods, including
IsA

b.      /include/tools/rtti.hxx

                                                               i.      This
has macros, including TYPEINFO

c.       Tools/ref/errinf.cxx   ( implementation file, but does not include
implementations for five methods via TYPEINFO macro.

 

(2)    What library needs to be linked to that has  implementation code for
macros in rtti.hxx  for a Win32 Intel platform?

 

 

Here is a test code

//===========================================

#include "stdafx.h"

#include <rtl/ustring.hxx>

#include <include/tools/rtti.hxx>

 

typedef void* (*TypeId)();

class ErrorInfoX

{

private:

    sal_uIntPtr             lUserId;

public:

                            TYPEINFO();

                            ErrorInfoX( sal_uIntPtr lArgUserId ) :

                                lUserId( lArgUserId ){}

    virtual                 ~ErrorInfoX(){}

    sal_uIntPtr             GetErrorCode() const { return lUserId; }

    static ErrorInfoX*       GetErrorInfo(sal_uIntPtr);

};

int main(int argc, char* argv[])

{

                sal_uIntPtr t = 4;

                ErrorInfoX err(t);

                return 0;

}

//linked to lib(s)  itl.lib  ( tools )

 

/*

error output:

1>testdefine.obj : error LNK2001: unresolved external symbol "public:
virtual void * (__cdecl*__thiscall ErrorInfoX::Type(void)const )(void)"
(?Type at ErrorInfoX@@UBEP6APAXXZXZ)

1>testdefine.obj : error LNK2001: unresolved external symbol "public:
virtual bool __thiscall ErrorInfoX::IsA(void * (__cdecl*)(void))const "
(?IsA at ErrorInfoX@@UBE_NP6APAXXZ at Z)

1>C:\cygwin64\home\lo\Excel.Analysis\Test.OpenClose\Debug\testdefine.exe :
fatal error LNK1120: 2 unresolved externals

*/

//========================================================================

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140928/e4d89ced/attachment.html>


More information about the LibreOffice mailing list