logger RT not compiling on project.

Dear developers,

I try to integrate the logger RT into my project top subsitute the current log4cxx on it. The problem is that all sourcecode compile correctly, but the Linker has not a correct reference into the scripts in order to load the library when it is executed. [ log4cpp::Category is not a avaliable object ]

>  make
Makefile:7: This Makefile builds this package with default settings
mkdir -p build
cd build ; cmake .. -DINSTALL_PATH=orocos && make
Detected OROCOS_TARGET environment variable. Using: gnulinux
Orocos-RTT found in /media/DATA/orocos-toolchain/install/lib/cmake/orocos-rtt/orocos-rtt-gnulinux-libraries.cmake
-- Found orocos-rtt  for the gnulinux target. Available transports: corba mqueue
-- - Found requested orocos-rtt components: rtt-marshalling rtt-scripting
[UseOrocos] Building package mydriver
[UseOrocos] Building component mydriver in library mydriver-gnulinux
[UseOrocos] Generating package version 1.0 (default version).
-- Configuring done
-- Generating done
-- Build files have been written to: /media/DATA/orocos-toolchain/projects/mydriver/build
make[1]: Entering directory `/media/DATA/orocos-toolchain/projects/mydriver/build'
make[2]: Entering directory `/media/DATA/orocos-toolchain/projects/mydriver/build'
make[3]: Entering directory `/media/DATA/orocos-toolchain/projects/mydriver/build'
make[3]: Leaving directory `/media/DATA/orocos-toolchain/projects/mydriver/build'
make[3]: Entering directory `/media/DATA/orocos-toolchain/projects/mydriver/build'
Linking CXX shared library libmydriver-gnulinux.so
CMakeFiles/mydriver.dir/src/mydriver-component.cpp.o: In function `mydriver(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
mydriver-component.cpp:(.text+0x32b): undefined reference to `log4cpp::Category::getInstance(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
mydriver-component.cpp:(.text+0x346): undefined reference to `typeinfo for OCL::logging::Category'
mydriver-component.cpp:(.text+0x350): undefined reference to `typeinfo for log4cpp::Category'

Any suggestions? Thanks in advance, Toni

logger RT not compiling on project.

2011/10/10 antonio [dot] castellon [..] ... <antonio [dot] castellon [..] ...>:
> Dear developers,
>
> I try to integrate the logger RT into my project top subsitute the current log4cxx on it.
> The problem is that all sourcecode compile correctly, but the Linker has not a correct reference into the scripts in order to load the library when it is executed.
> [ log4cpp::Category is not a avaliable object ]
>
> &#10;&gt;&#10;&gt;&gt;  make&#10;&gt; Makefile:7: This Makefile builds this package with default settings&#10;&gt; mkdir -p build&#10;&gt; cd build ; cmake .. -DINSTALL_PATH=orocos &amp;&amp; make&#10;&gt; Detected OROCOS_TARGET environment variable. Using: gnulinux&#10;&gt; Orocos-RTT found in /media/DATA/orocos-toolchain/install/lib/cmake/orocos-rtt/orocos-rtt-gnulinux-libraries.cmake&#10;&gt; -- Found orocos-rtt  for the gnulinux target. Available transports: corba mqueue&#10;&gt; -- - Found requested orocos-rtt components: rtt-marshalling rtt-scripting&#10;&gt; [UseOrocos] Building package mydriver&#10;&gt; [UseOrocos] Building component mydriver in library mydriver-gnulinux&#10;&gt; [UseOrocos] Generating package version 1.0 (default version).&#10;&gt; -- Configuring done&#10;&gt; -- Generating done&#10;&gt; -- Build files have been written to: /media/DATA/orocos-toolchain/projects/mydriver/build&#10;&gt; make[1]: Entering directory `/media/DATA/orocos-toolchain/projects/mydriver/build&#039;&#10;&gt; make[2]: Entering directory `/media/DATA/orocos-toolchain/projects/mydriver/build&#039;&#10;&gt; make[3]: Entering directory `/media/DATA/orocos-toolchain/projects/mydriver/build&#039;&#10;&gt; make[3]: Leaving directory `/media/DATA/orocos-toolchain/projects/mydriver/build&#039;&#10;&gt; make[3]: Entering directory `/media/DATA/orocos-toolchain/projects/mydriver/build&#039;&#10;&gt; Linking CXX shared library libmydriver-gnulinux.so&#10;&gt; CMakeFiles/mydriver.dir/src/mydriver-component.cpp.o: In function `mydriver(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)&#039;:&#10;&gt; mydriver-component.cpp:(.text+0x32b): undefined reference to `log4cpp::Category::getInstance(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)&#039;&#10;&gt; mydriver-component.cpp:(.text+0x346): undefined reference to `typeinfo for OCL::logging::Category&#039;&#10;&gt; mydriver-component.cpp:(.text+0x350): undefined reference to `typeinfo for log4cpp::Category&#039;&#10;&gt;&#10;&gt;
>
> Any suggestions?

Did you add a line like

&#10;orocos_use_package(ocl-logging)&#10;

in your CMakeLists.txt?

Steven

> Thanks in advance,
> Toni
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

enkulator's picture

logger RT not compiling on project.

Sorry Steven

I'm sure that I put this tag in incorrect line.... I move it from the
begining of the file to the last lines, but the error for the linker not
dissapear.

> make
Makefile:7: This Makefile builds this package with default settings
mkdir -p build
cd build ; cmake .. -DINSTALL_PATH=orocos && make
Detected OROCOS_TARGET environment variable. Using: gnulinux
Orocos-RTT found in
/media/DATA/orocos-toolchain/install/lib/cmake/orocos-rtt/orocos-rtt-gnulinux-libraries.cmake
-- Found orocos-rtt for the gnulinux target. Available transports: corba
mqueue
-- - Found requested orocos-rtt components: rtt-marshalling rtt-scripting
[UseOrocos] Building package mydriver
[UseOrocos] Building component mydriver in library mydriver-gnulinux
[UseOrocos] Generating package version 1.0 (default version).
[UseOrocos] Linking all targets with libraries from package 'ocl-logging'.
-- Configuring done
-- Generating done
-- Build files have been written to:

*[...]*

mydriver-component.cpp:(.text+0x32b): *undefined reference to
`log4cpp::Category::getInstance(*std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)'
mydriver-component.cpp:(.text+0x346): undefined reference to `typeinfo for
OCL::logging::Category'
mydriver-component.cpp:(.text+0x350): undefined reference to `typeinfo for
log4cpp::Category'

More ideas?

thanks in advance.

logger RT not compiling on project.

2011/10/10 Antonio Castellon <antonio [dot] castellon [..] ...>

> Sorry Steven
>
> I'm sure that I put this tag in incorrect line.... I move it from the
> begining of the file to the last lines, but the error for the linker not
> dissapear.
>
>
> > make
> Makefile:7: This Makefile builds this package with default settings
> mkdir -p build
> cd build ; cmake .. -DINSTALL_PATH=orocos && make
> Detected OROCOS_TARGET environment variable. Using: gnulinux
> Orocos-RTT found in
> /media/DATA/orocos-toolchain/install/lib/cmake/orocos-rtt/orocos-rtt-gnulinux-libraries.cmake
> -- Found orocos-rtt for the gnulinux target. Available transports: corba
> mqueue
> -- - Found requested orocos-rtt components: rtt-marshalling rtt-scripting
> [UseOrocos] Building package mydriver
> [UseOrocos] Building component mydriver in library mydriver-gnulinux
> [UseOrocos] Generating package version 1.0 (default version).
> [UseOrocos] Linking all targets with libraries from package 'ocl-logging'.
> -- Configuring done
> -- Generating done
> -- Build files have been written to:
>
> *[...]*
>
> mydriver-component.cpp:(.text+0x32b): *undefined reference to
> `log4cpp::Category::getInstance(*std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> mydriver-component.cpp:(.text+0x346): undefined reference to `typeinfo for
> OCL::logging::Category'
> mydriver-component.cpp:(.text+0x350): undefined reference to `typeinfo for
> log4cpp::Category'
>
>
> More ideas?
>
> thanks in advance.
>
>

Are you using Orocos in the ROS environment? If not, it seems that you
didn't link explicitly with log4cpp. The macro 'orocos_use_package' look at
the .pc file to find which libraries need to be linked. However, in the case
of ocl-logging, the log4cpp library is missing in the pkg-config file. You
have two options:

- Modify the .pc file of ocl-logging (somewhere in
/usr/local/lib/pkg-config/)
- Link with log4cpp in your CMakeLists.txt using
target_link_librairies(your_target log4cpp)

Philippe

logger RT not compiling on project.

On Monday 10 October 2011 18:53:30 Philippe Hamelin wrote:
> 2011/10/10 Antonio Castellon <antonio [dot] castellon [..] ...>
>
> > Sorry Steven
> >
> > I'm sure that I put this tag in incorrect line.... I move it from the
> > begining of the file to the last lines, but the error for the linker not
> > dissapear.
> >
> > > make
> >
> > Makefile:7: This Makefile builds this package with default settings
> > mkdir -p build
> > cd build ; cmake .. -DINSTALL_PATH=orocos && make
> > Detected OROCOS_TARGET environment variable. Using: gnulinux
> > Orocos-RTT found in
> > /media/DATA/orocos-toolchain/install/lib/cmake/orocos-rtt/orocos-rtt-gnul
> > inux-libraries.cmake -- Found orocos-rtt for the gnulinux target.
> > Available transports: corba mqueue
> > -- - Found requested orocos-rtt components: rtt-marshalling rtt-scripting
> > [UseOrocos] Building package mydriver
> > [UseOrocos] Building component mydriver in library mydriver-gnulinux
> > [UseOrocos] Generating package version 1.0 (default version).
> > [UseOrocos] Linking all targets with libraries from package
> > 'ocl-logging'. -- Configuring done
> > -- Generating done
> > -- Build files have been written to:
> >
> > *[...]*
> >
> > mydriver-component.cpp:(.text+0x32b): *undefined reference to
> > `log4cpp::Category::getInstance(*std::basic_string<char,
> > std::char_traits<char>, std::allocator<char> > const&)'
> > mydriver-component.cpp:(.text+0x346): undefined reference to `typeinfo
> > for OCL::logging::Category'
> > mydriver-component.cpp:(.text+0x350): undefined reference to `typeinfo
> > for log4cpp::Category'
> >
> >
> > More ideas?
> >
> > thanks in advance.
>
> Are you using Orocos in the ROS environment? If not, it seems that you
> didn't link explicitly with log4cpp. The macro 'orocos_use_package' look at
> the .pc file to find which libraries need to be linked. However, in the
> case of ocl-logging, the log4cpp library is missing in the pkg-config
> file.

Is this a bug then ?

Shouldn't the ocl-logging .pc depend on the log4cpp .pc file ?

Peter

logger RT not compiling on project.

2011/10/11 Peter Soetens <peter [..] ...>

> On Monday 10 October 2011 18:53:30 Philippe Hamelin wrote:
> > 2011/10/10 Antonio Castellon <antonio [dot] castellon [..] ...>
> >
> > > Sorry Steven
> > >
> > > I'm sure that I put this tag in incorrect line.... I move it from the
> > > begining of the file to the last lines, but the error for the linker
> not
> > > dissapear.
> > >
> > > > make
> > >
> > > Makefile:7: This Makefile builds this package with default settings
> > > mkdir -p build
> > > cd build ; cmake .. -DINSTALL_PATH=orocos && make
> > > Detected OROCOS_TARGET environment variable. Using: gnulinux
> > > Orocos-RTT found in
> > >
> /media/DATA/orocos-toolchain/install/lib/cmake/orocos-rtt/orocos-rtt-gnul
> > > inux-libraries.cmake -- Found orocos-rtt for the gnulinux target.
> > > Available transports: corba mqueue
> > > -- - Found requested orocos-rtt components: rtt-marshalling
> rtt-scripting
> > > [UseOrocos] Building package mydriver
> > > [UseOrocos] Building component mydriver in library mydriver-gnulinux
> > > [UseOrocos] Generating package version 1.0 (default version).
> > > [UseOrocos] Linking all targets with libraries from package
> > > 'ocl-logging'. -- Configuring done
> > > -- Generating done
> > > -- Build files have been written to:
> > >
> > > *[...]*
> > >
> > > mydriver-component.cpp:(.text+0x32b): *undefined reference to
> > > `log4cpp::Category::getInstance(*std::basic_string<char,
> > > std::char_traits<char>, std::allocator<char> > const&)'
> > > mydriver-component.cpp:(.text+0x346): undefined reference to `typeinfo
> > > for OCL::logging::Category'
> > > mydriver-component.cpp:(.text+0x350): undefined reference to `typeinfo
> > > for log4cpp::Category'
> > >
> > >
> > > More ideas?
> > >
> > > thanks in advance.
> >
> > Are you using Orocos in the ROS environment? If not, it seems that you
> > didn't link explicitly with log4cpp. The macro 'orocos_use_package' look
> at
> > the .pc file to find which libraries need to be linked. However, in the
> > case of ocl-logging, the log4cpp library is missing in the pkg-config
> > file.
>
> Is this a bug then ?
>
> Shouldn't the ocl-logging .pc depend on the log4cpp .pc file ?
>
>
Yes this is a bug. I don't personaly use the 'orocos_use_package' macro and
pkg-config files, so I will let you select the best fix.

Philippe

logger RT not compiling on project.

On Tuesday 11 October 2011 14:49:48 Philippe Hamelin wrote:
> 2011/10/11 Peter Soetens <peter [..] ...>
>
> > On Monday 10 October 2011 18:53:30 Philippe Hamelin wrote:
> > > 2011/10/10 Antonio Castellon <antonio [dot] castellon [..] ...>
> > >
> > > > Sorry Steven
> > > >
> > > > I'm sure that I put this tag in incorrect line.... I move it from the
> > > > begining of the file to the last lines, but the error for the linker
> >
> > not
> >
> > > > dissapear.
> > > >
> > > > > make
> > > >
> > > > Makefile:7: This Makefile builds this package with default settings
> > > > mkdir -p build
> > > > cd build ; cmake .. -DINSTALL_PATH=orocos && make
> > > > Detected OROCOS_TARGET environment variable. Using: gnulinux
> > > > Orocos-RTT found in
> >
> > /media/DATA/orocos-toolchain/install/lib/cmake/orocos-rtt/orocos-rtt-gnul
> >
> > > > inux-libraries.cmake -- Found orocos-rtt for the gnulinux target.
> > > > Available transports: corba mqueue
> > > > -- - Found requested orocos-rtt components: rtt-marshalling
> >
> > rtt-scripting
> >
> > > > [UseOrocos] Building package mydriver
> > > > [UseOrocos] Building component mydriver in library mydriver-gnulinux
> > > > [UseOrocos] Generating package version 1.0 (default version).
> > > > [UseOrocos] Linking all targets with libraries from package
> > > > 'ocl-logging'. -- Configuring done
> > > > -- Generating done
> > > > -- Build files have been written to:
> > > >
> > > > *[...]*
> > > >
> > > > mydriver-component.cpp:(.text+0x32b): *undefined reference to
> > > > `log4cpp::Category::getInstance(*std::basic_string<char,
> > > > std::char_traits<char>, std::allocator<char> > const&)'
> > > > mydriver-component.cpp:(.text+0x346): undefined reference to
> > > > `typeinfo for OCL::logging::Category'
> > > > mydriver-component.cpp:(.text+0x350): undefined reference to
> > > > `typeinfo for log4cpp::Category'
> > > >
> > > >
> > > > More ideas?
> > > >
> > > > thanks in advance.
> > >
> > > Are you using Orocos in the ROS environment? If not, it seems that you
> > > didn't link explicitly with log4cpp. The macro 'orocos_use_package'
> > > look
> >
> > at
> >
> > > the .pc file to find which libraries need to be linked. However, in the
> > > case of ocl-logging, the log4cpp library is missing in the pkg-config
> > > file.
> >
> > Is this a bug then ?
> >
> > Shouldn't the ocl-logging .pc depend on the log4cpp .pc file ?
>
> Yes this is a bug. I don't personaly use the 'orocos_use_package' macro and
> pkg-config files, so I will let you select the best fix.

I have fixed this on the OCL master/2.5 branches. One can specify dependencies
in the orocos_use_package macro.

Peter

enkulator's picture

logger RT not compiling on project.

Hi Peter & Cia, I include the* target_link_libraries(mydriver log4cpp) *and
apparently all is working fine.

logger RT not compiling on project.

On Oct 11, 2011, at 07:21 , Peter Soetens wrote:

> On Monday 10 October 2011 18:53:30 Philippe Hamelin wrote:
>> 2011/10/10 Antonio Castellon <antonio [dot] castellon [..] ...>
>>
>>> Sorry Steven
>>>
>>> I'm sure that I put this tag in incorrect line.... I move it from the
>>> begining of the file to the last lines, but the error for the linker not
>>> dissapear.
>>>
>>>> make
>>>
>>> Makefile:7: This Makefile builds this package with default settings
>>> mkdir -p build
>>> cd build ; cmake .. -DINSTALL_PATH=orocos && make
>>> Detected OROCOS_TARGET environment variable. Using: gnulinux
>>> Orocos-RTT found in
>>> /media/DATA/orocos-toolchain/install/lib/cmake/orocos-rtt/orocos-rtt-gnul
>>> inux-libraries.cmake -- Found orocos-rtt for the gnulinux target.
>>> Available transports: corba mqueue
>>> -- - Found requested orocos-rtt components: rtt-marshalling rtt-scripting
>>> [UseOrocos] Building package mydriver
>>> [UseOrocos] Building component mydriver in library mydriver-gnulinux
>>> [UseOrocos] Generating package version 1.0 (default version).
>>> [UseOrocos] Linking all targets with libraries from package
>>> 'ocl-logging'. -- Configuring done
>>> -- Generating done
>>> -- Build files have been written to:
>>>
>>> *[...]*
>>>
>>> mydriver-component.cpp:(.text+0x32b): *undefined reference to
>>> `log4cpp::Category::getInstance(*std::basic_string<char,
>>> std::char_traits<char>, std::allocator<char> > const&)'
>>> mydriver-component.cpp:(.text+0x346): undefined reference to `typeinfo
>>> for OCL::logging::Category'
>>> mydriver-component.cpp:(.text+0x350): undefined reference to `typeinfo
>>> for log4cpp::Category'
>>>
>>>
>>> More ideas?
>>>
>>> thanks in advance.
>>
>> Are you using Orocos in the ROS environment? If not, it seems that you
>> didn't link explicitly with log4cpp. The macro 'orocos_use_package' look at
>> the .pc file to find which libraries need to be linked. However, in the
>> case of ocl-logging, the log4cpp library is missing in the pkg-config
>> file.
>
> Is this a bug then ?
>
> Shouldn't the ocl-logging .pc depend on the log4cpp .pc file ?

I was going to ask the same think. Sounds like a bug to me ...

enkulator's picture

logger RT not compiling on project.

Thank's too much Phillipe, all compile successfull
toni

On Mon, Oct 10, 2011 at 18:53, Philippe Hamelin
<philippe [dot] hamelin [..] ...>wrote:

> 2011/10/10 Antonio Castellon <antonio [dot] castellon [..] ...>
>
>> Sorry Steven
>>
>> I'm sure that I put this tag in incorrect line.... I move it from the
>> begining of the file to the last lines, but the error for the linker not
>> dissapear.
>>
>>
>> > make
>> Makefile:7: This Makefile builds this package with default settings
>> mkdir -p build
>> cd build ; cmake .. -DINSTALL_PATH=orocos && make
>> Detected OROCOS_TARGET environment variable. Using: gnulinux
>> Orocos-RTT found in
>> /media/DATA/orocos-toolchain/install/lib/cmake/orocos-rtt/orocos-rtt-gnulinux-libraries.cmake
>> -- Found orocos-rtt for the gnulinux target. Available transports: corba
>> mqueue
>> -- - Found requested orocos-rtt components: rtt-marshalling rtt-scripting
>> [UseOrocos] Building package mydriver
>> [UseOrocos] Building component mydriver in library mydriver-gnulinux
>> [UseOrocos] Generating package version 1.0 (default version).
>> [UseOrocos] Linking all targets with libraries from package 'ocl-logging'.
>> -- Configuring done
>> -- Generating done
>> -- Build files have been written to:
>>
>> *[...]*
>>
>> mydriver-component.cpp:(.text+0x32b): *undefined reference to
>> `log4cpp::Category::getInstance(*std::basic_string<char,
>> std::char_traits<char>, std::allocator<char> > const&)'
>> mydriver-component.cpp:(.text+0x346): undefined reference to `typeinfo for
>> OCL::logging::Category'
>> mydriver-component.cpp:(.text+0x350): undefined reference to `typeinfo for
>> log4cpp::Category'
>>
>>
>> More ideas?
>>
>> thanks in advance.
>>
>>
>
> Are you using Orocos in the ROS environment? If not, it seems that you
> didn't link explicitly with log4cpp. The macro 'orocos_use_package' look at
> the .pc file to find which libraries need to be linked. However, in the case
> of ocl-logging, the log4cpp library is missing in the pkg-config file. You
> have two options:
>
> - Modify the .pc file of ocl-logging (somewhere in
> /usr/local/lib/pkg-config/)
> - Link with log4cpp in your CMakeLists.txt using
> target_link_librairies(your_target log4cpp)
>
>
> Philippe
>
>

enkulator's picture

logger RT not compiling on project.

Thanks Steven,
I put it into the CMakeList.txt, but the make not recognice this tag ¿?¿?¿?¿

make all
Makefile:7: This Makefile builds this package with default settings
mkdir -p build
cd build ; cmake .. -DINSTALL_PATH=orocos && make
CMake Error at CMakeLists.txt:12 (*orocos_use_package*):
-- Configuring incomplete, errors occurred!
*Unknown CMake command "orocos_use_package".*

make: *** [all] Error 1

logger RT not compiling on project.

2011/10/10 Antonio Castellon <antonio [dot] castellon [..] ...>:
> Thanks Steven,
> I put it into the CMakeList.txt, but the make not recognice this tag ¿?¿?¿?¿
>
> make all
> Makefile:7: This Makefile builds this package with default settings
> mkdir -p build
> cd build ; cmake .. -DINSTALL_PATH=orocos && make
> CMake Error at CMakeLists.txt:12 (orocos_use_package):
> -- Configuring incomplete, errors occurred!
>   Unknown CMake command "orocos_use_package".
> make: *** [all] Error 1

You're probably not loading the OROCOS macro's there either:

&#10;find_package(OROCOS-RTT REQUIRED ${RTT_HINTS})&#10;include(${OROCOS-RTT_USE_FILE_PATH}/UseOROCOS-RTT.cmake)&#10;orocos_use_package(ocl-logging)&#10;

and then again, you'll need to set your environment correctly in order
to have CMake find OROCOS. Sourcing the env.sh script in the toolchain
folder should do it.

Is this project an OROCOS component? Or some custom code you want to
use the OROCOS log4cpp functionality in?

Steven

>
>

enkulator's picture

logger RT not compiling on project.

Hi Steven,

I try to make an Orocos Component. I put the tag in the correct place, but
the error continues with the same trace. :-(

...¿?