lundi 31 août 2015

OCCI linkage error with gcc 5

Recently I've upgraded my gcc from 4.1.2 to 5.2.0.

This caused a linkage error with the OCCI library:

Source Code I'm trying to run:

#include <iostream>
#include <occi.h>
using namespace oracle::occi;
using namespace std;

int main (int argc, char *argv[])
{    
  Environment *env;
  Connection *conn;

  oracle::occi::MetaData metaData = conn->getMetaData ((char *)"PERSON_OBJ");
  metaData.getString(MetaData::ATTR_NAME); 

  return(0);
}

The linkage error:

gmake -f /home/davidd/temp.mak CFG=Debug g++ -g "-Wl,-rpath,/omniqdir/arch/x86_64/release/lib:/omniqdir/instantclient_12_1:/usr/lib,-rpath-link,/omniqdir/arch/x86_64/release/lib:/omniqdir/instantclient_12_1:/usr/lib,-ldl,-lpthread" /omniqdir/arch/x86_64/release/lib/libjemalloc.so -o "Debug/temp" Debug/temp.o /omniqdir/instantclient_12_1/libocci.so /omniqdir/instantclient_12_1/libclntsh.so Debug/temp.o: In function main': temp.cpp:(.text+0xac): undefined reference to_ZNK6oracle4occi8MetaData9getStringB5cxx11ENS1_6AttrIdE' collect2: error: ld returned 1 exit status gmake: *** [Debug/temp] Error 1

I've noticed that the undefined reference contains c++11 related symbols, which i guess have to do with the new gcc compiler I'm using.

Function declaration from occiControl.h

OCCI_STD_NAMESPACE::string getString(MetaData::AttrId attrid)

I'm using Centos 6.6 and latest OCCI version instantclient-basiclite-linux.x64-12.1.0.2.0.

Any ideas?

Thanks, David

Aucun commentaire:

Enregistrer un commentaire