G++ 编译器无法识别 SQLAPI.h 头文件

G++ compiler not recognizing SQLAPI.h header file

我正在尝试使用以下命令在我的 MacBook CLI 上编译 C++ 程序:

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

但出现错误:

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

我将 https://www.sqlapi.com/Download/ 的下载内容放入目录 /Users/user/SQLAPI/。我已确认 SQLAPI.h 文件位于 /Users/user/SQLAPI/include/SQLAPI.h 中,所以我很困惑为什么我的 g++ 无法识别头文件。请帮忙!

-I 的参数是要搜索headers 的目录

-o 的参数是输出文件名。

您很可能想要:

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

当然,这很可能只会解决当前的包含问题,而不会 link SQLAPI 库。