For example: if there is a library /usr/lib64/libABCDE.so, the to compile a program that uses this library, you have to do something like this:

gcc -o test -I/usr/local/include/ABCDE -L/usr/lib64/ -lABCDE test.cc

(-l options specified the library to link and -L describes the location of where the library can be found).

Hope this helps :)

Bye

On Wed, Mar 28, 2012 at 8:03 PM, <chris@chrishellberg.com> wrote:
Thanks Lakesh. I've specified the full path of the octave library in the linker - is my syntax ok or do I need to use -l before the library name or something else? I tried that just to check but seems to make it worse.

/chris
Enviado desde mi dispositivo BlackBerry® de Orange.

From: lakesh <lakesh.kansakar@gmail.com>
Date: Wed, 28 Mar 2012 11:48:43 -0400
To: Chris Hellberg<chris@chrishellberg.com>
Cc: Abhishek Dutta<adutta.np@gmail.com>; <rtftr-devel@lists.sourceforge.net>
Subject: Re: [Rtftr-devel] Linked libraries

Hi Chris,

I think it is the issue with linking the library I guess. You have installed the octave and boost library, they are present in the lib folder, but when you compile the project you need to provide the path to those libraries as well. Looking at the log, it shows that it couldn't find the libraries. So, I think it is the issue with the path.

On Wed, Mar 28, 2012 at 9:59 AM, Chris Hellberg <chris@chrishellberg.com> wrote:
Hi Abhishek,

Thanks - that's good to hear :)

I made a couple of changes - updated the boost filesystem to be v3
compatible and added absolute library references into the Makefiles.

But there are a couple of errors that I can't quite figure out. When I
make from the top of the source dir, I get the following compile errors
(plus many more that are similar):

make[2]: Вход в каталог `/home/chellberg/code/rtftr-0.2-ch'
g++ -DHAVE_CONFIG_H -I. -I./src -I/usr/local/include/octave-3.4.3
-I./src/adaboost -I./src/kepenekci -I./src/rowleynn -I./src/subspacelda
-I/usr/include/gtk-2.0 -I/usr/include/glib-2.0
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/glib-2.0/glib
-I/usr/include/cairo -I/usr/include/pango-1.0
-I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/include/gdk-pixbuf-2.0
-I/usr/include/atk-1.0 -I/usr/include/libxml2 -I/usr/local/include
-I/usr/include    -g -O2 -MT RtftrUserInterface.o -MD -MP -MF
.deps/RtftrUserInterface.Tpo -c -o RtftrUserInterface.o
RtftrUserInterface.cc
mv -f .deps/RtftrUserInterface.Tpo .deps/RtftrUserInterface.Po
/bin/bash ./libtool --tag=CXX   --mode=link g++  -g -O2   -g -Wall
-DHAVE_CONFIG -o rtftr RtftrUserInterface.o
/usr/local/lib/octave/3.4.3/liboctave.so
./src/subspacelda/librtftr_subspacelda.a
./src/kepenekci/librtftr_kepenekci.a ./src/adaboost/librtftr_adaboost.a
./src/librtftr_common.a -lxml2 -lml -lfftw3 -lvigraimpex -lcvaux
-lhighgui -lcv /usr/lib/libboost_serialization.so
/usr/lib/libboost_filesystem.so /usr/lib/libcxcore.so.2.1
mkdir .libs
g++ -g -O2 -g -Wall -DHAVE_CONFIG -o rtftr RtftrUserInterface.o
/usr/local/lib/octave/3.4.3/liboctave.so
/usr/lib/libboost_serialization.so /usr/lib/libboost_filesystem.so
/usr/lib/libcxcore.so.2.1  ./src/subspacelda/librtftr_subspacelda.a
./src/kepenekci/librtftr_kepenekci.a ./src/adaboost/librtftr_adaboost.a
./src/librtftr_common.a /usr/lib/libxml2.so -lml /usr/lib/libfftw3.so
-lm /usr/local/lib/libvigraimpex.so -lpng12 -lcvaux -lhighgui -lcv
./src/subspacelda/librtftr_subspacelda.a(SubspaceRecognize.o): In
function `SubspaceRecognize::Recognize(_IplImage*)':
/home/chellberg/code/rtftr-0.2-ch/src/subspacelda/SubspaceRecognize.cc:223:
undefined reference to `operator*(Matrix const&, Matrix const&)'
/home/chellberg/code/rtftr-0.2-ch/src/subspacelda/SubspaceRecognize.cc:225:
undefined reference to `operator*(Matrix const&, Matrix const&)'
/home/chellberg/code/rtftr-0.2-ch/src/subspacelda/SubspaceRecognize.cc:227:
undefined reference to `operator*(Matrix const&, Matrix const&)'
/home/chellberg/code/rtftr-0.2-ch/src/subspacelda/SubspaceRecognize.cc:228:
undefined reference to `operator*(Matrix const&, Matrix const&)'
./src/subspacelda/librtftr_subspacelda.a(SubspaceRecognize.o): In
function `Array':
/usr/local/include/octave-3.4.3/octave/Array.h:199: undefined reference
to `dim_vector::safe_numel() const'
/usr/local/include/octave-3.4.3/octave/Array.h:201: undefined reference
to `Array<double>::fill(double const&)'
./src/subspacelda/librtftr_subspacelda.a(SubspaceRecognize.o): In
function `MArray<double>::transpose() const':
/usr/local/include/octave-3.4.3/octave/MArray.h:84: undefined reference
to `Array<double>::transpose() const'
./src/subspacelda/librtftr_subspacelda.a(SubspaceRecognize.o): In
function `Array<double>::as_matrix() const':
/usr/local/include/octave-3.4.3/octave/Array.h:292: undefined reference
to `dim_vector::redim(int) const'
./src/subspacelda/librtftr_subspacelda.a(SubspaceTrain.o): In function
`Array':
/usr/local/include/octave-3.4.3/octave/Array.h:199: undefined reference
to `dim_vector::safe_numel() const'
/usr/local/include/octave-3.4.3/octave/Array.h:201: undefined reference
to `Array<double>::fill(double const&)'
./src/subspacelda/librtftr_subspacelda.a(TrainImageMapIO.o): In function
`binary_oarchive_impl':
/usr/include/boost/archive/binary_oarchive_impl.hpp:84: undefined
reference to
`boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive, char,
std::char_traits<char>
 >::basic_binary_oprimitive(std::basic_streambuf<char,
std::char_traits<char> >&, bool)'
./src/subspacelda/librtftr_subspacelda.a(TrainImageMapIO.o): In function
`common_oarchive':
/usr/include/boost/archive/detail/common_oarchive.hpp:75: undefined
reference to
`boost::archive::detail::basic_oarchive::basic_oarchive(unsigned int)'
./src/subspacelda/librtftr_subspacelda.a(TrainImageMapIO.o): In function
`invoke<TrainImageMap>':
/usr/include/boost/archive/detail/oserializer.hpp:253: undefined
reference to `boost::archive::detail::basic_oarchive::save_object(void
const*, boost::archive::detail::basic_oserializer const&)'
./src/subspacelda/librtftr_subspacelda.a(TrainImageMapIO.o): In function
`~common_oarchive':


The octave library is present:

chellberg@chellberg-t400:~$ ls -la /usr/local/lib/octave/3.4.3/liboctave.so
lrwxrwxrwx 1 root root 18 2012-03-28 03:00
/usr/local/lib/octave/3.4.3/liboctave.so -> liboctave.so.0.0.0
chellberg@chellberg-t400:~$

The offending lines are:

221:    Matrix projected_image;
222:    if(mAlgorithm == "PCA") {
223:        projected_image = mSubspace.transpose() * test_image;
224:    } else if(mAlgorithm == "LDA") {
225:        projected_image = mSubspace * test_image;
226:        if(mSeparateNonFaces == true) {
227:            Matrix projected_image_for_filtration =
mSubspaceForFiltration.transpose() * test_image;
228:            Matrix reconstructed_image = mSubspaceForFiltration *
projected_image_for_filtration;
229:            float sum = 0;
230:            for(int i = 0; i < reconstructed_image.rows(); i++) {
231:                sum += (reconstructed_image.elem(i,0) -
test_image.elem(i,0)) * (reconstructed_image.elem(i,0) -
test_image.elem(i,0));
232:            }
233:            float distance = sqrt(sum);
234:            if(distance >= (mThreshold1 *mMaxDistance ) ) {
235:                return -2;
256:            }
237:        }
238:    }


Not quite sure what isn't being included properly by the linker.

Cheers,

Chris

28/03/12 13:13, Abhishek Dutta написал:
> Yes, we are excited to see you join us. Thanks for that.
>
> Start firing your questions :)
>
> Good luck
> Abhishek
>
> On Wed, Mar 28, 2012 at 12:56 PM, <chris@chrishellberg.com
> <mailto:chris@chrishellberg.com>> wrote:
>
>     Hi Guys,
>
>     I've started updating a local copy of rtftr source to address newer
>     versions of libraries that rtftr references. I've fixed several of
>     them but stumped on a couple of issues.
>
>     Are you guys still around to help with a couple of linker problems?
>
>     Cheers,
>
>     Chris
>     Enviado desde mi dispositivo BlackBerry® de Orange.
>     ------------------------------------------------------------------------------
>     This SF email is sponsosred by:
>     Try Windows Azure free for 90 days Click Here
>     http://p.sf.net/sfu/sfd2d-msazure
>     _______________________________________________
>     Rtftr-devel mailing list
>     Rtftr-devel@lists.sourceforge.net
>     <mailto:Rtftr-devel@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/rtftr-devel
>
>
>
>
> --
> Abhishek
> http://abhishekdutta.org


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Rtftr-devel mailing list
Rtftr-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rtftr-devel



--
Have a nice day



--
Abhishek
http://abhishekdutta.org