I am trying to compile a program that uses the OpenSSL library. I had a problem where it couldn't find the header files. I fixed this problem by adding the option
-I /usr/local/opt/openssl/include to
gcc. After this, I had another problem, which is that the linker does not understand some symbol. This is the error I got:
Undefined symbols for architecture x86_64: "_MD5", referenced from: _main in md5-b35556.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I googled the error, and got a whole lot of results that either only applied to C++, or only applied to programs with multiple modules, etc. Finally, I found what might be a solution to my problem, which is that
gcc is hashed to
clang on MacOS (I am using El Capitain).
So basically, now I need to find the real
gcc executable, then redirect the
gcc command to that file with an
alias command in my
.bashrc file. Where can I find this executable in my filesystem, or do I need to install it from the Internet?
Note: I had this same problem when trying to use the ncurses library.