I am trying to compile a simple Oracle application on OS X and running into link issues. Any help would be appreciated. 

```
#include <iostream>
#include <occi.h>

using namespace std;
using namespace oracle::occi;

Environment * env;
Connection * conn;

int main(int argc, char ** argv)
{
    env = Environment::createEnvironment(Environment::OBJECT);
    conn = env->createConnection("scott", "tiger", "//lcoalhost:1521/xe");
    Statement *stmt = conn->createStatement("SELECT COUNT(*) FROM TAB");
    ResultSet *rs=stmt->executeQuery();
    rs->next();
    string ntabs=rs->getString(1);
    cout << "Number of tables " << ntabs << endl;
    conn->terminateStatement(stmt);
    // Close connection etc
    env->terminateConnection(conn);
    Environment::terminateEnvironment(env);
    return 0;
}

```

I have the x64 oracle instant client installed in `~/oracle_client`. I can connect to the database using `sqlplus` and `python (cx_Oracle)`.

I am compiling the file with the following command

```
gcc main.cpp -I ~/oracle_client/sdk/include/ -L ~/oracle_client -locci -lclntsh

```

Below is the `ld` error I receive:

```
ld: warning: ignoring file <ORACLE_HOME >/libclntsh.dylib, file was built for unsupported file format ( 0x62 0x6f 0x6f 0x6b 0x 0 0x 0 0x 0 0x 0 0x6d 0x61 0x72 0x6b 0x 0 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): <ORACLE_HOME>/libclntsh.dylib
Undefined symbols for architecture x86_64:
"std::allocator::allocator()", referenced from:
_main in ccWf4dno.o
"std::allocator::~allocator()", referenced from:
_main in ccWf4dno.o
"std::basic_ostream >::operator >& (*)(std::basic_ostream >&))", referenced from:
_main in ccWf4dno.o
"std::basic_string, std::allocator >::basic_string(char const*, std::allocator const&)", referenced from:
_main in ccWf4dno.o
"std::basic_string, std::allocator >::~basic_string()", referenced from:
_main in ccWf4dno.o
"std::ios_base::Init::Init()", referenced from:
__static_initialization_and_destruction_0(int, int)in ccWf4dno.o
"std::ios_base::Init::~Init()", referenced from:
___tcf_0 in ccWf4dno.o
"std::cout", referenced from:
_main in ccWf4dno.o
"std::basic_ostream >& std::endl >(std::basic_ostream >&)", referenced from:
_main in ccWf4dno.o
"std::terminate()", referenced from:
_main in ccWf4dno.o
"std::basic_ostream >& std::operator >(std::basic_ostream >&, char const*)", referenced from:
_main in ccWf4dno.o
"std::basic_ostream >& std::operator, std::allocator >(std::basic_ostream >&, std::basic_string, std::allocator > const&)", referenced from:
_main in ccWf4dno.o
"___gxx_personality_v0", referenced from:
Dwarf Exception Unwind Info (__eh_frame) in ccWf4dno.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

```