The GCC compiler is a combination of many compiler portals, such as when compiling a. cpp file, using the C + + compiler, when compiling. c files.
When compiling a C + + program, the library file and header file can be specified by-l[dir],-l[name] Specifies the name of the library file. When specifying the name of a library file, you follow the specified paradigm. For example, the library file libabc.a, [lib]abc[.a] in the brackets section of the default, this time the library file name is called: ABC, so at the time of GCC compilation, through the-LABC to load the library.
Typically a C + + program uses a standard library, such as a string in your code
#include <string>
using namespace Std;
At compile time, you will encounter fatal error:string:No such file or directory compilation terminated, because standard library code is used in the code, and the library is not included at compile time. The C + + standard (static/dynamic) library name is: LIBSTDC++.A, libstdc++.so, so the compile-time GCC directive attaches-lstdc++
gcc-i/usr/include/openssl/-wall Testzs.cpp-o testzsexe-lcrypto-ldl-lstdc++
This directive contains 3 libraries, and the-O output compiles as follows: Testzsexe,-wall represents the output compilation warning message, if-wall is changed to-werror, it stops compiling when a warning message is encountered. -i specifies the path to the library header file. In this case, you can also not specify the/I directive. Because/usr/include is the system default header file path. Use #include <openssl/....h> in your code.
When the window platform code moves the value to Linux, it encounters the following exception: Fopen_s?was not declared in this SCOP, no fopen_s (...) in Linux function, so either start with the fopen function of the Linux platform, or re-implement the fopen_s function.
Linux GCC Compilation journal