Search code examples
c++g++sqlapi++

G++ compiler not recognizing SQLAPI.h header file


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!


Solution

  • 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.