覆盖系统头包括在编译gcc时。

时间:2021-03-29 09:11:46

I'm currently trying to compile a C++ source file which use openssl headers, but the compiler uses system openssl headers located in /usr/include/openssl and I would like it uses the /usr/local/openssl/1.0.1c/include/openssl include path. I might have to give the "-I" flag pointing to the last path but it keeps the system one.

我目前正在尝试编译一个使用openssl报头的c++源文件,但是编译器使用位于/usr/include/openssl中的系统openssl报头,我希望它使用/usr/local/openssl/1.0.1c/include/openssl包含路径。我可能需要给"-I"标志指向最后一条路径但它保留了系统1。

g++ -o src/base64.o -c -O3 -arch x86_64 -Iinclude/cryptoplus -I/usr/local/openssl/1.0.1c/include/openssl src/base64.cpp

My environment variables seem to not force using the /usr/include/openssl include dir and I'm working on OSX 10.8, sorry if it's novice question but it's kind disturbing.

我的环境变量似乎不使用/usr/include/openssl包括dir,我在osx10.8上工作,抱歉,如果这是新手的问题,但这有点令人不安。

In advance, thank you!

提前,谢谢!

1 个解决方案

#1


1  

My bad, I was very tired ! The openssl include path wasn't right, I needed to specify

糟糕的是,我太累了!openssl包含路径不正确,我需要指定

-I/usr/local/openssl/1.0.1c/include

without the openssl folder.

没有openssl文件夹。

The include calls the header file inside the openssl folder

include调用openssl文件夹中的头文件

#include <openssl/opensslv.h>

Thanks for your comments.

谢谢你的评论。

#1


1  

My bad, I was very tired ! The openssl include path wasn't right, I needed to specify

糟糕的是,我太累了!openssl包含路径不正确,我需要指定

-I/usr/local/openssl/1.0.1c/include

without the openssl folder.

没有openssl文件夹。

The include calls the header file inside the openssl folder

include调用openssl文件夹中的头文件

#include <openssl/opensslv.h>

Thanks for your comments.

谢谢你的评论。