You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Jean-Denis Muys <jd...@mac.com> on 2010/05/07 04:00:57 UTC

link error in release mode with Visual Studio 2008

Hi,

I have a Visual Studio 2008 project using log4cxx that links (and runs) fine in Debug mode using the Debug version of log4cxx, but fails to link in Release mode using the release version of log4cxx. Here are the 13 undefined symbols:


1>------ Build started: Project: RepliKator04, Configuration: Release Win32 ------
1>Linking...
1>   Creating library z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib and object z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getDebug(void)" (__imp_?getDebug@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getInfo(void)" (__imp_?getInfo@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getWarn(void)" (__imp_?getWarn@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getError(void)" (__imp_?getError@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
1>4DPlugin.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __stdcall log4cxx::Logger::getRootLogger(void)" (__imp_?getRootLogger@Logger@log4cxx@@SG?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@2@XZ)
1>4DPlugin.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __stdcall log4cxx::Logger::getLogger(char const * const)" (__imp_?getLogger@Logger@log4cxx@@SG?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@2@QBD@Z)
1>4DPlugin.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __stdcall log4cxx::BasicConfigurator::configure(void)" (__imp_?configure@BasicConfigurator@log4cxx@@SGXXZ)
1>4DPlugin.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __stdcall log4cxx::PropertyConfigurator::configure(class log4cxx::File const &)" (__imp_?configure@PropertyConfigurator@log4cxx@@SGXABVFile@2@@Z)
1>RKReplikator.connection.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getOff(void)" (__imp_?getOff@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
1>RKReplikator.connection.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getFatal(void)" (__imp_?getFatal@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
1>RKReplikator.connection.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __stdcall log4cxx::Logger::getLogger(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?getLogger@Logger@log4cxx@@SG?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.4DX : fatal error LNK1120: 13 unresolved externals
1>Build log was saved at "file://Z:\PCdev\RepliKator2004\Objs\Release\BuildLog.htm"
1>RepliKator04 - 13 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


As I am a Mac developer, not a Windows developer, I feel lost here. What can I do to fix that issue? I really don't get why those symbols would not be defined in Release mode.

Note that my project is not an application, but a Plugin for a third party app.
I link against the DLL version of log4cxx. I'd rather use a static library version, but I failed to build it so, and I could not find detailed instructions on the net to do it.

So for the time being, I am mainly interested in understanding why these link-time errors occur, and in how to fix them.

Thanks and regards.

Jean-Denis


Re: log4cxx 0.10.1 release plan (Re: link error in release mode with Visual Studio 2008 on log4cxx-user)

Posted by George Morgan <gm...@gmail.com>.
I for one was wondering if LOG4CXX-102-1 patch was going to make it
into the next release?  I'm currently using this patch so I can use
properties file based triggering and rolling policies.  There are some
other changes to LOG4CXX that I'm using right now but I have to work
out the details with work to see if I can release them under a
suitable license so they can be included...

On Wed, May 12, 2010 at 12:38 AM, Curt Arnold <ca...@apache.org> wrote:
>
> On May 10, 2010, at 8:44 AM, Reynolds, John wrote:
>
>> Good to see you back Curt. Any dates on next release?
>>
>> I meant what executable format ( looked it up, it is Mach-O ). I knew it wasn't ELF even though it does use the FreeBSD tools.
>>
>
> I've just logged http://issues.apache.org/jira/browse/LOGCXX-363 for a subsequent release.  If there are bugs that really should be addressed before a release, mark it as a blocker on LOGCXX-363.  If there are any bugs that you believe that you think are ready to go, please mention them on the list.   Making VS 2010 happy would be one of them.
>
> I had really good intentions to work a log4cxx release as soon as I got through log4j 1.2.16, but that took much longer than I expected and there are still some aftermath issues that need to be cleaned up.
>
> Any help on prioritizing or checking the bug reports would be appreciated.
>
>



-- 
George Morgan

Re: log4cxx 0.10.1 release plan (Re: link error in release mode with Visual Studio 2008 on log4cxx-user)

Posted by Scott Deboy <sc...@gmail.com>.
A new Chainsaw release with a lot of new features will be released in  
the near future. You can pull the source down and build with maven if  
you'd like to try it today.

Annotated logs, multirow events, highlighting of search matches in the  
table, better multicast Dns support and more. See the chainsaw release  
notes in the help menu for a list of everything.

Scott

On May 12, 2010, at 8:07 AM, Dale King <da...@gmail.com> wrote:

> I appreciate your work on this, but the thing that desperately needs  
> a new release is Chainsaw! It has been over 4 years since it has  
> been released. The current release is based on the abandoned 1.3  
> branch of Log4J so there are several things that do not work with  
> the current versions of Log4J and Log4Cxx.
>
> On Wed, May 12, 2010 at 12:39 AM, Curt Arnold <ca...@apache.org>  
> wrote:
> Cross posting on log4cxx-user since the question was asked there.   
> Followup discussion should be on log4cxx-dev.
>
> Begin forwarded message:
>
> > From: Curt Arnold <ca...@apache.org>
> > Date: May 11, 2010 11:38:19 PM CDT
> > To: Log4CXX Dev <lo...@logging.apache.org>
> > Subject: log4cxx 0.10.1 release plan (Re: link error in release  
> mode with Visual Studio 2008 on log4cxx-user)
> >
> >
> > On May 10, 2010, at 8:44 AM, Reynolds, John wrote:
> >
> >> Good to see you back Curt. Any dates on next release?
> >>
> >> I meant what executable format ( looked it up, it is Mach-O ). I  
> knew it wasn't ELF even though it does use the FreeBSD tools.
> >>
> >
> > I've just logged http://issues.apache.org/jira/browse/LOGCXX-363  
> for a subsequent release.  If there are bugs that really should be  
> addressed before a release, mark it as a blocker on LOGCXX-363.  If  
> there are any bugs that you believe that you think are ready to go,  
> please mention them on the list.   Making VS 2010 happy would be one  
> of them.
> >
> > I had really good intentions to work a log4cxx release as soon as  
> I got through log4j 1.2.16, but that took much longer than I  
> expected and there are still some aftermath issues that need to be  
> cleaned up.
> >
> > Any help on prioritizing or checking the bug reports would be  
> appreciated.
> >
>
>
>
>
> -- 
> Dale King
>

Re: log4cxx 0.10.1 release plan (Re: link error in release mode with Visual Studio 2008 on log4cxx-user)

Posted by Dale King <da...@gmail.com>.
I appreciate your work on this, but the thing that desperately needs a new
release is Chainsaw! It has been over 4 years since it has been released.
The current release is based on the abandoned 1.3 branch of Log4J so there
are several things that do not work with the current versions of Log4J and
Log4Cxx.

On Wed, May 12, 2010 at 12:39 AM, Curt Arnold <ca...@apache.org> wrote:

> Cross posting on log4cxx-user since the question was asked there.  Followup
> discussion should be on log4cxx-dev.
>
> Begin forwarded message:
>
> > From: Curt Arnold <ca...@apache.org>
> > Date: May 11, 2010 11:38:19 PM CDT
> > To: Log4CXX Dev <lo...@logging.apache.org>
> > Subject: log4cxx 0.10.1 release plan (Re: link error in release mode with
> Visual Studio 2008 on log4cxx-user)
> >
> >
> > On May 10, 2010, at 8:44 AM, Reynolds, John wrote:
> >
> >> Good to see you back Curt. Any dates on next release?
> >>
> >> I meant what executable format ( looked it up, it is Mach-O ). I knew it
> wasn't ELF even though it does use the FreeBSD tools.
> >>
> >
> > I've just logged http://issues.apache.org/jira/browse/LOGCXX-363 for a
> subsequent release.  If there are bugs that really should be addressed
> before a release, mark it as a blocker on LOGCXX-363.  If there are any bugs
> that you believe that you think are ready to go, please mention them on the
> list.   Making VS 2010 happy would be one of them.
> >
> > I had really good intentions to work a log4cxx release as soon as I got
> through log4j 1.2.16, but that took much longer than I expected and there
> are still some aftermath issues that need to be cleaned up.
> >
> > Any help on prioritizing or checking the bug reports would be
> appreciated.
> >
>
>


-- 
Dale King

Fwd: log4cxx 0.10.1 release plan (Re: link error in release mode with Visual Studio 2008 on log4cxx-user)

Posted by Curt Arnold <ca...@apache.org>.
Cross posting on log4cxx-user since the question was asked there.  Followup discussion should be on log4cxx-dev.

Begin forwarded message:

> From: Curt Arnold <ca...@apache.org>
> Date: May 11, 2010 11:38:19 PM CDT
> To: Log4CXX Dev <lo...@logging.apache.org>
> Subject: log4cxx 0.10.1 release plan (Re: link error in release mode with Visual Studio 2008 on log4cxx-user)
> 
> 
> On May 10, 2010, at 8:44 AM, Reynolds, John wrote:
> 
>> Good to see you back Curt. Any dates on next release?
>> 
>> I meant what executable format ( looked it up, it is Mach-O ). I knew it wasn't ELF even though it does use the FreeBSD tools.
>> 
> 
> I've just logged http://issues.apache.org/jira/browse/LOGCXX-363 for a subsequent release.  If there are bugs that really should be addressed before a release, mark it as a blocker on LOGCXX-363.  If there are any bugs that you believe that you think are ready to go, please mention them on the list.   Making VS 2010 happy would be one of them.
> 
> I had really good intentions to work a log4cxx release as soon as I got through log4j 1.2.16, but that took much longer than I expected and there are still some aftermath issues that need to be cleaned up.
> 
> Any help on prioritizing or checking the bug reports would be appreciated.
> 


log4cxx 0.10.1 release plan (Re: link error in release mode with Visual Studio 2008 on log4cxx-user)

Posted by Curt Arnold <ca...@apache.org>.
On May 10, 2010, at 8:44 AM, Reynolds, John wrote:

> Good to see you back Curt. Any dates on next release?
> 
> I meant what executable format ( looked it up, it is Mach-O ). I knew it wasn't ELF even though it does use the FreeBSD tools.
> 

I've just logged http://issues.apache.org/jira/browse/LOGCXX-363 for a subsequent release.  If there are bugs that really should be addressed before a release, mark it as a blocker on LOGCXX-363.  If there are any bugs that you believe that you think are ready to go, please mention them on the list.   Making VS 2010 happy would be one of them.

I had really good intentions to work a log4cxx release as soon as I got through log4j 1.2.16, but that took much longer than I expected and there are still some aftermath issues that need to be cleaned up.

Any help on prioritizing or checking the bug reports would be appreciated.


RE: link error in release mode with Visual Studio 2008

Posted by "Reynolds, John" <Jo...@flightman.com>.
Good to see you back Curt. Any dates on next release?

I meant what executable format ( looked it up, it is Mach-O ). I knew it wasn't ELF even though it does use the FreeBSD tools.


 > -----Original Message-----
> From: Curt Arnold [mailto:curt.arnld@gmail.com] On Behalf Of Curt Arnold
> Sent: 10 May 2010 14:34
> To: Log4CXX User
> Subject: Re: link error in release mode with Visual Studio 2008
> 
> 
> On May 10, 2010, at 4:52 AM, Reynolds, John wrote:
> 
> > As he is new to programming on windows, I suggested ant as it takes the
> build of log4cxx out of the Visual Studio as what he has built is corrupt
> in someway. It also enforces a clean build.
> > Better to start in small steps. Build the DLL and then in Visual Studio
> setup a new clean project for his application.
> >
> > Things like __declspec are a pain to understand to people coming to it
> from a platform like ELF ( no idea what Darwin is ).
> >
> > The first line of this link explains the fact that a lib file can be for
> a static or DLL library.  http://msdn.microsoft.com/en-
> us/library/a90k134d%28VS.80%29.aspx
> 
> Thanks everybody for helping out.  Encouraging to see the traffic though I
> have been distracted.
> 
> Darwin is the open-sourced kernel that Mac OS/X is built upon.

Re: link error in release mode with Visual Studio 2008

Posted by Curt Arnold <ca...@apache.org>.
On May 10, 2010, at 4:52 AM, Reynolds, John wrote:

> As he is new to programming on windows, I suggested ant as it takes the build of log4cxx out of the Visual Studio as what he has built is corrupt in someway. It also enforces a clean build.
> Better to start in small steps. Build the DLL and then in Visual Studio setup a new clean project for his application.
>  
> Things like __declspec are a pain to understand to people coming to it from a platform like ELF ( no idea what Darwin is ).
>  
> The first line of this link explains the fact that a lib file can be for a static or DLL library.  http://msdn.microsoft.com/en-us/library/a90k134d%28VS.80%29.aspx

Thanks everybody for helping out.  Encouraging to see the traffic though I have been distracted.

Darwin is the open-sourced kernel that Mac OS/X is built upon.

RE: link error in release mode with Visual Studio 2008

Posted by "Reynolds, John" <Jo...@flightman.com>.
As he is new to programming on windows, I suggested ant as it takes the build of log4cxx out of the Visual Studio as what he has built is corrupt in someway. It also enforces a clean build.
Better to start in small steps. Build the DLL and then in Visual Studio setup a new clean project for his application.

Things like __declspec are a pain to understand to people coming to it from a platform like ELF ( no idea what Darwin is ).

The first line of this link explains the fact that a lib file can be for a static or DLL library.  http://msdn.microsoft.com/en-us/library/a90k134d%28VS.80%29.aspx



________________________________
From: David B Grigsby [mailto:dgrigsby@yahoo-inc.com]
Sent: 07 May 2010 19:54
To: Log4CXX User
Subject: RE: link error in release mode with Visual Studio 2008

I suspect something about the VC release mode linker settings in the client project.

But for the library build, make sure the LOG4CXX_EXPORT stuff (preprocessor symbol) is setup the same in debug and release mode.

I agree I don't see how ant would be relevant.

When you figure it out, let us know what the problem was!

dg

________________________________
From: Fabian Jacquet [mailto:fabian.jacquet@gmail.com]
Sent: Friday, May 07, 2010 6:58 AM
To: Log4CXX User
Subject: Re: link error in release mode with Visual Studio 2008

Have you tried to recompile all from clean?
Maybe the release lib is corrupted...
On Fri, May 7, 2010 at 15:47, Jean-Denis Muys <jd...@mac.com>> wrote:
I downloaded the source code from the links at http://logging.apache.org/log4cxx/download.html
I simply compiled it following the instructions at http://logging.apache.org/log4cxx/building/vstudio.html

I had no error doing so.

I tried to track down one of those missing symbols, namely "getLogger(char const * const)".
I found the implementation LoggerPtr Logger::getLogger(const char* const name) in the file logger.cpp. Notice the difference between the parameter signature (char const * const vs const char* const).
It is declared in logger.h in a class that is declared:
class LOG4CXX_EXPORT Logger : ...

so it is controlled by the LOG4CXX_EXPORT macro that you described.

I am totally at loss. The source code looks fine. Everything compiles fine in both mode. The library links fine in both mode. The client code compiles fine in both modes. The client code links and runs fine in Debug mode, but fails to link in Release mode.

I am now trying to rebuild the log4cxx.lib library using the linker verbose mode in the hope of seeing those symbols in the output somehow. But then, I don't know what I can do next, whether or not they do show up.

Jean-Denis.


On May 7, 2010, at 15:26 , Fabian Jacquet wrote:

<venting frustration>
Why my boss don't want I develop for MacOS X ? :-)
</venting frustration>

The class déclaration must be __declspec(export) when you compile the dll and must be __declspec(import) when you include .h from this dll. So it's correct in your error message.
It's possible that the missing symbols declarations didn't have __declspec(export) when you compiled log4cxx.dll

Did you take sources from SVN? I compiled the source downloaded from the web site with VisualStudio 2008 without any problem.
On Fri, May 7, 2010 at 14:12, Jean-Denis Muys <jd...@mac.com>> wrote:
When setting the linker verbose, it indeed reports that it is searching log4cxx.lib.
When setting fully verbose, it even reports *finding* symbols in log4cxx.lib with the file that references them.
So indeed, the linker finds log4cxx.lib AND manages to find some of the symbols I use.
Also, it seems that all the found symbols have a __thiscall declaration, while all the ones that are *not* found have a __stdcall declaration.

I have no idea whether this has any significance.

regarding the __declspec thing, I noticed that the linker says the symbols it cannot find are __declspec(import), not __declspec(export). What are the differences between these two? Could it be that the "export" variations are in the log4cxx.lib file but cannot be matched to the "import" variation it's looking for?

<venting frustration>
Why is the Windows platform so poorly designed? None of those charades are necessary on the BSD architecture that MacOS X is built upon!
</venting frustration>

I am not sure what I can do next. I'll try to look for those symbols in the log4cxx source to check their declarations.

Jean-Denis



On May 7, 2010, at 12:02 , Fabian Jacquet wrote:

Mh, maybe those symbols are in the DLL but not in the lib. To be in the lib, it must have __declspec(dllexport) when compiling.
log4cxx use this define to do this:
#if defined(LOG4CXX_STATIC)
#define LOG4CXX_EXPORT
//   definitions used when building DLL
#elif defined(LOG4CXX)
#define LOG4CXX_EXPORT __declspec(dllexport)
#else
//    definitions used when using DLL
#define LOG4CXX_EXPORT __declspec(dllimport)
#endif

So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
and
"LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your project.

If for some reason, LOG4CXX_STATIC is defined, it's possible that some symbols are not exported. But I don't know how it's possible.

If you don't use more than those 13 symbols maybe nothing is exported or maybe the link don't use log4cxx.lib.
You can check the list of lib used by the linker like this:
Project properties>Linker>General>Show Progress = /VERBOSE:LIB
The linker will dump the lib list in the output window of visual studio when compiling. Check that you have something like that:
1>    Searching [your directories]\log4cxx.lib:

I don't know any tools to check symbols. I think you could check with notepad, you can search about "getLogger" by example but if you find it, I don't know if you can conclude that the symbol is right exported. If you don't find it, I think the problem comes from the lib :-)
On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com>> wrote:
Thanks for answering. I wish the solution was that simple. I apologize for not explicitly mentioning it, but my project is - I think - set up correctly.

That is:

- both the Debug and Release configurations mention log4cxx.lib in its Linker>Input>Additional Dependencies
- both the Debug and Release configurations mention a *different* directory in Linker>General>Additional Library Directories. They are different because they point to the Debug version and the Relase version of loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug and apache-log4cxx-0.10.0\projects\Release)


Of course both configurations of log4cxx were previously built with no failure (from its Visual Studio project). They were built in "DLL" mode as explained on the log4cxx web site. While doing a static library version is on my todo list, I'd rather solve the present issue first.

At this point in time, I suppose the 13 missing symbols are present in the Debug version of the log4cxx.lib stub library, but not in the Release version. How can I verify this hypothesis? What could explain that? How can I fix it?

Another hypothesis might be that there is yet another dependency that needs to be set in Release mode only. This seems less plausible though. And what would it be?

Again, thanks for you answer. Any other idea on how I could make progress on this issue?

Regards,

Jean-Denis


On May 7, 2010, at 10:29 , Fabian Jacquet wrote:

Hi,

The project configuration is different between debug and release. In debug you certainly added log4cxx.lib in the field "Linker/Input/Additional dependencies" but you have a drop-down which select the configuration, if you switch to release, I think you don't have log4cxx.lib in "Additional dependencies" .

Don't forget to add the directory of this lib in the field "Linker/General/Additional Library Directories"

log4cxx.lib is not really a static lib. It's only the interface to the dll class and functions.

I hope it help you.
On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com>> wrote:
Hi,

I have a Visual Studio 2008 project using log4cxx that links (and runs) fine in Debug mode using the Debug version of log4cxx, but fails to link in Release mode using the release version of log4cxx. Here are the 13 undefined symbols:


1>------ Build started: Project: RepliKator04, Configuration: Release Win32 ------
1>Linking...
1>   Creating library z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib and object z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
[...]
1>RepliKator04 - 13 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


As I am a Mac developer, not a Windows developer, I feel lost here. What can I do to fix that issue? I really don't get why those symbols would not be defined in Release mode.

Note that my project is not an application, but a Plugin for a third party app.
I link against the DLL version of log4cxx. I'd rather use a static library version, but I failed to build it so, and I could not find detailed instructions on the net to do it.

So for the time being, I am mainly interested in understanding why these link-time errors occur, and in how to fix them.

Thanks and regards.

Jean-Denis








RE: link error in release mode with Visual Studio 2008

Posted by David B Grigsby <dg...@yahoo-inc.com>.
I suspect something about the VC release mode linker settings in the client project.

 

But for the library build, make sure the LOG4CXX_EXPORT stuff (preprocessor symbol) is setup the same in debug and release mode.

 

I agree I don't see how ant would be relevant.

 

When you figure it out, let us know what the problem was!

 

dg

 

________________________________

From: Fabian Jacquet [mailto:fabian.jacquet@gmail.com] 
Sent: Friday, May 07, 2010 6:58 AM
To: Log4CXX User
Subject: Re: link error in release mode with Visual Studio 2008

 

Have you tried to recompile all from clean?
Maybe the release lib is corrupted...



On Fri, May 7, 2010 at 15:47, Jean-Denis Muys <jd...@mac.com> wrote:

I downloaded the source code from the links at http://logging.apache.org/log4cxx/download.html

I simply compiled it following the instructions at http://logging.apache.org/log4cxx/building/vstudio.html

 

I had no error doing so.

 

I tried to track down one of those missing symbols, namely "getLogger(char const * const)".

I found the implementation LoggerPtr Logger::getLogger(const char* const name) in the file logger.cpp. Notice the difference between the parameter signature (char const * const vs const char* const).

It is declared in logger.h in a class that is declared:

class LOG4CXX_EXPORT Logger : ...

 

so it is controlled by the LOG4CXX_EXPORT macro that you described.

 

I am totally at loss. The source code looks fine. Everything compiles fine in both mode. The library links fine in both mode. The client code compiles fine in both modes. The client code links and runs fine in Debug mode, but fails to link in Release mode.

 

I am now trying to rebuild the log4cxx.lib library using the linker verbose mode in the hope of seeing those symbols in the output somehow. But then, I don't know what I can do next, whether or not they do show up.

 

Jean-Denis.

 

 

On May 7, 2010, at 15:26 , Fabian Jacquet wrote:





<venting frustration>

Why my boss don't want I develop for MacOS X ? :-)

</venting frustration>


The class déclaration must be __declspec(export) when you compile the dll and must be __declspec(import) when you include .h from this dll. So it's correct in your error message.
It's possible that the missing symbols declarations didn't have __declspec(export) when you compiled log4cxx.dll

Did you take sources from SVN? I compiled the source downloaded from the web site with VisualStudio 2008 without any problem.



On Fri, May 7, 2010 at 14:12, Jean-Denis Muys <jd...@mac.com> wrote:

When setting the linker verbose, it indeed reports that it is searching log4cxx.lib.

When setting fully verbose, it even reports *finding* symbols in log4cxx.lib with the file that references them.

So indeed, the linker finds log4cxx.lib AND manages to find some of the symbols I use.

Also, it seems that all the found symbols have a __thiscall declaration, while all the ones that are *not* found have a __stdcall declaration.

 

I have no idea whether this has any significance.

 

regarding the __declspec thing, I noticed that the linker says the symbols it cannot find are __declspec(import), not __declspec(export). What are the differences between these two? Could it be that the "export" variations are in the log4cxx.lib file but cannot be matched to the "import" variation it's looking for?

 

<venting frustration>

Why is the Windows platform so poorly designed? None of those charades are necessary on the BSD architecture that MacOS X is built upon!

</venting frustration>

 

I am not sure what I can do next. I'll try to look for those symbols in the log4cxx source to check their declarations.

 

Jean-Denis

 

 

 

On May 7, 2010, at 12:02 , Fabian Jacquet wrote:





Mh, maybe those symbols are in the DLL but not in the lib. To be in the lib, it must have __declspec(dllexport) when compiling.
log4cxx use this define to do this:
#if defined(LOG4CXX_STATIC)
#define LOG4CXX_EXPORT
//   definitions used when building DLL
#elif defined(LOG4CXX)
#define LOG4CXX_EXPORT __declspec(dllexport)
#else
//    definitions used when using DLL
#define LOG4CXX_EXPORT __declspec(dllimport)
#endif

So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
and
"LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your project.

If for some reason, LOG4CXX_STATIC is defined, it's possible that some symbols are not exported. But I don't know how it's possible.

If you don't use more than those 13 symbols maybe nothing is exported or maybe the link don't use log4cxx.lib.
You can check the list of lib used by the linker like this:
Project properties>Linker>General>Show Progress = /VERBOSE:LIB
The linker will dump the lib list in the output window of visual studio when compiling. Check that you have something like that:
1>    Searching [your directories]\log4cxx.lib:

I don't know any tools to check symbols. I think you could check with notepad, you can search about "getLogger" by example but if you find it, I don't know if you can conclude that the symbol is right exported. If you don't find it, I think the problem comes from the lib :-)

On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com> wrote:

Thanks for answering. I wish the solution was that simple. I apologize for not explicitly mentioning it, but my project is - I think - set up correctly.

 

That is:

 

- both the Debug and Release configurations mention log4cxx.lib in its Linker>Input>Additional Dependencies

- both the Debug and Release configurations mention a *different* directory in Linker>General>Additional Library Directories. They are different because they point to the Debug version and the Relase version of loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug and apache-log4cxx-0.10.0\projects\Release)

 

 

Of course both configurations of log4cxx were previously built with no failure (from its Visual Studio project). They were built in "DLL" mode as explained on the log4cxx web site. While doing a static library version is on my todo list, I'd rather solve the present issue first.

 

At this point in time, I suppose the 13 missing symbols are present in the Debug version of the log4cxx.lib stub library, but not in the Release version. How can I verify this hypothesis? What could explain that? How can I fix it?

 

Another hypothesis might be that there is yet another dependency that needs to be set in Release mode only. This seems less plausible though. And what would it be?

 

Again, thanks for you answer. Any other idea on how I could make progress on this issue?

 

Regards,

 

Jean-Denis

 

 

On May 7, 2010, at 10:29 , Fabian Jacquet wrote:

 

	Hi,
	
	The project configuration is different between debug and release. In debug you certainly added log4cxx.lib in the field "Linker/Input/Additional dependencies" but you have a drop-down which select the configuration, if you switch to release, I think you don't have log4cxx.lib in "Additional dependencies" .
	
	Don't forget to add the directory of this lib in the field "Linker/General/Additional Library Directories"
	
	log4cxx.lib is not really a static lib. It's only the interface to the dll class and functions.
	
	I hope it help you.

	On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com> wrote:

		Hi,
		
		I have a Visual Studio 2008 project using log4cxx that links (and runs) fine in Debug mode using the Debug version of log4cxx, but fails to link in Release mode using the release version of log4cxx. Here are the 13 undefined symbols:
		
		
		1>------ Build started: Project: RepliKator04, Configuration: Release Win32 ------
		1>Linking...
		1>   Creating library z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib and object z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
		1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
		[...]

		1>RepliKator04 - 13 error(s), 0 warning(s)
		========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
		
		
		As I am a Mac developer, not a Windows developer, I feel lost here. What can I do to fix that issue? I really don't get why those symbols would not be defined in Release mode.
		
		Note that my project is not an application, but a Plugin for a third party app.
		I link against the DLL version of log4cxx. I'd rather use a static library version, but I failed to build it so, and I could not find detailed instructions on the net to do it.
		
		So for the time being, I am mainly interested in understanding why these link-time errors occur, and in how to fix them.
		
		Thanks and regards.
		
		Jean-Denis

	 

 

 

 

 

 

 


RE: link error in release mode with Visual Studio 2008

Posted by "Reynolds, John" <Jo...@flightman.com>.
That should be a static lib only results in a lib, duh!


________________________________
From: Reynolds, John [mailto:John.Reynolds@flightman.com]
Sent: 07 May 2010 17:16
To: Log4CXX User
Subject: RE: link error in release mode with Visual Studio 2008

I suggest building the log4cxx.dll via ant as you only have do it once ( twice if you want a release and debug version ) and you can set the correct paths to the dll and header files in the VS project setting for your client project build configuration. Personally I very rarely use application VS, just the command line.

First you need ant ( hence you need java ) and the cpptasks jar, see the first option  http://logging.apache.org/log4cxx/building/ant.html (packaged APR and APR-Util, it builds in static versions of these into the dll ). The resultant dll should be in src/target/<configuration>/shared, where configuration is release or debug.

Then open the VS command prompt ( ensuring java and ant are in your PATH ) by clicking Start > Programs > Microsoft Visual XXX ( Studio C++ whatever ) > Visual Studio Tools > Visual Studio XXX Command Prompt ( what I called the shell, I recommend pinning this to your start menu for easy access ). This invokes a number of batch files to correctly set up the command line to run the complier and linker.

As an aside, I believe a lib can be a static library or a stub containing the entry points for a dll, both are different but can wind up have the same name as it is the linker that uses them to create the finished application.
So building a shared library will result in a dll and lib, a static lib only results in a dll. Then again I could be wrong, I have not built a static lib on Win32 in years.



________________________________
From: Jean-Denis Muys [mailto:jdmuys@mac.com]
Sent: 07 May 2010 16:48
To: Log4CXX User
Subject: Re: link error in release mode with Visual Studio 2008

John,

Thanks for chiming in.

Unfortunately, I think I don't understand your suggestion.

Are you suggesting that I build log4cxx [Debug|Release] using ant?
Or are you suggesting that I build my client program with ant?
Or both?

In either case, why do you think ant could help with the issue I have? Why would executing the linker from ant alleviate the "symbol not found" issues I have?

Finally, *how* would I go about doing what you suggest? How do you run ant from the VS Shell?

I'm sorry if I sound like a newbie. This is because I *am* a newbie on Windows. I am by experience a Mac developer.

Regards,

Jean-Denis


On May 7, 2010, at 17:40 , Reynolds, John wrote:

I use the ant build system from the VS shell.
In the source directory run ant for a release build or ant -Ddebug=true for a debug build


________________________________
From: Jean-Denis Muys [mailto:jdmuys@mac.com]
Sent: 07 May 2010 16:11
To: Log4CXX User
Subject: Re: link error in release mode with Visual Studio 2008

yep. no change.

On May 7, 2010, at 15:57 , Fabian Jacquet wrote:


Have you tried to recompile all from clean?
Maybe the release lib is corrupted...

On Fri, May 7, 2010 at 15:47, Jean-Denis Muys <jd...@mac.com>> wrote:
I downloaded the source code from the links at http://logging.apache.org/log4cxx/download.html
I simply compiled it following the instructions at http://logging.apache.org/log4cxx/building/vstudio.html

I had no error doing so.

I tried to track down one of those missing symbols, namely "getLogger(char const * const)".
I found the implementation LoggerPtr Logger::getLogger(const char* const name) in the file logger.cpp. Notice the difference between the parameter signature (char const * const vs const char* const).
It is declared in logger.h in a class that is declared:
class LOG4CXX_EXPORT Logger : ...

so it is controlled by the LOG4CXX_EXPORT macro that you described.

I am totally at loss. The source code looks fine. Everything compiles fine in both mode. The library links fine in both mode. The client code compiles fine in both modes. The client code links and runs fine in Debug mode, but fails to link in Release mode.

I am now trying to rebuild the log4cxx.lib library using the linker verbose mode in the hope of seeing those symbols in the output somehow. But then, I don't know what I can do next, whether or not they do show up.

Jean-Denis.


On May 7, 2010, at 15:26 , Fabian Jacquet wrote:


<venting frustration>
Why my boss don't want I develop for MacOS X ? :-)
</venting frustration>

The class déclaration must be __declspec(export) when you compile the dll and must be __declspec(import) when you include .h from this dll. So it's correct in your error message.
It's possible that the missing symbols declarations didn't have __declspec(export) when you compiled log4cxx.dll

Did you take sources from SVN? I compiled the source downloaded from the web site with VisualStudio 2008 without any problem.

On Fri, May 7, 2010 at 14:12, Jean-Denis Muys <jd...@mac.com>> wrote:
When setting the linker verbose, it indeed reports that it is searching log4cxx.lib.
When setting fully verbose, it even reports *finding* symbols in log4cxx.lib with the file that references them.
So indeed, the linker finds log4cxx.lib AND manages to find some of the symbols I use.
Also, it seems that all the found symbols have a __thiscall declaration, while all the ones that are *not* found have a __stdcall declaration.

I have no idea whether this has any significance.

regarding the __declspec thing, I noticed that the linker says the symbols it cannot find are __declspec(import), not __declspec(export). What are the differences between these two? Could it be that the "export" variations are in the log4cxx.lib file but cannot be matched to the "import" variation it's looking for?

<venting frustration>
Why is the Windows platform so poorly designed? None of those charades are necessary on the BSD architecture that MacOS X is built upon!
</venting frustration>

I am not sure what I can do next. I'll try to look for those symbols in the log4cxx source to check their declarations.

Jean-Denis



On May 7, 2010, at 12:02 , Fabian Jacquet wrote:


Mh, maybe those symbols are in the DLL but not in the lib. To be in the lib, it must have __declspec(dllexport) when compiling.
log4cxx use this define to do this:
#if defined(LOG4CXX_STATIC)
#define LOG4CXX_EXPORT
//   definitions used when building DLL
#elif defined(LOG4CXX)
#define LOG4CXX_EXPORT __declspec(dllexport)
#else
//    definitions used when using DLL
#define LOG4CXX_EXPORT __declspec(dllimport)
#endif

So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
and
"LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your project.

If for some reason, LOG4CXX_STATIC is defined, it's possible that some symbols are not exported. But I don't know how it's possible.

If you don't use more than those 13 symbols maybe nothing is exported or maybe the link don't use log4cxx.lib.
You can check the list of lib used by the linker like this:
Project properties>Linker>General>Show Progress = /VERBOSE:LIB
The linker will dump the lib list in the output window of visual studio when compiling. Check that you have something like that:
1>    Searching [your directories]\log4cxx.lib:

I don't know any tools to check symbols. I think you could check with notepad, you can search about "getLogger" by example but if you find it, I don't know if you can conclude that the symbol is right exported. If you don't find it, I think the problem comes from the lib :-)
On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com>> wrote:
Thanks for answering. I wish the solution was that simple. I apologize for not explicitly mentioning it, but my project is - I think - set up correctly.

That is:

- both the Debug and Release configurations mention log4cxx.lib in its Linker>Input>Additional Dependencies
- both the Debug and Release configurations mention a *different* directory in Linker>General>Additional Library Directories. They are different because they point to the Debug version and the Relase version of loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug and apache-log4cxx-0.10.0\projects\Release)


Of course both configurations of log4cxx were previously built with no failure (from its Visual Studio project). They were built in "DLL" mode as explained on the log4cxx web site. While doing a static library version is on my todo list, I'd rather solve the present issue first.

At this point in time, I suppose the 13 missing symbols are present in the Debug version of the log4cxx.lib stub library, but not in the Release version. How can I verify this hypothesis? What could explain that? How can I fix it?

Another hypothesis might be that there is yet another dependency that needs to be set in Release mode only. This seems less plausible though. And what would it be?

Again, thanks for you answer. Any other idea on how I could make progress on this issue?

Regards,

Jean-Denis


On May 7, 2010, at 10:29 , Fabian Jacquet wrote:

Hi,

The project configuration is different between debug and release. In debug you certainly added log4cxx.lib in the field "Linker/Input/Additional dependencies" but you have a drop-down which select the configuration, if you switch to release, I think you don't have log4cxx.lib in "Additional dependencies" .

Don't forget to add the directory of this lib in the field "Linker/General/Additional Library Directories"

log4cxx.lib is not really a static lib. It's only the interface to the dll class and functions.

I hope it help you.
On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com>> wrote:
Hi,

I have a Visual Studio 2008 project using log4cxx that links (and runs) fine in Debug mode using the Debug version of log4cxx, but fails to link in Release mode using the release version of log4cxx. Here are the 13 undefined symbols:


1>------ Build started: Project: RepliKator04, Configuration: Release Win32 ------
1>Linking...
1>   Creating library z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib and object z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
[...]
1>RepliKator04 - 13 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


As I am a Mac developer, not a Windows developer, I feel lost here. What can I do to fix that issue? I really don't get why those symbols would not be defined in Release mode.

Note that my project is not an application, but a Plugin for a third party app.
I link against the DLL version of log4cxx. I'd rather use a static library version, but I failed to build it so, and I could not find detailed instructions on the net to do it.

So for the time being, I am mainly interested in understanding why these link-time errors occur, and in how to fix them.

Thanks and regards.

Jean-Denis










RE: link error in release mode with Visual Studio 2008

Posted by "Reynolds, John" <Jo...@flightman.com>.
I suggest building the log4cxx.dll via ant as you only have do it once ( twice if you want a release and debug version ) and you can set the correct paths to the dll and header files in the VS project setting for your client project build configuration. Personally I very rarely use application VS, just the command line.

First you need ant ( hence you need java ) and the cpptasks jar, see the first option  http://logging.apache.org/log4cxx/building/ant.html (packaged APR and APR-Util, it builds in static versions of these into the dll ). The resultant dll should be in src/target/<configuration>/shared, where configuration is release or debug.

Then open the VS command prompt ( ensuring java and ant are in your PATH ) by clicking Start > Programs > Microsoft Visual XXX ( Studio C++ whatever ) > Visual Studio Tools > Visual Studio XXX Command Prompt ( what I called the shell, I recommend pinning this to your start menu for easy access ). This invokes a number of batch files to correctly set up the command line to run the complier and linker.

As an aside, I believe a lib can be a static library or a stub containing the entry points for a dll, both are different but can wind up have the same name as it is the linker that uses them to create the finished application.
So building a shared library will result in a dll and lib, a static lib only results in a dll. Then again I could be wrong, I have not built a static lib on Win32 in years.



________________________________
From: Jean-Denis Muys [mailto:jdmuys@mac.com]
Sent: 07 May 2010 16:48
To: Log4CXX User
Subject: Re: link error in release mode with Visual Studio 2008

John,

Thanks for chiming in.

Unfortunately, I think I don't understand your suggestion.

Are you suggesting that I build log4cxx [Debug|Release] using ant?
Or are you suggesting that I build my client program with ant?
Or both?

In either case, why do you think ant could help with the issue I have? Why would executing the linker from ant alleviate the "symbol not found" issues I have?

Finally, *how* would I go about doing what you suggest? How do you run ant from the VS Shell?

I'm sorry if I sound like a newbie. This is because I *am* a newbie on Windows. I am by experience a Mac developer.

Regards,

Jean-Denis


On May 7, 2010, at 17:40 , Reynolds, John wrote:


I use the ant build system from the VS shell.
In the source directory run ant for a release build or ant -Ddebug=true for a debug build


________________________________
From: Jean-Denis Muys [mailto:jdmuys@mac.com]
Sent: 07 May 2010 16:11
To: Log4CXX User
Subject: Re: link error in release mode with Visual Studio 2008

yep. no change.

On May 7, 2010, at 15:57 , Fabian Jacquet wrote:



Have you tried to recompile all from clean?
Maybe the release lib is corrupted...


On Fri, May 7, 2010 at 15:47, Jean-Denis Muys <jd...@mac.com>> wrote:
I downloaded the source code from the links at http://logging.apache.org/log4cxx/download.html
I simply compiled it following the instructions at http://logging.apache.org/log4cxx/building/vstudio.html

I had no error doing so.

I tried to track down one of those missing symbols, namely "getLogger(char const * const)".
I found the implementation LoggerPtr Logger::getLogger(const char* const name) in the file logger.cpp. Notice the difference between the parameter signature (char const * const vs const char* const).
It is declared in logger.h in a class that is declared:
class LOG4CXX_EXPORT Logger : ...

so it is controlled by the LOG4CXX_EXPORT macro that you described.

I am totally at loss. The source code looks fine. Everything compiles fine in both mode. The library links fine in both mode. The client code compiles fine in both modes. The client code links and runs fine in Debug mode, but fails to link in Release mode.

I am now trying to rebuild the log4cxx.lib library using the linker verbose mode in the hope of seeing those symbols in the output somehow. But then, I don't know what I can do next, whether or not they do show up.

Jean-Denis.


On May 7, 2010, at 15:26 , Fabian Jacquet wrote:



<venting frustration>
Why my boss don't want I develop for MacOS X ? :-)
</venting frustration>

The class déclaration must be __declspec(export) when you compile the dll and must be __declspec(import) when you include .h from this dll. So it's correct in your error message.
It's possible that the missing symbols declarations didn't have __declspec(export) when you compiled log4cxx.dll

Did you take sources from SVN? I compiled the source downloaded from the web site with VisualStudio 2008 without any problem.


On Fri, May 7, 2010 at 14:12, Jean-Denis Muys <jd...@mac.com>> wrote:
When setting the linker verbose, it indeed reports that it is searching log4cxx.lib.
When setting fully verbose, it even reports *finding* symbols in log4cxx.lib with the file that references them.
So indeed, the linker finds log4cxx.lib AND manages to find some of the symbols I use.
Also, it seems that all the found symbols have a __thiscall declaration, while all the ones that are *not* found have a __stdcall declaration.

I have no idea whether this has any significance.

regarding the __declspec thing, I noticed that the linker says the symbols it cannot find are __declspec(import), not __declspec(export). What are the differences between these two? Could it be that the "export" variations are in the log4cxx.lib file but cannot be matched to the "import" variation it's looking for?

<venting frustration>
Why is the Windows platform so poorly designed? None of those charades are necessary on the BSD architecture that MacOS X is built upon!
</venting frustration>

I am not sure what I can do next. I'll try to look for those symbols in the log4cxx source to check their declarations.

Jean-Denis



On May 7, 2010, at 12:02 , Fabian Jacquet wrote:



Mh, maybe those symbols are in the DLL but not in the lib. To be in the lib, it must have __declspec(dllexport) when compiling.
log4cxx use this define to do this:
#if defined(LOG4CXX_STATIC)
#define LOG4CXX_EXPORT
//   definitions used when building DLL
#elif defined(LOG4CXX)
#define LOG4CXX_EXPORT __declspec(dllexport)
#else
//    definitions used when using DLL
#define LOG4CXX_EXPORT __declspec(dllimport)
#endif

So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
and
"LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your project.

If for some reason, LOG4CXX_STATIC is defined, it's possible that some symbols are not exported. But I don't know how it's possible.

If you don't use more than those 13 symbols maybe nothing is exported or maybe the link don't use log4cxx.lib.
You can check the list of lib used by the linker like this:
Project properties>Linker>General>Show Progress = /VERBOSE:LIB
The linker will dump the lib list in the output window of visual studio when compiling. Check that you have something like that:
1>    Searching [your directories]\log4cxx.lib:

I don't know any tools to check symbols. I think you could check with notepad, you can search about "getLogger" by example but if you find it, I don't know if you can conclude that the symbol is right exported. If you don't find it, I think the problem comes from the lib :-)
On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com>> wrote:
Thanks for answering. I wish the solution was that simple. I apologize for not explicitly mentioning it, but my project is - I think - set up correctly.

That is:

- both the Debug and Release configurations mention log4cxx.lib in its Linker>Input>Additional Dependencies
- both the Debug and Release configurations mention a *different* directory in Linker>General>Additional Library Directories. They are different because they point to the Debug version and the Relase version of loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug and apache-log4cxx-0.10.0\projects\Release)


Of course both configurations of log4cxx were previously built with no failure (from its Visual Studio project). They were built in "DLL" mode as explained on the log4cxx web site. While doing a static library version is on my todo list, I'd rather solve the present issue first.

At this point in time, I suppose the 13 missing symbols are present in the Debug version of the log4cxx.lib stub library, but not in the Release version. How can I verify this hypothesis? What could explain that? How can I fix it?

Another hypothesis might be that there is yet another dependency that needs to be set in Release mode only. This seems less plausible though. And what would it be?

Again, thanks for you answer. Any other idea on how I could make progress on this issue?

Regards,

Jean-Denis


On May 7, 2010, at 10:29 , Fabian Jacquet wrote:

Hi,

The project configuration is different between debug and release. In debug you certainly added log4cxx.lib in the field "Linker/Input/Additional dependencies" but you have a drop-down which select the configuration, if you switch to release, I think you don't have log4cxx.lib in "Additional dependencies" .

Don't forget to add the directory of this lib in the field "Linker/General/Additional Library Directories"

log4cxx.lib is not really a static lib. It's only the interface to the dll class and functions.

I hope it help you.
On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com>> wrote:
Hi,

I have a Visual Studio 2008 project using log4cxx that links (and runs) fine in Debug mode using the Debug version of log4cxx, but fails to link in Release mode using the release version of log4cxx. Here are the 13 undefined symbols:


1>------ Build started: Project: RepliKator04, Configuration: Release Win32 ------
1>Linking...
1>   Creating library z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib and object z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
[...]
1>RepliKator04 - 13 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


As I am a Mac developer, not a Windows developer, I feel lost here. What can I do to fix that issue? I really don't get why those symbols would not be defined in Release mode.

Note that my project is not an application, but a Plugin for a third party app.
I link against the DLL version of log4cxx. I'd rather use a static library version, but I failed to build it so, and I could not find detailed instructions on the net to do it.

So for the time being, I am mainly interested in understanding why these link-time errors occur, and in how to fix them.

Thanks and regards.

Jean-Denis










Re: link error in release mode with Visual Studio 2008

Posted by Jean-Denis Muys <jd...@mac.com>.
John,

Thanks for chiming in.

Unfortunately, I think I don't understand your suggestion.

Are you suggesting that I build log4cxx [Debug|Release] using ant?
Or are you suggesting that I build my client program with ant?
Or both?

In either case, why do you think ant could help with the issue I have? Why would executing the linker from ant alleviate the "symbol not found" issues I have?

Finally, *how* would I go about doing what you suggest? How do you run ant from the VS Shell?

I'm sorry if I sound like a newbie. This is because I *am* a newbie on Windows. I am by experience a Mac developer.

Regards,

Jean-Denis


On May 7, 2010, at 17:40 , Reynolds, John wrote:

> I use the ant build system from the VS shell.
> In the source directory run ant for a release build or ant –Ddebug=true for a debug build
>  
>  
> From: Jean-Denis Muys [mailto:jdmuys@mac.com] 
> Sent: 07 May 2010 16:11
> To: Log4CXX User
> Subject: Re: link error in release mode with Visual Studio 2008
>  
> yep. no change.
>  
> On May 7, 2010, at 15:57 , Fabian Jacquet wrote:
> 
> 
> Have you tried to recompile all from clean?
> Maybe the release lib is corrupted...
> 
> 
> On Fri, May 7, 2010 at 15:47, Jean-Denis Muys <jd...@mac.com> wrote:
> I downloaded the source code from the links at http://logging.apache.org/log4cxx/download.html
> I simply compiled it following the instructions at http://logging.apache.org/log4cxx/building/vstudio.html
>  
> I had no error doing so.
>  
> I tried to track down one of those missing symbols, namely "getLogger(char const * const)".
> I found the implementation LoggerPtr Logger::getLogger(const char* const name) in the file logger.cpp. Notice the difference between the parameter signature (char const * const vs const char* const).
> It is declared in logger.h in a class that is declared:
> class LOG4CXX_EXPORT Logger : ...
>  
> so it is controlled by the LOG4CXX_EXPORT macro that you described.
>  
> I am totally at loss. The source code looks fine. Everything compiles fine in both mode. The library links fine in both mode. The client code compiles fine in both modes. The client code links and runs fine in Debug mode, but fails to link in Release mode.
>  
> I am now trying to rebuild the log4cxx.lib library using the linker verbose mode in the hope of seeing those symbols in the output somehow. But then, I don't know what I can do next, whether or not they do show up.
>  
> Jean-Denis.
>  
>  
> On May 7, 2010, at 15:26 , Fabian Jacquet wrote:
> 
> 
> <venting frustration>
> Why my boss don't want I develop for MacOS X ? :-)
> </venting frustration>
> 
> The class déclaration must be __declspec(export) when you compile the dll and must be __declspec(import) when you include .h from this dll. So it's correct in your error message.
> It's possible that the missing symbols declarations didn't have __declspec(export) when you compiled log4cxx.dll
> 
> Did you take sources from SVN? I compiled the source downloaded from the web site with VisualStudio 2008 without any problem.
> 
> 
> On Fri, May 7, 2010 at 14:12, Jean-Denis Muys <jd...@mac.com> wrote:
> When setting the linker verbose, it indeed reports that it is searching log4cxx.lib.
> When setting fully verbose, it even reports *finding* symbols in log4cxx.lib with the file that references them.
> So indeed, the linker finds log4cxx.lib AND manages to find some of the symbols I use.
> Also, it seems that all the found symbols have a __thiscall declaration, while all the ones that are *not* found have a __stdcall declaration.
>  
> I have no idea whether this has any significance.
>  
> regarding the __declspec thing, I noticed that the linker says the symbols it cannot find are __declspec(import), not __declspec(export). What are the differences between these two? Could it be that the "export" variations are in the log4cxx.lib file but cannot be matched to the "import" variation it's looking for?
>  
> <venting frustration>
> Why is the Windows platform so poorly designed? None of those charades are necessary on the BSD architecture that MacOS X is built upon!
> </venting frustration>
>  
> I am not sure what I can do next. I'll try to look for those symbols in the log4cxx source to check their declarations.
>  
> Jean-Denis
>  
>  
>  
> On May 7, 2010, at 12:02 , Fabian Jacquet wrote:
> 
> 
> Mh, maybe those symbols are in the DLL but not in the lib. To be in the lib, it must have __declspec(dllexport) when compiling.
> log4cxx use this define to do this:
> #if defined(LOG4CXX_STATIC)
> #define LOG4CXX_EXPORT
> //   definitions used when building DLL
> #elif defined(LOG4CXX)
> #define LOG4CXX_EXPORT __declspec(dllexport)
> #else
> //    definitions used when using DLL
> #define LOG4CXX_EXPORT __declspec(dllimport)
> #endif
> 
> So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
> and
> "LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your project.
> 
> If for some reason, LOG4CXX_STATIC is defined, it's possible that some symbols are not exported. But I don't know how it's possible.
> 
> If you don't use more than those 13 symbols maybe nothing is exported or maybe the link don't use log4cxx.lib.
> You can check the list of lib used by the linker like this:
> Project properties>Linker>General>Show Progress = /VERBOSE:LIB
> The linker will dump the lib list in the output window of visual studio when compiling. Check that you have something like that:
> 1>    Searching [your directories]\log4cxx.lib:
> 
> I don't know any tools to check symbols. I think you could check with notepad, you can search about "getLogger" by example but if you find it, I don't know if you can conclude that the symbol is right exported. If you don't find it, I think the problem comes from the lib :-)
> 
> On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com> wrote:
> Thanks for answering. I wish the solution was that simple. I apologize for not explicitly mentioning it, but my project is - I think - set up correctly.
>  
> That is:
>  
> - both the Debug and Release configurations mention log4cxx.lib in its Linker>Input>Additional Dependencies
> - both the Debug and Release configurations mention a *different* directory in Linker>General>Additional Library Directories. They are different because they point to the Debug version and the Relase version of loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug and apache-log4cxx-0.10.0\projects\Release)
>  
>  
> Of course both configurations of log4cxx were previously built with no failure (from its Visual Studio project). They were built in "DLL" mode as explained on the log4cxx web site. While doing a static library version is on my todo list, I'd rather solve the present issue first.
>  
> At this point in time, I suppose the 13 missing symbols are present in the Debug version of the log4cxx.lib stub library, but not in the Release version. How can I verify this hypothesis? What could explain that? How can I fix it?
>  
> Another hypothesis might be that there is yet another dependency that needs to be set in Release mode only. This seems less plausible though. And what would it be?
>  
> Again, thanks for you answer. Any other idea on how I could make progress on this issue?
>  
> Regards,
>  
> Jean-Denis
>  
>  
> On May 7, 2010, at 10:29 , Fabian Jacquet wrote:
>  
>> Hi,
>> 
>> The project configuration is different between debug and release. In debug you certainly added log4cxx.lib in the field "Linker/Input/Additional dependencies" but you have a drop-down which select the configuration, if you switch to release, I think you don't have log4cxx.lib in "Additional dependencies" .
>> 
>> Don't forget to add the directory of this lib in the field "Linker/General/Additional Library Directories"
>> 
>> log4cxx.lib is not really a static lib. It's only the interface to the dll class and functions.
>> 
>> I hope it help you.
>> 
>> On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com> wrote:
>> Hi,
>> 
>> I have a Visual Studio 2008 project using log4cxx that links (and runs) fine in Debug mode using the Debug version of log4cxx, but fails to link in Release mode using the release version of log4cxx. Here are the 13 undefined symbols:
>> 
>> 
>> 1>------ Build started: Project: RepliKator04, Configuration: Release Win32 ------
>> 1>Linking...
>> 1>   Creating library z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib and object z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
>> 1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
>> [...]
>> 1>RepliKator04 - 13 error(s), 0 warning(s)
>> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>> 
>> 
>> As I am a Mac developer, not a Windows developer, I feel lost here. What can I do to fix that issue? I really don't get why those symbols would not be defined in Release mode.
>> 
>> Note that my project is not an application, but a Plugin for a third party app.
>> I link against the DLL version of log4cxx. I'd rather use a static library version, but I failed to build it so, and I could not find detailed instructions on the net to do it.
>> 
>> So for the time being, I am mainly interested in understanding why these link-time errors occur, and in how to fix them.
>> 
>> Thanks and regards.
>> 
>> Jean-Denis
>> 
>>  
> 
>  
>  
>  
>  
>  
>  
>  


RE: link error in release mode with Visual Studio 2008

Posted by "Reynolds, John" <Jo...@flightman.com>.
I use the ant build system from the VS shell.
In the source directory run ant for a release build or ant -Ddebug=true for a debug build


________________________________
From: Jean-Denis Muys [mailto:jdmuys@mac.com]
Sent: 07 May 2010 16:11
To: Log4CXX User
Subject: Re: link error in release mode with Visual Studio 2008

yep. no change.

On May 7, 2010, at 15:57 , Fabian Jacquet wrote:


Have you tried to recompile all from clean?
Maybe the release lib is corrupted...

On Fri, May 7, 2010 at 15:47, Jean-Denis Muys <jd...@mac.com>> wrote:
I downloaded the source code from the links at http://logging.apache.org/log4cxx/download.html
I simply compiled it following the instructions at http://logging.apache.org/log4cxx/building/vstudio.html

I had no error doing so.

I tried to track down one of those missing symbols, namely "getLogger(char const * const)".
I found the implementation LoggerPtr Logger::getLogger(const char* const name) in the file logger.cpp. Notice the difference between the parameter signature (char const * const vs const char* const).
It is declared in logger.h in a class that is declared:
class LOG4CXX_EXPORT Logger : ...

so it is controlled by the LOG4CXX_EXPORT macro that you described.

I am totally at loss. The source code looks fine. Everything compiles fine in both mode. The library links fine in both mode. The client code compiles fine in both modes. The client code links and runs fine in Debug mode, but fails to link in Release mode.

I am now trying to rebuild the log4cxx.lib library using the linker verbose mode in the hope of seeing those symbols in the output somehow. But then, I don't know what I can do next, whether or not they do show up.

Jean-Denis.


On May 7, 2010, at 15:26 , Fabian Jacquet wrote:


<venting frustration>
Why my boss don't want I develop for MacOS X ? :-)
</venting frustration>

The class déclaration must be __declspec(export) when you compile the dll and must be __declspec(import) when you include .h from this dll. So it's correct in your error message.
It's possible that the missing symbols declarations didn't have __declspec(export) when you compiled log4cxx.dll

Did you take sources from SVN? I compiled the source downloaded from the web site with VisualStudio 2008 without any problem.

On Fri, May 7, 2010 at 14:12, Jean-Denis Muys <jd...@mac.com>> wrote:
When setting the linker verbose, it indeed reports that it is searching log4cxx.lib.
When setting fully verbose, it even reports *finding* symbols in log4cxx.lib with the file that references them.
So indeed, the linker finds log4cxx.lib AND manages to find some of the symbols I use.
Also, it seems that all the found symbols have a __thiscall declaration, while all the ones that are *not* found have a __stdcall declaration.

I have no idea whether this has any significance.

regarding the __declspec thing, I noticed that the linker says the symbols it cannot find are __declspec(import), not __declspec(export). What are the differences between these two? Could it be that the "export" variations are in the log4cxx.lib file but cannot be matched to the "import" variation it's looking for?

<venting frustration>
Why is the Windows platform so poorly designed? None of those charades are necessary on the BSD architecture that MacOS X is built upon!
</venting frustration>

I am not sure what I can do next. I'll try to look for those symbols in the log4cxx source to check their declarations.

Jean-Denis



On May 7, 2010, at 12:02 , Fabian Jacquet wrote:


Mh, maybe those symbols are in the DLL but not in the lib. To be in the lib, it must have __declspec(dllexport) when compiling.
log4cxx use this define to do this:
#if defined(LOG4CXX_STATIC)
#define LOG4CXX_EXPORT
//   definitions used when building DLL
#elif defined(LOG4CXX)
#define LOG4CXX_EXPORT __declspec(dllexport)
#else
//    definitions used when using DLL
#define LOG4CXX_EXPORT __declspec(dllimport)
#endif

So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
and
"LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your project.

If for some reason, LOG4CXX_STATIC is defined, it's possible that some symbols are not exported. But I don't know how it's possible.

If you don't use more than those 13 symbols maybe nothing is exported or maybe the link don't use log4cxx.lib.
You can check the list of lib used by the linker like this:
Project properties>Linker>General>Show Progress = /VERBOSE:LIB
The linker will dump the lib list in the output window of visual studio when compiling. Check that you have something like that:
1>    Searching [your directories]\log4cxx.lib:

I don't know any tools to check symbols. I think you could check with notepad, you can search about "getLogger" by example but if you find it, I don't know if you can conclude that the symbol is right exported. If you don't find it, I think the problem comes from the lib :-)
On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com>> wrote:
Thanks for answering. I wish the solution was that simple. I apologize for not explicitly mentioning it, but my project is - I think - set up correctly.

That is:

- both the Debug and Release configurations mention log4cxx.lib in its Linker>Input>Additional Dependencies
- both the Debug and Release configurations mention a *different* directory in Linker>General>Additional Library Directories. They are different because they point to the Debug version and the Relase version of loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug and apache-log4cxx-0.10.0\projects\Release)


Of course both configurations of log4cxx were previously built with no failure (from its Visual Studio project). They were built in "DLL" mode as explained on the log4cxx web site. While doing a static library version is on my todo list, I'd rather solve the present issue first.

At this point in time, I suppose the 13 missing symbols are present in the Debug version of the log4cxx.lib stub library, but not in the Release version. How can I verify this hypothesis? What could explain that? How can I fix it?

Another hypothesis might be that there is yet another dependency that needs to be set in Release mode only. This seems less plausible though. And what would it be?

Again, thanks for you answer. Any other idea on how I could make progress on this issue?

Regards,

Jean-Denis


On May 7, 2010, at 10:29 , Fabian Jacquet wrote:

Hi,

The project configuration is different between debug and release. In debug you certainly added log4cxx.lib in the field "Linker/Input/Additional dependencies" but you have a drop-down which select the configuration, if you switch to release, I think you don't have log4cxx.lib in "Additional dependencies" .

Don't forget to add the directory of this lib in the field "Linker/General/Additional Library Directories"

log4cxx.lib is not really a static lib. It's only the interface to the dll class and functions.

I hope it help you.
On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com>> wrote:
Hi,

I have a Visual Studio 2008 project using log4cxx that links (and runs) fine in Debug mode using the Debug version of log4cxx, but fails to link in Release mode using the release version of log4cxx. Here are the 13 undefined symbols:


1>------ Build started: Project: RepliKator04, Configuration: Release Win32 ------
1>Linking...
1>   Creating library z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib and object z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
[...]
1>RepliKator04 - 13 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


As I am a Mac developer, not a Windows developer, I feel lost here. What can I do to fix that issue? I really don't get why those symbols would not be defined in Release mode.

Note that my project is not an application, but a Plugin for a third party app.
I link against the DLL version of log4cxx. I'd rather use a static library version, but I failed to build it so, and I could not find detailed instructions on the net to do it.

So for the time being, I am mainly interested in understanding why these link-time errors occur, and in how to fix them.

Thanks and regards.

Jean-Denis









Re: link error in release mode with Visual Studio 2008

Posted by Jean-Denis Muys <jd...@mac.com>.
yep. no change.

On May 7, 2010, at 15:57 , Fabian Jacquet wrote:

> Have you tried to recompile all from clean?
> Maybe the release lib is corrupted...
> 
> 
> On Fri, May 7, 2010 at 15:47, Jean-Denis Muys <jd...@mac.com> wrote:
> I downloaded the source code from the links at http://logging.apache.org/log4cxx/download.html
> I simply compiled it following the instructions at http://logging.apache.org/log4cxx/building/vstudio.html
> 
> I had no error doing so.
> 
> I tried to track down one of those missing symbols, namely "getLogger(char const * const)".
> I found the implementation LoggerPtr Logger::getLogger(const char* const name) in the file logger.cpp. Notice the difference between the parameter signature (char const * const vs const char* const).
> It is declared in logger.h in a class that is declared:
> class LOG4CXX_EXPORT Logger : ...
> 
> so it is controlled by the LOG4CXX_EXPORT macro that you described.
> 
> I am totally at loss. The source code looks fine. Everything compiles fine in both mode. The library links fine in both mode. The client code compiles fine in both modes. The client code links and runs fine in Debug mode, but fails to link in Release mode.
> 
> I am now trying to rebuild the log4cxx.lib library using the linker verbose mode in the hope of seeing those symbols in the output somehow. But then, I don't know what I can do next, whether or not they do show up.
> 
> Jean-Denis.
> 
> 
> On May 7, 2010, at 15:26 , Fabian Jacquet wrote:
> 
>> <venting frustration>
>> Why my boss don't want I develop for MacOS X ? :-)
>> </venting frustration>
>> 
>> The class déclaration must be __declspec(export) when you compile the dll and must be __declspec(import) when you include .h from this dll. So it's correct in your error message.
>> It's possible that the missing symbols declarations didn't have __declspec(export) when you compiled log4cxx.dll
>> 
>> Did you take sources from SVN? I compiled the source downloaded from the web site with VisualStudio 2008 without any problem.
>> 
>> 
>> On Fri, May 7, 2010 at 14:12, Jean-Denis Muys <jd...@mac.com> wrote:
>> When setting the linker verbose, it indeed reports that it is searching log4cxx.lib.
>> When setting fully verbose, it even reports *finding* symbols in log4cxx.lib with the file that references them.
>> So indeed, the linker finds log4cxx.lib AND manages to find some of the symbols I use.
>> Also, it seems that all the found symbols have a __thiscall declaration, while all the ones that are *not* found have a __stdcall declaration.
>> 
>> I have no idea whether this has any significance.
>> 
>> regarding the __declspec thing, I noticed that the linker says the symbols it cannot find are __declspec(import), not __declspec(export). What are the differences between these two? Could it be that the "export" variations are in the log4cxx.lib file but cannot be matched to the "import" variation it's looking for?
>> 
>> <venting frustration>
>> Why is the Windows platform so poorly designed? None of those charades are necessary on the BSD architecture that MacOS X is built upon!
>> </venting frustration>
>> 
>> I am not sure what I can do next. I'll try to look for those symbols in the log4cxx source to check their declarations.
>> 
>> Jean-Denis
>> 
>> 
>> 
>> On May 7, 2010, at 12:02 , Fabian Jacquet wrote:
>> 
>>> Mh, maybe those symbols are in the DLL but not in the lib. To be in the lib, it must have __declspec(dllexport) when compiling.
>>> log4cxx use this define to do this:
>>> #if defined(LOG4CXX_STATIC)
>>> #define LOG4CXX_EXPORT
>>> //   definitions used when building DLL
>>> #elif defined(LOG4CXX)
>>> #define LOG4CXX_EXPORT __declspec(dllexport)
>>> #else
>>> //    definitions used when using DLL
>>> #define LOG4CXX_EXPORT __declspec(dllimport)
>>> #endif
>>> 
>>> So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
>>> and
>>> "LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your project.
>>> 
>>> If for some reason, LOG4CXX_STATIC is defined, it's possible that some symbols are not exported. But I don't know how it's possible.
>>> 
>>> If you don't use more than those 13 symbols maybe nothing is exported or maybe the link don't use log4cxx.lib.
>>> You can check the list of lib used by the linker like this:
>>> Project properties>Linker>General>Show Progress = /VERBOSE:LIB
>>> The linker will dump the lib list in the output window of visual studio when compiling. Check that you have something like that:
>>> 1>    Searching [your directories]\log4cxx.lib:
>>> 
>>> I don't know any tools to check symbols. I think you could check with notepad, you can search about "getLogger" by example but if you find it, I don't know if you can conclude that the symbol is right exported. If you don't find it, I think the problem comes from the lib :-)
>>> 
>>> On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com> wrote:
>>> Thanks for answering. I wish the solution was that simple. I apologize for not explicitly mentioning it, but my project is - I think - set up correctly.
>>> 
>>> That is:
>>> 
>>> - both the Debug and Release configurations mention log4cxx.lib in its Linker>Input>Additional Dependencies
>>> - both the Debug and Release configurations mention a *different* directory in Linker>General>Additional Library Directories. They are different because they point to the Debug version and the Relase version of loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug and apache-log4cxx-0.10.0\projects\Release)
>>> 
>>> 
>>> Of course both configurations of log4cxx were previously built with no failure (from its Visual Studio project). They were built in "DLL" mode as explained on the log4cxx web site. While doing a static library version is on my todo list, I'd rather solve the present issue first.
>>> 
>>> At this point in time, I suppose the 13 missing symbols are present in the Debug version of the log4cxx.lib stub library, but not in the Release version. How can I verify this hypothesis? What could explain that? How can I fix it?
>>> 
>>> Another hypothesis might be that there is yet another dependency that needs to be set in Release mode only. This seems less plausible though. And what would it be?
>>> 
>>> Again, thanks for you answer. Any other idea on how I could make progress on this issue?
>>> 
>>> Regards,
>>> 
>>> Jean-Denis
>>> 
>>> 
>>> On May 7, 2010, at 10:29 , Fabian Jacquet wrote:
>>> 
>>>> Hi,
>>>> 
>>>> The project configuration is different between debug and release. In debug you certainly added log4cxx.lib in the field "Linker/Input/Additional dependencies" but you have a drop-down which select the configuration, if you switch to release, I think you don't have log4cxx.lib in "Additional dependencies" .
>>>> 
>>>> Don't forget to add the directory of this lib in the field "Linker/General/Additional Library Directories"
>>>> 
>>>> log4cxx.lib is not really a static lib. It's only the interface to the dll class and functions.
>>>> 
>>>> I hope it help you.
>>>> 
>>>> On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com> wrote:
>>>> Hi,
>>>> 
>>>> I have a Visual Studio 2008 project using log4cxx that links (and runs) fine in Debug mode using the Debug version of log4cxx, but fails to link in Release mode using the release version of log4cxx. Here are the 13 undefined symbols:
>>>> 
>>>> 
>>>> 1>------ Build started: Project: RepliKator04, Configuration: Release Win32 ------
>>>> 1>Linking...
>>>> 1>   Creating library z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib and object z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
>>>> 1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
>>>> [...]
>>>> 1>RepliKator04 - 13 error(s), 0 warning(s)
>>>> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>>>> 
>>>> 
>>>> As I am a Mac developer, not a Windows developer, I feel lost here. What can I do to fix that issue? I really don't get why those symbols would not be defined in Release mode.
>>>> 
>>>> Note that my project is not an application, but a Plugin for a third party app.
>>>> I link against the DLL version of log4cxx. I'd rather use a static library version, but I failed to build it so, and I could not find detailed instructions on the net to do it.
>>>> 
>>>> So for the time being, I am mainly interested in understanding why these link-time errors occur, and in how to fix them.
>>>> 
>>>> Thanks and regards.
>>>> 
>>>> Jean-Denis
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 


Re: link error in release mode with Visual Studio 2008

Posted by Fabian Jacquet <fa...@gmail.com>.
Have you tried to recompile all from clean?
Maybe the release lib is corrupted...


On Fri, May 7, 2010 at 15:47, Jean-Denis Muys <jd...@mac.com> wrote:

> I downloaded the source code from the links at
> http://logging.apache.org/log4cxx/download.html
> I simply compiled it following the instructions at
> http://logging.apache.org/log4cxx/building/vstudio.html
>
> I had no error doing so.
>
> I tried to track down one of those missing symbols, namely "getLogger(char
> const * const)".
> I found the implementation LoggerPtr Logger::getLogger(const char* const
> name) in the file logger.cpp. Notice the difference between the parameter
> signature (char const * const vs const char* const).
> It is declared in logger.h in a class that is declared:
> class LOG4CXX_EXPORT Logger : ...
>
> so it is controlled by the LOG4CXX_EXPORT macro that you described.
>
> I am totally at loss. The source code looks fine. Everything compiles fine
> in both mode. The library links fine in both mode. The client code compiles
> fine in both modes. The client code links and runs fine in Debug mode, but
> fails to link in Release mode.
>
> I am now trying to rebuild the log4cxx.lib library using the linker verbose
> mode in the hope of seeing those symbols in the output somehow. But then, I
> don't know what I can do next, whether or not they do show up.
>
> Jean-Denis.
>
>
> On May 7, 2010, at 15:26 , Fabian Jacquet wrote:
>
> <venting frustration>
> Why my boss don't want I develop for MacOS X ? :-)
> </venting frustration>
>
> The class déclaration must be __declspec(export) when you compile the dll
> and must be __declspec(import) when you include .h from this dll. So it's
> correct in your error message.
> It's possible that the missing symbols declarations didn't have
> __declspec(export) when you compiled log4cxx.dll
>
> Did you take sources from SVN? I compiled the source downloaded from the
> web site with VisualStudio 2008 without any problem.
>
>
> On Fri, May 7, 2010 at 14:12, Jean-Denis Muys <jd...@mac.com> wrote:
>
>> When setting the linker verbose, it indeed reports that it is searching
>> log4cxx.lib.
>> When setting fully verbose, it even reports *finding* symbols in
>> log4cxx.lib with the file that references them.
>> So indeed, the linker finds log4cxx.lib AND manages to find some of the
>> symbols I use.
>> Also, it seems that all the found symbols have a __thiscall declaration,
>> while all the ones that are *not* found have a __stdcall declaration.
>>
>> I have no idea whether this has any significance.
>>
>> regarding the __declspec thing, I noticed that the linker says the symbols
>> it cannot find are __declspec(import), not __declspec(export). What are the
>> differences between these two? Could it be that the "export" variations are
>> in the log4cxx.lib file but cannot be matched to the "import" variation it's
>> looking for?
>>
>> <venting frustration>
>> Why is the Windows platform so poorly designed? None of those charades are
>> necessary on the BSD architecture that MacOS X is built upon!
>> </venting frustration>
>>
>> I am not sure what I can do next. I'll try to look for those symbols in
>> the log4cxx source to check their declarations.
>>
>> Jean-Denis
>>
>>
>>
>> On May 7, 2010, at 12:02 , Fabian Jacquet wrote:
>>
>> Mh, maybe those symbols are in the DLL but not in the lib. To be in the
>> lib, it must have __declspec(dllexport) when compiling.
>> log4cxx use this define to do this:
>> #if defined(LOG4CXX_STATIC)
>> #define LOG4CXX_EXPORT
>> //   definitions used when building DLL
>> #elif defined(LOG4CXX)
>> #define LOG4CXX_EXPORT __declspec(dllexport)
>> #else
>> //    definitions used when using DLL
>> #define LOG4CXX_EXPORT __declspec(dllimport)
>> #endif
>>
>> So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
>> and
>> "LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your
>> project.
>>
>> If for some reason, LOG4CXX_STATIC is defined, it's possible that some
>> symbols are not exported. But I don't know how it's possible.
>>
>> If you don't use more than those 13 symbols maybe nothing is exported or
>> maybe the link don't use log4cxx.lib.
>> You can check the list of lib used by the linker like this:
>> Project properties>Linker>General>Show Progress = /VERBOSE:LIB
>> The linker will dump the lib list in the output window of visual studio
>> when compiling. Check that you have something like that:
>> 1>    Searching [your directories]\log4cxx.lib:
>>
>> I don't know any tools to check symbols. I think you could check with
>> notepad, you can search about "getLogger" by example but if you find it, I
>> don't know if you can conclude that the symbol is right exported. If you
>> don't find it, I think the problem comes from the lib :-)
>>
>> On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com> wrote:
>>
>>> Thanks for answering. I wish the solution was that simple. I apologize
>>> for not explicitly mentioning it, but my project is - I think - set up
>>> correctly.
>>>
>>> That is:
>>>
>>> - both the Debug and Release configurations mention log4cxx.lib in its
>>> Linker>Input>Additional Dependencies
>>> - both the Debug and Release configurations mention a *different*
>>> directory in Linker>General>Additional Library Directories. They are
>>> different because they point to the Debug version and the Relase version of
>>> loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug
>>> and apache-log4cxx-0.10.0\projects\Release)
>>>
>>>
>>> Of course both configurations of log4cxx were previously built with no
>>> failure (from its Visual Studio project). They were built in "DLL" mode as
>>> explained on the log4cxx web site. While doing a static library version is
>>> on my todo list, I'd rather solve the present issue first.
>>>
>>> At this point in time, I suppose the 13 missing symbols are present in
>>> the Debug version of the log4cxx.lib stub library, but not in the Release
>>> version. How can I verify this hypothesis? What could explain that? How can
>>> I fix it?
>>>
>>> Another hypothesis might be that there is yet another dependency that
>>> needs to be set in Release mode only. This seems less plausible though. And
>>> what would it be?
>>>
>>> Again, thanks for you answer. Any other idea on how I could make progress
>>> on this issue?
>>>
>>> Regards,
>>>
>>> Jean-Denis
>>>
>>>
>>> On May 7, 2010, at 10:29 , Fabian Jacquet wrote:
>>>
>>> Hi,
>>>
>>> The project configuration is different between debug and release. In
>>> debug you certainly added log4cxx.lib in the field "Linker/Input/Additional
>>> dependencies" but you have a drop-down which select the configuration, if
>>> you switch to release, I think you don't have log4cxx.lib in "Additional
>>> dependencies" .
>>>
>>> Don't forget to add the directory of this lib in the field
>>> "Linker/General/Additional Library Directories"
>>>
>>> log4cxx.lib is not really a static lib. It's only the interface to the
>>> dll class and functions.
>>>
>>> I hope it help you.
>>>
>>> On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have a Visual Studio 2008 project using log4cxx that links (and runs)
>>>> fine in Debug mode using the Debug version of log4cxx, but fails to link in
>>>> Release mode using the release version of log4cxx. Here are the 13 undefined
>>>> symbols:
>>>>
>>>>
>>>> 1>------ Build started: Project: RepliKator04, Configuration: Release
>>>> Win32 ------
>>>> 1>Linking...
>>>> 1>   Creating library
>>>> z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib
>>>> and object
>>>> z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
>>>> 1>RKConnector.obj : error LNK2001: unresolved external symbol
>>>> "__declspec(dllimport) public: static class
>>>> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall
>>>> log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@
>>>> @SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
>>>> [...]
>>>> 1>RepliKator04 - 13 error(s), 0 warning(s)
>>>> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
>>>> ==========
>>>>
>>>>
>>>> As I am a Mac developer, not a Windows developer, I feel lost here. What
>>>> can I do to fix that issue? I really don't get why those symbols would not
>>>> be defined in Release mode.
>>>>
>>>> Note that my project is not an application, but a Plugin for a third
>>>> party app.
>>>> I link against the DLL version of log4cxx. I'd rather use a static
>>>> library version, but I failed to build it so, and I could not find detailed
>>>> instructions on the net to do it.
>>>>
>>>> So for the time being, I am mainly interested in understanding why these
>>>> link-time errors occur, and in how to fix them.
>>>>
>>>> Thanks and regards.
>>>>
>>>> Jean-Denis
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Re: link error in release mode with Visual Studio 2008

Posted by Jean-Denis Muys <jd...@mac.com>.
I downloaded the source code from the links at http://logging.apache.org/log4cxx/download.html
I simply compiled it following the instructions at http://logging.apache.org/log4cxx/building/vstudio.html

I had no error doing so.

I tried to track down one of those missing symbols, namely "getLogger(char const * const)".
I found the implementation LoggerPtr Logger::getLogger(const char* const name) in the file logger.cpp. Notice the difference between the parameter signature (char const * const vs const char* const).
It is declared in logger.h in a class that is declared:
class LOG4CXX_EXPORT Logger : ...

so it is controlled by the LOG4CXX_EXPORT macro that you described.

I am totally at loss. The source code looks fine. Everything compiles fine in both mode. The library links fine in both mode. The client code compiles fine in both modes. The client code links and runs fine in Debug mode, but fails to link in Release mode.

I am now trying to rebuild the log4cxx.lib library using the linker verbose mode in the hope of seeing those symbols in the output somehow. But then, I don't know what I can do next, whether or not they do show up.

Jean-Denis.


On May 7, 2010, at 15:26 , Fabian Jacquet wrote:

> <venting frustration>
> Why my boss don't want I develop for MacOS X ? :-)
> </venting frustration>
> 
> The class déclaration must be __declspec(export) when you compile the dll and must be __declspec(import) when you include .h from this dll. So it's correct in your error message.
> It's possible that the missing symbols declarations didn't have __declspec(export) when you compiled log4cxx.dll
> 
> Did you take sources from SVN? I compiled the source downloaded from the web site with VisualStudio 2008 without any problem.
> 
> 
> On Fri, May 7, 2010 at 14:12, Jean-Denis Muys <jd...@mac.com> wrote:
> When setting the linker verbose, it indeed reports that it is searching log4cxx.lib.
> When setting fully verbose, it even reports *finding* symbols in log4cxx.lib with the file that references them.
> So indeed, the linker finds log4cxx.lib AND manages to find some of the symbols I use.
> Also, it seems that all the found symbols have a __thiscall declaration, while all the ones that are *not* found have a __stdcall declaration.
> 
> I have no idea whether this has any significance.
> 
> regarding the __declspec thing, I noticed that the linker says the symbols it cannot find are __declspec(import), not __declspec(export). What are the differences between these two? Could it be that the "export" variations are in the log4cxx.lib file but cannot be matched to the "import" variation it's looking for?
> 
> <venting frustration>
> Why is the Windows platform so poorly designed? None of those charades are necessary on the BSD architecture that MacOS X is built upon!
> </venting frustration>
> 
> I am not sure what I can do next. I'll try to look for those symbols in the log4cxx source to check their declarations.
> 
> Jean-Denis
> 
> 
> 
> On May 7, 2010, at 12:02 , Fabian Jacquet wrote:
> 
>> Mh, maybe those symbols are in the DLL but not in the lib. To be in the lib, it must have __declspec(dllexport) when compiling.
>> log4cxx use this define to do this:
>> #if defined(LOG4CXX_STATIC)
>> #define LOG4CXX_EXPORT
>> //   definitions used when building DLL
>> #elif defined(LOG4CXX)
>> #define LOG4CXX_EXPORT __declspec(dllexport)
>> #else
>> //    definitions used when using DLL
>> #define LOG4CXX_EXPORT __declspec(dllimport)
>> #endif
>> 
>> So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
>> and
>> "LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your project.
>> 
>> If for some reason, LOG4CXX_STATIC is defined, it's possible that some symbols are not exported. But I don't know how it's possible.
>> 
>> If you don't use more than those 13 symbols maybe nothing is exported or maybe the link don't use log4cxx.lib.
>> You can check the list of lib used by the linker like this:
>> Project properties>Linker>General>Show Progress = /VERBOSE:LIB
>> The linker will dump the lib list in the output window of visual studio when compiling. Check that you have something like that:
>> 1>    Searching [your directories]\log4cxx.lib:
>> 
>> I don't know any tools to check symbols. I think you could check with notepad, you can search about "getLogger" by example but if you find it, I don't know if you can conclude that the symbol is right exported. If you don't find it, I think the problem comes from the lib :-)
>> 
>> On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com> wrote:
>> Thanks for answering. I wish the solution was that simple. I apologize for not explicitly mentioning it, but my project is - I think - set up correctly.
>> 
>> That is:
>> 
>> - both the Debug and Release configurations mention log4cxx.lib in its Linker>Input>Additional Dependencies
>> - both the Debug and Release configurations mention a *different* directory in Linker>General>Additional Library Directories. They are different because they point to the Debug version and the Relase version of loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug and apache-log4cxx-0.10.0\projects\Release)
>> 
>> 
>> Of course both configurations of log4cxx were previously built with no failure (from its Visual Studio project). They were built in "DLL" mode as explained on the log4cxx web site. While doing a static library version is on my todo list, I'd rather solve the present issue first.
>> 
>> At this point in time, I suppose the 13 missing symbols are present in the Debug version of the log4cxx.lib stub library, but not in the Release version. How can I verify this hypothesis? What could explain that? How can I fix it?
>> 
>> Another hypothesis might be that there is yet another dependency that needs to be set in Release mode only. This seems less plausible though. And what would it be?
>> 
>> Again, thanks for you answer. Any other idea on how I could make progress on this issue?
>> 
>> Regards,
>> 
>> Jean-Denis
>> 
>> 
>> On May 7, 2010, at 10:29 , Fabian Jacquet wrote:
>> 
>>> Hi,
>>> 
>>> The project configuration is different between debug and release. In debug you certainly added log4cxx.lib in the field "Linker/Input/Additional dependencies" but you have a drop-down which select the configuration, if you switch to release, I think you don't have log4cxx.lib in "Additional dependencies" .
>>> 
>>> Don't forget to add the directory of this lib in the field "Linker/General/Additional Library Directories"
>>> 
>>> log4cxx.lib is not really a static lib. It's only the interface to the dll class and functions.
>>> 
>>> I hope it help you.
>>> 
>>> On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com> wrote:
>>> Hi,
>>> 
>>> I have a Visual Studio 2008 project using log4cxx that links (and runs) fine in Debug mode using the Debug version of log4cxx, but fails to link in Release mode using the release version of log4cxx. Here are the 13 undefined symbols:
>>> 
>>> 
>>> 1>------ Build started: Project: RepliKator04, Configuration: Release Win32 ------
>>> 1>Linking...
>>> 1>   Creating library z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib and object z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
>>> 1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
>>> [...]
>>> 1>RepliKator04 - 13 error(s), 0 warning(s)
>>> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>>> 
>>> 
>>> As I am a Mac developer, not a Windows developer, I feel lost here. What can I do to fix that issue? I really don't get why those symbols would not be defined in Release mode.
>>> 
>>> Note that my project is not an application, but a Plugin for a third party app.
>>> I link against the DLL version of log4cxx. I'd rather use a static library version, but I failed to build it so, and I could not find detailed instructions on the net to do it.
>>> 
>>> So for the time being, I am mainly interested in understanding why these link-time errors occur, and in how to fix them.
>>> 
>>> Thanks and regards.
>>> 
>>> Jean-Denis
>>> 
>>> 
>> 
>> 
> 
> 


Re: link error in release mode with Visual Studio 2008

Posted by Fabian Jacquet <fa...@gmail.com>.
<venting frustration>
Why my boss don't want I develop for MacOS X ? :-)
</venting frustration>

The class déclaration must be __declspec(export) when you compile the dll
and must be __declspec(import) when you include .h from this dll. So it's
correct in your error message.
It's possible that the missing symbols declarations didn't have
__declspec(export) when you compiled log4cxx.dll

Did you take sources from SVN? I compiled the source downloaded from the web
site with VisualStudio 2008 without any problem.


On Fri, May 7, 2010 at 14:12, Jean-Denis Muys <jd...@mac.com> wrote:

> When setting the linker verbose, it indeed reports that it is searching
> log4cxx.lib.
> When setting fully verbose, it even reports *finding* symbols in
> log4cxx.lib with the file that references them.
> So indeed, the linker finds log4cxx.lib AND manages to find some of the
> symbols I use.
> Also, it seems that all the found symbols have a __thiscall declaration,
> while all the ones that are *not* found have a __stdcall declaration.
>
> I have no idea whether this has any significance.
>
> regarding the __declspec thing, I noticed that the linker says the symbols
> it cannot find are __declspec(import), not __declspec(export). What are the
> differences between these two? Could it be that the "export" variations are
> in the log4cxx.lib file but cannot be matched to the "import" variation it's
> looking for?
>
> <venting frustration>
> Why is the Windows platform so poorly designed? None of those charades are
> necessary on the BSD architecture that MacOS X is built upon!
> </venting frustration>
>
> I am not sure what I can do next. I'll try to look for those symbols in the
> log4cxx source to check their declarations.
>
> Jean-Denis
>
>
>
> On May 7, 2010, at 12:02 , Fabian Jacquet wrote:
>
> Mh, maybe those symbols are in the DLL but not in the lib. To be in the
> lib, it must have __declspec(dllexport) when compiling.
> log4cxx use this define to do this:
> #if defined(LOG4CXX_STATIC)
> #define LOG4CXX_EXPORT
> //   definitions used when building DLL
> #elif defined(LOG4CXX)
> #define LOG4CXX_EXPORT __declspec(dllexport)
> #else
> //    definitions used when using DLL
> #define LOG4CXX_EXPORT __declspec(dllimport)
> #endif
>
> So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
> and
> "LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your
> project.
>
> If for some reason, LOG4CXX_STATIC is defined, it's possible that some
> symbols are not exported. But I don't know how it's possible.
>
> If you don't use more than those 13 symbols maybe nothing is exported or
> maybe the link don't use log4cxx.lib.
> You can check the list of lib used by the linker like this:
> Project properties>Linker>General>Show Progress = /VERBOSE:LIB
> The linker will dump the lib list in the output window of visual studio
> when compiling. Check that you have something like that:
> 1>    Searching [your directories]\log4cxx.lib:
>
> I don't know any tools to check symbols. I think you could check with
> notepad, you can search about "getLogger" by example but if you find it, I
> don't know if you can conclude that the symbol is right exported. If you
> don't find it, I think the problem comes from the lib :-)
>
> On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com> wrote:
>
>> Thanks for answering. I wish the solution was that simple. I apologize for
>> not explicitly mentioning it, but my project is - I think - set up
>> correctly.
>>
>> That is:
>>
>> - both the Debug and Release configurations mention log4cxx.lib in its
>> Linker>Input>Additional Dependencies
>> - both the Debug and Release configurations mention a *different*
>> directory in Linker>General>Additional Library Directories. They are
>> different because they point to the Debug version and the Relase version of
>> loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug
>> and apache-log4cxx-0.10.0\projects\Release)
>>
>>
>> Of course both configurations of log4cxx were previously built with no
>> failure (from its Visual Studio project). They were built in "DLL" mode as
>> explained on the log4cxx web site. While doing a static library version is
>> on my todo list, I'd rather solve the present issue first.
>>
>> At this point in time, I suppose the 13 missing symbols are present in the
>> Debug version of the log4cxx.lib stub library, but not in the Release
>> version. How can I verify this hypothesis? What could explain that? How can
>> I fix it?
>>
>> Another hypothesis might be that there is yet another dependency that
>> needs to be set in Release mode only. This seems less plausible though. And
>> what would it be?
>>
>> Again, thanks for you answer. Any other idea on how I could make progress
>> on this issue?
>>
>> Regards,
>>
>> Jean-Denis
>>
>>
>> On May 7, 2010, at 10:29 , Fabian Jacquet wrote:
>>
>> Hi,
>>
>> The project configuration is different between debug and release. In debug
>> you certainly added log4cxx.lib in the field "Linker/Input/Additional
>> dependencies" but you have a drop-down which select the configuration, if
>> you switch to release, I think you don't have log4cxx.lib in "Additional
>> dependencies" .
>>
>> Don't forget to add the directory of this lib in the field
>> "Linker/General/Additional Library Directories"
>>
>> log4cxx.lib is not really a static lib. It's only the interface to the dll
>> class and functions.
>>
>> I hope it help you.
>>
>> On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com> wrote:
>>
>>> Hi,
>>>
>>> I have a Visual Studio 2008 project using log4cxx that links (and runs)
>>> fine in Debug mode using the Debug version of log4cxx, but fails to link in
>>> Release mode using the release version of log4cxx. Here are the 13 undefined
>>> symbols:
>>>
>>>
>>> 1>------ Build started: Project: RepliKator04, Configuration: Release
>>> Win32 ------
>>> 1>Linking...
>>> 1>   Creating library
>>> z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib
>>> and object
>>> z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
>>> 1>RKConnector.obj : error LNK2001: unresolved external symbol
>>> "__declspec(dllimport) public: static class
>>> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall
>>> log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@
>>> @SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
>>> [...]
>>> 1>RepliKator04 - 13 error(s), 0 warning(s)
>>> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
>>> ==========
>>>
>>>
>>> As I am a Mac developer, not a Windows developer, I feel lost here. What
>>> can I do to fix that issue? I really don't get why those symbols would not
>>> be defined in Release mode.
>>>
>>> Note that my project is not an application, but a Plugin for a third
>>> party app.
>>> I link against the DLL version of log4cxx. I'd rather use a static
>>> library version, but I failed to build it so, and I could not find detailed
>>> instructions on the net to do it.
>>>
>>> So for the time being, I am mainly interested in understanding why these
>>> link-time errors occur, and in how to fix them.
>>>
>>> Thanks and regards.
>>>
>>> Jean-Denis
>>>
>>>
>>
>>
>
>

Re: link error in release mode with Visual Studio 2008

Posted by Jean-Denis Muys <jd...@mac.com>.
When setting the linker verbose, it indeed reports that it is searching log4cxx.lib.
When setting fully verbose, it even reports *finding* symbols in log4cxx.lib with the file that references them.
So indeed, the linker finds log4cxx.lib AND manages to find some of the symbols I use.
Also, it seems that all the found symbols have a __thiscall declaration, while all the ones that are *not* found have a __stdcall declaration.

I have no idea whether this has any significance.

regarding the __declspec thing, I noticed that the linker says the symbols it cannot find are __declspec(import), not __declspec(export). What are the differences between these two? Could it be that the "export" variations are in the log4cxx.lib file but cannot be matched to the "import" variation it's looking for?

<venting frustration>
Why is the Windows platform so poorly designed? None of those charades are necessary on the BSD architecture that MacOS X is built upon!
</venting frustration>

I am not sure what I can do next. I'll try to look for those symbols in the log4cxx source to check their declarations.

Jean-Denis



On May 7, 2010, at 12:02 , Fabian Jacquet wrote:

> Mh, maybe those symbols are in the DLL but not in the lib. To be in the lib, it must have __declspec(dllexport) when compiling.
> log4cxx use this define to do this:
> #if defined(LOG4CXX_STATIC)
> #define LOG4CXX_EXPORT
> //   definitions used when building DLL
> #elif defined(LOG4CXX)
> #define LOG4CXX_EXPORT __declspec(dllexport)
> #else
> //    definitions used when using DLL
> #define LOG4CXX_EXPORT __declspec(dllimport)
> #endif
> 
> So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
> and
> "LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your project.
> 
> If for some reason, LOG4CXX_STATIC is defined, it's possible that some symbols are not exported. But I don't know how it's possible.
> 
> If you don't use more than those 13 symbols maybe nothing is exported or maybe the link don't use log4cxx.lib.
> You can check the list of lib used by the linker like this:
> Project properties>Linker>General>Show Progress = /VERBOSE:LIB
> The linker will dump the lib list in the output window of visual studio when compiling. Check that you have something like that:
> 1>    Searching [your directories]\log4cxx.lib:
> 
> I don't know any tools to check symbols. I think you could check with notepad, you can search about "getLogger" by example but if you find it, I don't know if you can conclude that the symbol is right exported. If you don't find it, I think the problem comes from the lib :-)
> 
> On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com> wrote:
> Thanks for answering. I wish the solution was that simple. I apologize for not explicitly mentioning it, but my project is - I think - set up correctly.
> 
> That is:
> 
> - both the Debug and Release configurations mention log4cxx.lib in its Linker>Input>Additional Dependencies
> - both the Debug and Release configurations mention a *different* directory in Linker>General>Additional Library Directories. They are different because they point to the Debug version and the Relase version of loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug and apache-log4cxx-0.10.0\projects\Release)
> 
> 
> Of course both configurations of log4cxx were previously built with no failure (from its Visual Studio project). They were built in "DLL" mode as explained on the log4cxx web site. While doing a static library version is on my todo list, I'd rather solve the present issue first.
> 
> At this point in time, I suppose the 13 missing symbols are present in the Debug version of the log4cxx.lib stub library, but not in the Release version. How can I verify this hypothesis? What could explain that? How can I fix it?
> 
> Another hypothesis might be that there is yet another dependency that needs to be set in Release mode only. This seems less plausible though. And what would it be?
> 
> Again, thanks for you answer. Any other idea on how I could make progress on this issue?
> 
> Regards,
> 
> Jean-Denis
> 
> 
> On May 7, 2010, at 10:29 , Fabian Jacquet wrote:
> 
>> Hi,
>> 
>> The project configuration is different between debug and release. In debug you certainly added log4cxx.lib in the field "Linker/Input/Additional dependencies" but you have a drop-down which select the configuration, if you switch to release, I think you don't have log4cxx.lib in "Additional dependencies" .
>> 
>> Don't forget to add the directory of this lib in the field "Linker/General/Additional Library Directories"
>> 
>> log4cxx.lib is not really a static lib. It's only the interface to the dll class and functions.
>> 
>> I hope it help you.
>> 
>> On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com> wrote:
>> Hi,
>> 
>> I have a Visual Studio 2008 project using log4cxx that links (and runs) fine in Debug mode using the Debug version of log4cxx, but fails to link in Release mode using the release version of log4cxx. Here are the 13 undefined symbols:
>> 
>> 
>> 1>------ Build started: Project: RepliKator04, Configuration: Release Win32 ------
>> 1>Linking...
>> 1>   Creating library z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib and object z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
>> 1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
>> [...]
>> 1>RepliKator04 - 13 error(s), 0 warning(s)
>> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>> 
>> 
>> As I am a Mac developer, not a Windows developer, I feel lost here. What can I do to fix that issue? I really don't get why those symbols would not be defined in Release mode.
>> 
>> Note that my project is not an application, but a Plugin for a third party app.
>> I link against the DLL version of log4cxx. I'd rather use a static library version, but I failed to build it so, and I could not find detailed instructions on the net to do it.
>> 
>> So for the time being, I am mainly interested in understanding why these link-time errors occur, and in how to fix them.
>> 
>> Thanks and regards.
>> 
>> Jean-Denis
>> 
>> 
> 
> 


Re: link error in release mode with Visual Studio 2008

Posted by Fabian Jacquet <fa...@gmail.com>.
Mh, maybe those symbols are in the DLL but not in the lib. To be in the lib,
it must have __declspec(dllexport) when compiling.
log4cxx use this define to do this:
#if defined(LOG4CXX_STATIC)
#define LOG4CXX_EXPORT
//   definitions used when building DLL
#elif defined(LOG4CXX)
#define LOG4CXX_EXPORT __declspec(dllexport)
#else
//    definitions used when using DLL
#define LOG4CXX_EXPORT __declspec(dllimport)
#endif

So, "LOG4CXX_EXPORT __declspec(dllexport)" when compiling log4cxx.dll
and
"LOG4CXX_EXPORT __declspec(dllimport)" when including log4cxx.h from your
project.

If for some reason, LOG4CXX_STATIC is defined, it's possible that some
symbols are not exported. But I don't know how it's possible.

If you don't use more than those 13 symbols maybe nothing is exported or
maybe the link don't use log4cxx.lib.
You can check the list of lib used by the linker like this:
Project properties>Linker>General>Show Progress = /VERBOSE:LIB
The linker will dump the lib list in the output window of visual studio when
compiling. Check that you have something like that:
1>    Searching [your directories]\log4cxx.lib:

I don't know any tools to check symbols. I think you could check with
notepad, you can search about "getLogger" by example but if you find it, I
don't know if you can conclude that the symbol is right exported. If you
don't find it, I think the problem comes from the lib :-)

On Fri, May 7, 2010 at 11:08, Jean-Denis Muys <jd...@mac.com> wrote:

> Thanks for answering. I wish the solution was that simple. I apologize for
> not explicitly mentioning it, but my project is - I think - set up
> correctly.
>
> That is:
>
> - both the Debug and Release configurations mention log4cxx.lib in its
> Linker>Input>Additional Dependencies
> - both the Debug and Release configurations mention a *different* directory
> in Linker>General>Additional Library Directories. They are different because
> they point to the Debug version and the Relase version of loc4cxx
> respectively (apache-log4cxx-0.10.0\projects\Debug
> and apache-log4cxx-0.10.0\projects\Release)
>
>
> Of course both configurations of log4cxx were previously built with no
> failure (from its Visual Studio project). They were built in "DLL" mode as
> explained on the log4cxx web site. While doing a static library version is
> on my todo list, I'd rather solve the present issue first.
>
> At this point in time, I suppose the 13 missing symbols are present in the
> Debug version of the log4cxx.lib stub library, but not in the Release
> version. How can I verify this hypothesis? What could explain that? How can
> I fix it?
>
> Another hypothesis might be that there is yet another dependency that needs
> to be set in Release mode only. This seems less plausible though. And what
> would it be?
>
> Again, thanks for you answer. Any other idea on how I could make progress
> on this issue?
>
> Regards,
>
> Jean-Denis
>
>
> On May 7, 2010, at 10:29 , Fabian Jacquet wrote:
>
> Hi,
>
> The project configuration is different between debug and release. In debug
> you certainly added log4cxx.lib in the field "Linker/Input/Additional
> dependencies" but you have a drop-down which select the configuration, if
> you switch to release, I think you don't have log4cxx.lib in "Additional
> dependencies" .
>
> Don't forget to add the directory of this lib in the field
> "Linker/General/Additional Library Directories"
>
> log4cxx.lib is not really a static lib. It's only the interface to the dll
> class and functions.
>
> I hope it help you.
>
> On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com> wrote:
>
>> Hi,
>>
>> I have a Visual Studio 2008 project using log4cxx that links (and runs)
>> fine in Debug mode using the Debug version of log4cxx, but fails to link in
>> Release mode using the release version of log4cxx. Here are the 13 undefined
>> symbols:
>>
>>
>> 1>------ Build started: Project: RepliKator04, Configuration: Release
>> Win32 ------
>> 1>Linking...
>> 1>   Creating library
>> z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib
>> and object
>> z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
>> 1>RKConnector.obj : error LNK2001: unresolved external symbol
>> "__declspec(dllimport) public: static class
>> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall
>> log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@
>> @SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
>> [...]
>> 1>RepliKator04 - 13 error(s), 0 warning(s)
>> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
>> ==========
>>
>>
>> As I am a Mac developer, not a Windows developer, I feel lost here. What
>> can I do to fix that issue? I really don't get why those symbols would not
>> be defined in Release mode.
>>
>> Note that my project is not an application, but a Plugin for a third party
>> app.
>> I link against the DLL version of log4cxx. I'd rather use a static library
>> version, but I failed to build it so, and I could not find detailed
>> instructions on the net to do it.
>>
>> So for the time being, I am mainly interested in understanding why these
>> link-time errors occur, and in how to fix them.
>>
>> Thanks and regards.
>>
>> Jean-Denis
>>
>>
>
>

Re: link error in release mode with Visual Studio 2008

Posted by Jean-Denis Muys <jd...@mac.com>.
Thanks for answering. I wish the solution was that simple. I apologize for not explicitly mentioning it, but my project is - I think - set up correctly.

That is:

- both the Debug and Release configurations mention log4cxx.lib in its Linker>Input>Additional Dependencies
- both the Debug and Release configurations mention a *different* directory in Linker>General>Additional Library Directories. They are different because they point to the Debug version and the Relase version of loc4cxx respectively (apache-log4cxx-0.10.0\projects\Debug and apache-log4cxx-0.10.0\projects\Release)


Of course both configurations of log4cxx were previously built with no failure (from its Visual Studio project). They were built in "DLL" mode as explained on the log4cxx web site. While doing a static library version is on my todo list, I'd rather solve the present issue first.

At this point in time, I suppose the 13 missing symbols are present in the Debug version of the log4cxx.lib stub library, but not in the Release version. How can I verify this hypothesis? What could explain that? How can I fix it?

Another hypothesis might be that there is yet another dependency that needs to be set in Release mode only. This seems less plausible though. And what would it be?

Again, thanks for you answer. Any other idea on how I could make progress on this issue?

Regards,

Jean-Denis


On May 7, 2010, at 10:29 , Fabian Jacquet wrote:

> Hi,
> 
> The project configuration is different between debug and release. In debug you certainly added log4cxx.lib in the field "Linker/Input/Additional dependencies" but you have a drop-down which select the configuration, if you switch to release, I think you don't have log4cxx.lib in "Additional dependencies" .
> 
> Don't forget to add the directory of this lib in the field "Linker/General/Additional Library Directories"
> 
> log4cxx.lib is not really a static lib. It's only the interface to the dll class and functions.
> 
> I hope it help you.
> 
> On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com> wrote:
> Hi,
> 
> I have a Visual Studio 2008 project using log4cxx that links (and runs) fine in Debug mode using the Debug version of log4cxx, but fails to link in Release mode using the release version of log4cxx. Here are the 13 undefined symbols:
> 
> 
> 1>------ Build started: Project: RepliKator04, Configuration: Release Win32 ------
> 1>Linking...
> 1>   Creating library z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib and object z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
> 1>RKConnector.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@@SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
> [...]
> 1>RepliKator04 - 13 error(s), 0 warning(s)
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
> 
> 
> As I am a Mac developer, not a Windows developer, I feel lost here. What can I do to fix that issue? I really don't get why those symbols would not be defined in Release mode.
> 
> Note that my project is not an application, but a Plugin for a third party app.
> I link against the DLL version of log4cxx. I'd rather use a static library version, but I failed to build it so, and I could not find detailed instructions on the net to do it.
> 
> So for the time being, I am mainly interested in understanding why these link-time errors occur, and in how to fix them.
> 
> Thanks and regards.
> 
> Jean-Denis
> 
> 


Re: link error in release mode with Visual Studio 2008

Posted by Fabian Jacquet <fa...@gmail.com>.
Hi,

The project configuration is different between debug and release. In debug
you certainly added log4cxx.lib in the field "Linker/Input/Additional
dependencies" but you have a drop-down which select the configuration, if
you switch to release, I think you don't have log4cxx.lib in "Additional
dependencies" .

Don't forget to add the directory of this lib in the field
"Linker/General/Additional Library Directories"

log4cxx.lib is not really a static lib. It's only the interface to the dll
class and functions.

I hope it help you.

On Fri, May 7, 2010 at 04:00, Jean-Denis Muys <jd...@mac.com> wrote:

> Hi,
>
> I have a Visual Studio 2008 project using log4cxx that links (and runs)
> fine in Debug mode using the Debug version of log4cxx, but fails to link in
> Release mode using the release version of log4cxx. Here are the 13 undefined
> symbols:
>
>
> 1>------ Build started: Project: RepliKator04, Configuration: Release Win32
> ------
> 1>Linking...
> 1>   Creating library
> z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.lib
> and object
> z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.exp
> 1>RKConnector.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall
> log4cxx::Level::getTrace(void)" (__imp_?getTrace@Level@log4cxx@
> @SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
> 1>RKConnector.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall
> log4cxx::Level::getDebug(void)" (__imp_?getDebug@Level@log4cxx@
> @SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
> 1>RKConnector.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall
> log4cxx::Level::getInfo(void)" (__imp_?getInfo@Level@log4cxx@
> @SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
> 1>RKConnector.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall
> log4cxx::Level::getWarn(void)" (__imp_?getWarn@Level@log4cxx@
> @SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
> 1>RKConnector.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall
> log4cxx::Level::getError(void)" (__imp_?getError@Level@log4cxx@
> @SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
> 1>4DPlugin.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __stdcall
> log4cxx::Logger::getRootLogger(void)" (__imp_?getRootLogger@Logger
> @log4cxx@@SG?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@2@XZ)
> 1>4DPlugin.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __stdcall
> log4cxx::Logger::getLogger(char const * const)" (__imp_?getLogger@Logger
> @log4cxx@@SG?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@2@QBD@Z)
> 1>4DPlugin.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static void __stdcall
> log4cxx::BasicConfigurator::configure(void)"
> (__imp_?configure@BasicConfigurator@log4cxx@@SGXXZ)
> 1>4DPlugin.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static void __stdcall
> log4cxx::PropertyConfigurator::configure(class log4cxx::File const &)"
> (__imp_?configure@PropertyConfigurator@log4cxx@@SGXABVFile@2@@Z)
> 1>RKReplikator.connection.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall
> log4cxx::Level::getOff(void)" (__imp_?getOff@Level@log4cxx@
> @SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
> 1>RKReplikator.connection.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> __stdcall
> log4cxx::Level::getFatal(void)" (__imp_?getFatal@Level@log4cxx@
> @SG?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ)
> 1>RKReplikator.connection.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __stdcall
> log4cxx::Logger::getLogger(class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> > const &)"
> (__imp_?getLogger@Logger@log4cxx@@SG?AV?$ObjectPtrT@VLogger@log4cxx@
> @@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@
> @std@@@Z)
> 1>z:\PCdev\RepliKator2004\RK_Demo_2004\plugins\RepliKator04.bundle\contents\windows\RepliKator04.4DX
> : fatal error LNK1120: 13 unresolved externals
> 1>Build log was saved at
> "file://Z:\PCdev\RepliKator2004\Objs\Release\BuildLog.htm"
> 1>RepliKator04 - 13 error(s), 0 warning(s)
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>
>
> As I am a Mac developer, not a Windows developer, I feel lost here. What
> can I do to fix that issue? I really don't get why those symbols would not
> be defined in Release mode.
>
> Note that my project is not an application, but a Plugin for a third party
> app.
> I link against the DLL version of log4cxx. I'd rather use a static library
> version, but I failed to build it so, and I could not find detailed
> instructions on the net to do it.
>
> So for the time being, I am mainly interested in understanding why these
> link-time errors occur, and in how to fix them.
>
> Thanks and regards.
>
> Jean-Denis
>
>