gcc -I -L -l -D

  • -I"path" include the header path

  • -L"path" include the dynamic path or static path

  • -llibname include the library name, without lib prefix.

you can specify the dynamic library in the LD_LIBRARY_PATH as well.

  • -D add individual macro definition.
    such as main.cpp:
int main()
{
    int a=0,b=1;
    int c=a+b;

  #ifdef DEBUG
      cout<<"result = "<<c<<endl;
 #endif
return c;
}

You can generate verbose version program using

g++ main.cpp -o main -DDEBUG
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容