3.10 gcc -static作用

本文详细解释了gcc-static的概念,即在编译过程中禁止调用动态库,将所有必需的函数库集成到编译出的程序中,从而使程序能够独立于外部函数库运行。这一过程虽然会增加程序大小,但提高了程序的便携性和独立性。

gcc -static:
表示的是编译的时候禁止调用动态库,此时就是说完全编译出的东西是比较大的。让 gcc 进行静态编译,也就是把所有都需要的函数库都集成进编译出来的程序上,这个程序就可以不依赖外部的函数库运行了。

python3.10 mingw64 编译pyd文件,报错D:\gitlab\cython_asn1>python setup.py running build_ext building 'v2x_decoder' extension gcc -mdll -O -Wall -I./includes -ID:\programs\python310\include -ID:\programs\python310\Include -c spdu_decoder.cpp -o build\temp.win-amd64-cpython-310\Release\spdu_decoder.o -std=c++11 -O3 -Wall -m64 -DMS_WIN64 -static-libgcc -static-libstdc++ spdu_decoder.cpp: In function 'const char* spdu_oer_asn1_decode(const unsigned char*, int, int*)': spdu_decoder.cpp:75:9: warning: unused variable 'ret' [-Wunused-variable] int ret = 0; ^~~ gcc -mdll -O -Wall -I./includes -ID:\programs\python310\include -ID:\programs\python310\Include -c v2x_decoder.cpp -o build\temp.win-amd64-cpython-310\Release\v2x_decoder.o -std=c++11 -O3 -Wall -m64 -DMS_WIN64 -static-libgcc -static-libstdc++ writing build\temp.win-amd64-cpython-310\Release\v2x_decoder.cp310-win_amd64.def g++ -O -Wall -shared -s build\temp.win-amd64-cpython-310\Release\spdu_decoder.o build\temp.win-amd64-cpython-310\Release\v2x_decoder.o build\temp.win-amd64-cpython-310\Release\v2x_decoder.cp310-win_amd64.def -LD:\programs\python310\libs -LD:\programs\python310 -LD:\programs\python310\PCbuild\amd64 -lpython310 -lucrt -lvcruntime140 -o build\lib.win-amd64-cpython-310\v2x_decoder.cp310-win_amd64.pyd -L./libs -lasncodec -m64 D:/programs/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lucrt collect2.exe: error: ld returned 1 exit status error: command 'D:\\programs\\mingw64\\bin\\g++.exe' failed with exit code 1
07-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值