I need some help understanding why this is not working. I have a .h file that declares a function defined within a .so file:
/* navApi.h */
void navApi_init(); /* resides in libNavApi.so */
and a .cpp file:
/* test.cpp */
#include <iostream>
#include "navApi.h"
int main(void)
{
std::cout << "start...\n";
navApi_Init();
}
I compiled using:
g++ test.cpp -navApi
I'm getting the following error:
test.cpp: (.txt+0x1e): undefined reference to `navApi_Init()'
collect2: error: ld returned 1 exit status
-- running on linux, ubuntu --