G++ compiler not recognizing SQLAPI.h header file

356 Views Asked by At

I'm trying to compile a C++ program on my MacBook CLI using:

g++ -o -I/Users/user/SQLAPI/include/SQLAPI.h program driver.cpp

but getting the error:

driver.cpp:3:10: fatal error: 'SQLAPI.h' file not found
#include <SQLAPI.h>
         ^~~~~~~~~~

I placed the download from https://www.sqlapi.com/Download/ into directory /Users/user/SQLAPI/. I've confirmed that the SQLAPI.h file is in /Users/user/SQLAPI/include/SQLAPI.h, so I'm confused as to why my g++ isn't recognizing the header file. Please help!

1

There are 1 best solutions below

2
On BEST ANSWER

The argument for -I is the directory to search for the headers.

The argument for -o is the output file name.

You most probably want to:

g++ -I /Users/user/SQLAPI/include -o program driver.cpp

Which of course most probably will solve only the current include problem and will not link with SQLAPI library.