Linking problem

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Linking problem

Javier Leyba

Hi

I?m a little bit new with C++ and totally new with
log4cxx.

I'm using VC++ 6. I compiled a log4cxx static library
and the I tried to compile one of the examples that I
saw in doc page.

But at link time I got the message:


MyPrueba.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: void __thiscall
log4cxx::Logger::forcedLog(class
log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const &,class std::basic_string<char,struct
std::char_traits<
char>,class std::allocator<char> > const &,char const
*,int)"
(__imp_?forcedLog@Logger@log4cxx@@QAEXABV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBDH@Z)
MyPrueba.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: static class
log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const  log4cxx::Level::INFO"
(__imp_?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@
2@B)
MyPrueba.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: bool __thiscall
log4cxx::Logger::isInfoEnabled(void)const "
(__imp_?isInfoEnabled@Logger@log4cxx@@QBE_NXZ)
MyPrueba.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: static void
__cdecl log4cxx::PropertyConfigurator::configure(class
std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >
const &)" (_
_imp_?configure@PropertyConfigurator@log4cxx@@SAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
MyPrueba.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: static class
log4cxx::helpers::ObjectPtrT<class log4cxx::Logger>
__cdecl log4cxx::Logger::getLogger(class
std::basic_string<char,struct std::char_traits<char>,c
lass std::allocator<char> > const &)"
(__imp_?getLogger@Logger@log4cxx@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
Debug/prueba.exe : fatal error LNK1120: 5 unresolved
externals
Error executing link.exe.

Could somebody tell me what I did wrong ?

Thanks in advance

J


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ?gratis!
?Abr? tu cuenta ya! - http://correo.yahoo.com.ar
Reply | Threaded
Open this post in threaded view
|

Re: Linking problem

carnold-3

On May 4, 2005, at 5:44 AM, Javier Leyba wrote:

>
> Hi
>
> I´m a little bit new with C++ and totally new with
> log4cxx.
>
> I'm using VC++ 6. I compiled a log4cxx static library
> and the I tried to compile one of the examples that I
> saw in doc page.
>

There is an open bug report on static linking with VC
(http://issues.apache.org/jira/browse/LOGCXX-77)  and it is coming to
the top of my list, I'm not sure if that is what you are seeing
however.

Were you using a Visual Studio project generated by the Ant script or
one that you wrote on your own?  If you manually created the Visual C++
project, could you double check that you defined the preprocessor macro
LOG4CXX_STATIC?

FYI: The Ant script can produce VS6 project files for each binary
created in the build process by running:

ant build-projects-vc6

Reply | Threaded
Open this post in threaded view
|

Re[2]: Linking problem

Javier Leyba
On 04/05/2005 at 7:31 Curt Arnold wrote:

>There is an open bug report on static linking with VC
>(http://issues.apache.org/jira/browse/LOGCXX-77)  and it is coming to
>the top of my list, I'm not sure if that is what you are seeing
>however.
>
>Were you using a Visual Studio project generated by the Ant script or
>one that you wrote on your own?  If you manually created the Visual C++
>project, could you double check that you defined the preprocessor macro
>LOG4CXX_STATIC?


Hi

Thanks for your reply.

I couldn't see any ant project file ..

I come to msvc folder, loaded log4cxx.dsw file in my VC 6 and, maked static
project as active project and compiled it... If there a re a better way to
do it, just tell me.

Also, the line in install file that said:

Copy the msvc/config.h.msvc file to include/log4cxx/config.h.

is wrong because I couldn't find this file...


Now, knowing the bug with static lib, I wonder if dinamic lib works well...

Thanks in advance

J






Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: Linking problem

Curt Arnold-2
Sorry, I did not realizing that you were using the log4cxx-0.9.7
development snapshot (it shouldn't be called a release since log4cxx
was an "incubated" project at that time).  That release is quite dated,
has many serious issues and the current CVS HEAD is radically changed.  
We are trying to get the CVS HEAD in shape for a long overdue official
Apache release.  Unless you have a compelling reason to start with
log4cxx-0.9.7, I would avoid it.

The status of log4cxx-0.9.7 is discussed at
http://logging.apache.org/log4cxx/, however I see that the binary
downloads page for the overall logging services project does not
contain any discouragement from using that release.  I'll add a link to
the log4cxx page from the downloads page to discourage people from
starting with 0.9.7.

For the last few minutes, the Windows build has been broken, but when
you see another flurry of commit messages, it should be working again.


On May 4, 2005, at 12:06 PM, Javier wrote:

> On 04/05/2005 at 7:31 Curt Arnold wrote:
>
>> There is an open bug report on static linking with VC
>> (http://issues.apache.org/jira/browse/LOGCXX-77)  and it is coming to
>> the top of my list, I'm not sure if that is what you are seeing
>> however.
>>
>> Were you using a Visual Studio project generated by the Ant script or
>> one that you wrote on your own?  If you manually created the Visual
>> C++
>> project, could you double check that you defined the preprocessor
>> macro
>> LOG4CXX_STATIC?
>
>
> Hi
>
> Thanks for your reply.
>
> I couldn't see any ant project file ..
>
> I come to msvc folder, loaded log4cxx.dsw file in my VC 6 and, maked
> static
> project as active project and compiled it... If there a re a better
> way to
> do it, just tell me.
>
> Also, the line in install file that said:
>
> Copy the msvc/config.h.msvc file to include/log4cxx/config.h.
>
> is wrong because I couldn't find this file...
>
>
> Now, knowing the bug with static lib, I wonder if dinamic lib works
> well...
>
> Thanks in advance
>
> J
>
>
>
>
>
>