I am compiling a C/C++ project using make. However, the compilation process fails with the following error message below -** Compiling lib/crypto/rsaCipher.c C:/Davidviewservermain\sysimg-ufa\bora\vmacore-for-ufa-src\bora\lib\crypto\rsaCi pher.c(15) : fatal error C1083: Cannot open include file: 'openssl/rsa.h': No su ch file or directory ,, I see that rsaCipher.c is hash including rsa.h file. However the make process is not able to open the header file even though it is present inside the openssl folder. How does the make process find the location of header files? Is their any environmental variable like INCLUDE to give the search path of all the header files which will be checked by make process. I am using make in windows.
-
C:/Davidviewservermain\sysimg-ufa\bora\vmacore-for-ufa-src\bora\lib\crypto\rsaCipher.c(15) : fatal error C1083: Cannot open include file: 'openssl/rsa.h': No such file or directory – user496934 Nov 08 '15 at 17:39
-
Above is the complete error message – user496934 Nov 08 '15 at 17:39
-
1What an awkward _"question "_ is this please?? With over 800 rep, you should know how to post a valid question and a [MCVE]. At least show your makefile, CMakeLists.txt respectively. – πάντα ῥεῖ Nov 08 '15 at 17:48
-
2@πάνταῥεῖ The weird thing is that people up-vote this crap. – juanchopanza Nov 08 '15 at 17:56
-
2@juanchopanza Yes, we should require them to give an explanatory comment ;-) ... – πάντα ῥεῖ Nov 08 '15 at 17:57
-
Check the task of management programs like `make`, the preprocessor, and the compiler. Make isn't related to your problem. Verify that the INCLUDE path is in the syntax MSVC knows and that it includes the directory the the contains the `openssl` directory, not the file `rsa.h`. If you really want the readers here to tell you what's wrong you will have to post more details. If you really wan to do it the hard way, fight with the `/I` command line option. The better way might be using Visual Studio (Express). – harper Nov 08 '15 at 18:45
1 Answers
How does the make process find the location of header files?
It doesn't and it doesn't need to. It's the compiler* that needs to find them, and it does so by you telling it where to look when you configure the include search paths.
Is their any environmental variable like INCLUDE to give the search path of all the header files which will be checked by make process.
This is based on the compiler, not make. If your compiler checks any environment variables for include search paths then you could set that before running make.
However typically you instead set a variable in your Makefile and then use that variable in your compilation rules:
INC=-I/usr/informix/incl/c++ /opt/informix/incl/public
main: test.cpp
gcc -Wall $(LIB) $(INC) -c test.cpp
Note that the above shows you how to put the include paths in a compile command, but it's not showing best practices: the dependencies aren't right so make will not always know it needs to rebuild the target when it should. I haven't looked at it in detail, but this question and answer may help you with producing robust makefiles.
* Well, preprocessor really, but with modern toolchains this is embedded in the compiler executable or invoked by the compiler driver automatically.