Use Poco compilation problems, “undefined reference Parser”

205 Views Asked by At

When I use Poco to compile the program, I prompt me not defining 'Parser'.

This is the installation command of Poco

./configure --no-tests --no-samples --omit=Data/ODBC,Data/MySQL,MongoDB,PDF --static --cflags=-fPIC --shared --prefix=/usr/local
#include <Poco/JSON/Parser.h>
#include <iostream>
#include <string>


int main(int argc, char **argv) {
    std::string json = "{ \"test\" : { \"property\" : \"value\", \"dog\": \"cat\" } }";
    Poco::JSON::Parser parser;
    return 0;
}
g++ -std=c++14 -W -Wall -g json.cpp -o json -lPocoNet -lPocoUtil -lPocoJSON -lPocoFoundation -I /usr/local/include/
/usr/bin/ld: /tmp/ccezP8gK.o: in function 'main':
/root/test/json.cpp:9: undefined reference to Poco::JSON::Parser::Parser(Poco::SharedPtr<Poco::JSON::Handler, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Handler> > const&)'

I tried to reinstall Poco and re -link the program. I can find Poco in/usr/local/include.

0

There are 0 best solutions below