linux /usr/bin/ld: cannot find -lPocoFoundationd

Please post support and help requests here.
Posts: 4
Joined: 01 Jan 2013, 16:06

linux /usr/bin/ld: cannot find -lPocoFoundationd

Postby GATTACA » 01 Jan 2013, 16:23

Newbie question here so I apologize if this is a silly question.

I'm trying to use the Runnable and Threadpool libriares in POCO in my C++ project.
I'm working on CentOS 6.3 (64-bit) using g++ version 4.4.6 20120305 (Red Hat 4.4.6-4)

I've written my code based upon the online examples (correctly I think).

My problem is when compiling.
I get the following error: /usr/bin/ld: cannot find -lPocoFoundationd

This seems strange to me since the compile command specifies the correct path to the libraries and header files.

I installed the POCO project locally (I don't have root access to our server).
Here is how installed POCO:

Code: Select all

cd $HOME/workspace/xProject
tar xzf poco-1.4.5.tar.gz
cd poco-*
./configure --prefix=$HOME/workspace/xProject/poco.lib
make install

The libraries are there now in $HOME/workspace/xProject/poco.lib (which is one directory up from the project's source code folder):

Code: Select all

ls ../poco.lib/lib/*.so


Here are the commands I issued to compile the program (through a Makefile):

Code: Select all

g++ -O2 -Wall -static -I../poco.lib/include -L../poco.lib/lib -lPocoFoundationd -lPocoFoundation -c xClass.cpp
g++ -O2 -Wall -static -I../poco.lib/include -L../poco.lib/lib -lPocoFoundationd -lPocoFoundation -c main.cpp
g++ -O2 -Wall -static -I../poco.lib/include -L../poco.lib/lib -lPocoFoundationd -lPocoFoundation -c globals.cpp
g++ -O2 -Wall -static -I../poco.lib/include -L../poco.lib/lib -lPocoFoundationd -lPocoFoundation -o finalApp.exe  xClass.o main.o globals.o

And then I get this error:

Code: Select all

g++ -O2 -Wall -static -I../poco.lib/include -L../poco.lib/lib -lPocoFoundationd -lPocoFoundation -o  finalApp.exe  xClass.o main.o globals.o
/usr/bin/ld: cannot find -lPocoFoundationd
collect2: ld returned 1 exit status
make: *** [finalApp.exe] Error 1

Any suggestions what I'm doing wrong?

Thanks in advance for any and all help.
Happy New Year.

Posts: 4
Joined: 01 Jan 2013, 16:06

Re: linux /usr/bin/ld: cannot find -lPocoFoundationd

Postby GATTACA » 02 Jan 2013, 01:47

Okay I've made progress.

I figured out my linking issues.
Now I'm having issues with the Runnable class itself.

Code: Select all

xClass.o: In function `xClass::xClass(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
xClass.cpp:(.text+0x1b8): undefined reference to `Poco::Runnable::Runnable()'
xClass.cpp:(.text+0xbbc): undefined reference to `Poco::Runnable::~Runnable()'

I'm declaring my xClass as the on line examples suggest in a separate header file:

Code: Select all

#include <string>
#include <iostream>
#include "Poco/Runnable.h"
#include "Poco/ThreadPool.h"

using namespace std;

class xClass;

class xClass: public Poco::Runnable {
        double deltaScore;
        double globalFLR;
        string id;
        string a1;
        string a2;
        string a3;
        bool isCorrect;
        bool inAboveAlpha;
        bool isDecoy;

        xClass() : Poco::Runnable() {};
        xClass(string src_str);
        virtual void run();

Any suggestions?

Return to “Support”

Who is online

Users browsing this forum: No registered users and 7 guests