logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Denis Muys <jdm...@mac.com>
Subject Re: link error in release mode with Visual Studio 2008
Date Fri, 07 May 2010 09:08:46 GMT
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 <jdmuys@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
> 
> 


Mime
View raw message