Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


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@ErrorInfo@@UBEP6APAXXZXZ)

1>testdefine.obj : error LNK2001: unresolved external symbol "public:
virtual bool __thiscall ErrorInfo::IsA(void * (__cdecl*)(void))const "
(?IsA@ErrorInfo@@UBE_NP6APAXXZ@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@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@ErrorInfo@@UBEP6APAXXZXZ)

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

*/

 

From: LibreOffice [mailto:libreoffice-bounces@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@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@ErrorInfoX@@UBEP6APAXXZXZ)

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

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

*/

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

 


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.