合集-GCC

摘要:> 多个dir之间需要用`:`分隔 使用`-Wl,-rpath,path`添加运行时库路径,如果不加这个属性,那么可能会无法打开库文件: ```shell gcc -o main main.c -Wl,-rpath,/usr/test -L/usr/test -ltest ``` 阅读全文
posted @ 2023-07-30 18:33 NotReferenced 阅读(129) 评论(0) 推荐(0) 编辑
摘要:# 1、安装 到[MinGW](https://github.com/niXman/mingw-builds-binaries/releases "MinGW")下载最新的安装包 ![image](https://img2023.cnblogs.com/blog/2414603/202308/241 阅读全文
posted @ 2023-08-07 22:30 NotReferenced 阅读(194) 评论(0) 推荐(0) 编辑
摘要:使用-L选项可以添加额外的链接库搜索路径,如下: ```shell gcc -o main main.c -L/usr/test -ltest ``` 阅读全文
posted @ 2023-07-30 18:24 NotReferenced 阅读(64) 评论(0) 推荐(0) 编辑
摘要:使用如下指令生成动态库: gcc test.c -I ./inc -fPIC -shared -o libtest.dll 参数解释: -I:添加头文件搜索目录 -fPIC: 生成位置无关的代码,在编译动态库的时候需要使用该选项 -shared: 表明生成一个共享对象,也就是动态库 阅读全文
posted @ 2023-11-12 11:40 NotReferenced 阅读(338) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示