Overview
Features
Download
Documentation
Community
Add-Ons & Services

Persistent gcc linker error

Please post support and help requests here.

Persistent gcc linker error

Postby petrux » 13 Sep 2007, 17:48

Hi there,

I installed POCO on my Debian Etch, build the package with no problem using "make" but I could not compile the DateTimeSample.cpp example. Using the bach command:

Code: Select all

>> g++ DateTimeSample.cpp -o DateTimeSample -I /usr/local/poco/Foundation/include -l /usr/local/poco/lib/Linux/i686/libPocoFoundation.so


I have a linker error:
Code: Select all

>> cannot find -l /usr/local/poco/lib/Linux/i686/libPocoFoundation.so

It happened also on Windows (using cygwin). It's quite strange!
Does anybody have any siggestion?

thanks in advance,
petrux

petrux
 
Posts: 17
Joined: 07 Sep 2007, 15:30

Re: Persistent gcc linker error

Postby alex » 13 Sep 2007, 18:25

> I have a linker error:
>
Code: Select all

> >> cannot find -l /usr/local/poco/lib/Linux/i686/libPocoFoundation.so
>

> It happened also on Windows (using cygwin). It's quite strange!
> Does anybody have any siggestion?

I have three (first being a fish, second and third fishing lessons):

1) try
Code: Select all

g++ DateTimeSample.cpp -o DateTimeSample -I/usr/local/poco/Foundation/include -L/usr/local/poco/lib/Linux/i686 -lPocoFoundation


2) when in doubt, use 'man g++' and 'man make'

3) use POCO build system to simplify your life. There is excellent documentation available.

Alex
alex
 
Posts: 1105
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Persistent gcc linker error

Postby petrux » 14 Sep 2007, 09:50

Hi alex,

thanks four your reply (as usual (:wink:) )


> I have three (first being a fish, second and third fishing lessons):

Ehrm... as you have noticed my english is not so good, so I'm asking... what about "fish"?

> 1) try
>
Code: Select all

> g++ DateTimeSample.cpp -o DateTimeSample -I/usr/local/poco/Foundation/include -L/usr/local/poco/lib/Linux/i686 -lPocoFoundation
>


Did it, and got a run-time error:

Code: Select all

./DateTimeSample: error while loading shared libraries: libPocoFoundation.so.4: cannot open shared object file: No such file or directory


> 3) use POCO build system to simplify your life. There is excellent documentation available.

Ok, I'm taking a look.

Thanks and have a nice day,
petrux
petrux
 
Posts: 17
Joined: 07 Sep 2007, 15:30

Re: Re: Persistent gcc linker error

Postby alex » 14 Sep 2007, 14:44

> > I have three (first being a fish, second and third fishing lessons):
>
> Ehrm... as you have noticed my english is not so good, so I'm asking... what about "fish"?

There is an old Chinese proverb that says if you give man a fish you have fed him for a day but if you teach him how to fish, you have fed him for life.
So, although I gave you a fish already, I would also like you to learn how to fish.

BTW, do not worry about your English, you're doing fine. It is gmake you need to work on (:wink:)

> Ok, I'm taking a look.

Good. Keep on fishing (:wink:)

Alex
alex
 
Posts: 1105
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Re: Re: Persistent gcc linker error

Postby petrux » 14 Sep 2007, 15:47

> There is an old Chinese proverb
[cut]

Oh my God... it's true! And there is a similar proverd in Italian too...

> BTW, do not worry about your English, you're doing fine. It is gmake you need to
> work on (:wink:)

LOL! It's true! I should google around to find some for-dummies documentation in order to learn to do my make file. BTW: also following the POCO build documentation the linker goes crasy... I think it's a more general (and serious) problem...

> Good. Keep on fishing (:wink:)

Let's hope to have something to eat tonight!
;-)

Thanks,
petrux

petrux
 
Posts: 17
Joined: 07 Sep 2007, 15:30

Re: Re: Re: Re: Persistent gcc linker error

Postby alex » 14 Sep 2007, 18:35

> LOL! It's true! I should google around to find some for-dummies documentation in order to learn to do my make file. BTW: also following the POCO build documentation the linker goes crasy... I think it's a more general (and serious) problem...

Hm. Few clues:

1) Did you set $POCO_BASE?

2) Is your project under $POCO_BASE?

3) If not 2) then did you set [$http://www.appinf.com/poco/wiki/tiki-index.php?page=BuildSystem#PROJECT_BASE|$PROJECT_BASE]

Alex
alex
 
Posts: 1105
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Re: Re: Re: Re: Persistent gcc linker error

Postby petrux » 17 Sep 2007, 11:05

Hi alex,

> Hm. Few clues:
[cut]

I've solved my problems on the Linux platform changing the LD_LIBRARY_PATH environment variable (or the /etc/ld.so.conf file, then running /sbin/ldconfig). Everything now seems to work properly!

Next steps (fishing lessons!) will be:
1 - compile everything on WinXP (__without__ using VisualStudio)
2 - build both under Linux and Win the POCO library and using __static__ libraries;

Meanwhile: thanks a lot!
petrux
petrux
 
Posts: 17
Joined: 07 Sep 2007, 15:30


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron