jeudi 26 mai 2016

bloomberg data api how to include library c++

when i run the following code in the Bloomberg data api i get error of that. i don't know how to include the blpapi properly.

ruichaozhang@ruichaozhang:~/sites/blpapi_cpp_3.8.18.1/examples$ g++ SimpleHistoryExample.cpp -I ../include/ /tmp/ccj4IxmT.o: In function `BloombergLP::blpapi::ExceptionUtil::throwException(int)':

/tmp/ccj4IxmT.o: In function BloombergLP::blpapi::ExceptionUtil::throwException(int)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi13ExceptionUtil14throwExceptionEi[_ZN11BloombergLP6blpapi13ExceptionUtil14throwExceptionEi]+0x23): undefined reference toblpapi_getLastErrorDescription' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Element::setElement(char const*, int)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Element10setElementEPKci[_ZN11BloombergLP6blpapi7Element10setElementEPKci]+0x2c): undefined reference toblpapi_Element_setElementInt32' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Element::setElement(char const*, char const*)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Element10setElementEPKcS3_[_ZN11BloombergLP6blpapi7Element10setElementEPKcS3_]+0x2f): undefined reference toblpapi_Element_setElementString' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Element::appendValue(char const*)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Element11appendValueEPKc[_ZN11BloombergLP6blpapi7Element11appendValueEPKc]+0x27): undefined reference toblpapi_Element_setValueString' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Element::getElement(char const*) const': SimpleHistoryExample.cpp:(.text._ZNK11BloombergLP6blpapi7Element10getElementEPKc[_ZNK11BloombergLP6blpapi7Element10getElementEPKc]+0x37): undefined reference toblpapi_Element_getElement' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Element::print(std::ostream&, int, int) const': SimpleHistoryExample.cpp:(.text._ZNK11BloombergLP6blpapi7Element5printERSoii[_ZNK11BloombergLP6blpapi7Element5printERSoii]+0x33): undefined reference toblpapi_Element_print' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Request::Request(blpapi_Request*)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7RequestC2EP14blpapi_Request[_ZN11BloombergLP6blpapi7RequestC5EP14blpapi_Request]+0x3a): undefined reference toblpapi_Request_elements' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Request::~Request()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7RequestD2Ev[_ZN11BloombergLP6blpapi7RequestD5Ev]+0x23): undefined reference toblpapi_Request_destroy' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Service::addRef()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Service6addRefEv[_ZN11BloombergLP6blpapi7Service6addRefEv]+0x23): undefined reference toblpapi_Service_addRef' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Service::release()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Service7releaseEv[_ZN11BloombergLP6blpapi7Service7releaseEv]+0x23): undefined reference toblpapi_Service_release' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Service::createRequest(char const*) const': SimpleHistoryExample.cpp:(.text._ZNK11BloombergLP6blpapi7Service13createRequestEPKc[_ZNK11BloombergLP6blpapi7Service13createRequestEPKc]+0x39): undefined reference toblpapi_Service_createRequest' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Message::Message(blpapi_Message*, bool)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7MessageC2EP14blpapi_Messageb[_ZN11BloombergLP6blpapi7MessageC5EP14blpapi_Messageb]+0x59): undefined reference toblpapi_Message_elements' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Message::~Message()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7MessageD2Ev[_ZN11BloombergLP6blpapi7MessageD5Ev]+0x2f): undefined reference toblpapi_Message_release' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Event::~Event()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi5EventD2Ev[_ZN11BloombergLP6blpapi5EventD5Ev]+0x23): undefined reference toblpapi_Event_release' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Event::operator=(BloombergLP::blpapi::Event const&)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi5EventaSERKS1_[_ZN11BloombergLP6blpapi5EventaSERKS1_]+0x37): undefined reference toblpapi_Event_release' SimpleHistoryExample.cpp:(.text.ZN11BloombergLP6blpapi5EventaSERKS1[ZN11BloombergLP6blpapi5EventaSERKS1]+0x60): undefined reference to blpapi_Event_addRef' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::Event::eventType() const': SimpleHistoryExample.cpp:(.text._ZNK11BloombergLP6blpapi5Event9eventTypeEv[_ZNK11BloombergLP6blpapi5Event9eventTypeEv]+0x17): undefined reference to blpapi_Event_eventType' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::MessageIterator::MessageIterator(BloombergLP::blpapi::Event const&)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi15MessageIteratorC2ERKNS0_5EventE[_ZN11BloombergLP6blpapi15MessageIteratorC5ERKNS0_5EventE]+0x37): undefined reference to blpapi_MessageIterator_create' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::MessageIterator::~MessageIterator()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi15MessageIteratorD2Ev[_ZN11BloombergLP6blpapi15MessageIteratorD5Ev]+0x17): undefined reference to blpapi_MessageIterator_destroy' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::MessageIterator::next()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi15MessageIterator4nextEv[_ZN11BloombergLP6blpapi15MessageIterator4nextEv]+0x22): undefined reference to blpapi_MessageIterator_next' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::MessageIterator::message(bool) const': SimpleHistoryExample.cpp:(.text._ZNK11BloombergLP6blpapi15MessageIterator7messageEb[_ZNK11BloombergLP6blpapi15MessageIterator7messageEb]+0x27): undefined reference to blpapi_Message_addRef' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::AbstractSession::getService(char const*) const': SimpleHistoryExample.cpp:(.text._ZNK11BloombergLP6blpapi15AbstractSession10getServiceEPKc[_ZNK11BloombergLP6blpapi15AbstractSession10getServiceEPKc]+0x3a): undefined reference to blpapi_AbstractSession_getService' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::AbstractSession::openService(char const*)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi15AbstractSession11openServiceEPKc[_ZN11BloombergLP6blpapi15AbstractSession11openServiceEPKc]+0x23): undefined reference to blpapi_AbstractSession_openService' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::SessionOptions::SessionOptions()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi14SessionOptionsC2Ev[_ZN11BloombergLP6blpapi14SessionOptionsC5Ev]+0xd): undefined reference to blpapi_SessionOptions_create' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::SessionOptions::~SessionOptions()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi14SessionOptionsD2Ev[_ZN11BloombergLP6blpapi14SessionOptionsD5Ev]+0x17): undefined reference to blpapi_SessionOptions_destroy' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::SessionOptions::setServerHost(char const*)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi14SessionOptions13setServerHostEPKc[_ZN11BloombergLP6blpapi14SessionOptions13setServerHostEPKc]+0x22): undefined reference to blpapi_SessionOptions_setServerHost' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::SessionOptions::setServerPort(unsigned short)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi14SessionOptions13setServerPortEt[_ZN11BloombergLP6blpapi14SessionOptions13setServerPortEt]+0x23): undefined reference to blpapi_SessionOptions_setServerPort' /tmp/ccj4IxmT.o: In functionBloombergLP::blpapi::Session::Session(BloombergLP::blpapi::SessionOptions const&, BloombergLP::blpapi::EventHandler*, BloombergLP::blpapi::EventDispatcher*)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7SessionC2ERKNS0_14SessionOptionsEPNS0_12EventHandlerEPNS0_15EventDispatcherE[_ZN11BloombergLP6blpapi7SessionC5ERKNS0_14SessionOptionsEPNS0_12EventHandlerEPNS0_15EventDispatcherE]+0x8d): undefined reference to blpapi_Session_create' SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7SessionC2ERKNS0_14SessionOptionsEPNS0_12EventHandlerEPNS0_15EventDispatcherE[_ZN11BloombergLP6blpapi7SessionC5ERKNS0_14SessionOptionsEPNS0_12EventHandlerEPNS0_15EventDispatcherE]+0xa8): undefined reference toblpapi_Session_getAbstractSession' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Session::~Session()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7SessionD2Ev[_ZN11BloombergLP6blpapi7SessionD5Ev]+0x25): undefined reference toblpapi_Session_destroy' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Session::start()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Session5startEv[_ZN11BloombergLP6blpapi7Session5startEv]+0x18): undefined reference toblpapi_Session_start' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Session::startAsync()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Session10startAsyncEv[_ZN11BloombergLP6blpapi7Session10startAsyncEv]+0x18): undefined reference toblpapi_Session_startAsync' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Session::stop()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Session4stopEv[_ZN11BloombergLP6blpapi7Session4stopEv]+0x18): undefined reference toblpapi_Session_stop' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Session::stopAsync()': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Session9stopAsyncEv[_ZN11BloombergLP6blpapi7Session9stopAsyncEv]+0x18): undefined reference toblpapi_Session_stopAsync' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Session::nextEvent(int)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Session9nextEventEi[_ZN11BloombergLP6blpapi7Session9nextEventEi]+0x38): undefined reference toblpapi_Session_nextEvent' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Session::tryNextEvent(BloombergLP::blpapi::Event*)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Session12tryNextEventEPNS0_5EventE[_ZN11BloombergLP6blpapi7Session12tryNextEventEPNS0_5EventE]+0x33): undefined reference toblpapi_Session_tryNextEvent' /tmp/ccj4IxmT.o: In function BloombergLP::blpapi::Session::sendRequest(BloombergLP::blpapi::Request const&, BloombergLP::blpapi::CorrelationId const&, BloombergLP::blpapi::EventQueue*, char const*, int)': SimpleHistoryExample.cpp:(.text._ZN11BloombergLP6blpapi7Session11sendRequestERKNS0_7RequestERKNS0_13CorrelationIdEPNS0_10EventQueueEPKci[_ZN11BloombergLP6blpapi7Session11sendRequestERKNS0_7RequestERKNS0_13CorrelationIdEPNS0_10EventQueueEPKci]+0xa6): undefined reference toblpapi_Session_sendRequest' collect2: error: ld returned 1 exit status

Aucun commentaire:

Enregistrer un commentaire