Building static library using Code::Block with MinGW

别来无恙 提交于 2019-12-07 18:50:04

问题


I am using Code::Blocks with MinGW32 on a Windows machine. And I am trying to build a static library.

I created a dummy hello world project. There is one single main.c file in the project. However, when I build it, I got the following message. It seems that there is no errors or warnings. It is just that no lib file is generated.

mingw32-gcc.exe -Wall -g  -c C:\Users\yzhong52\Desktop\hello_static_lib\main.c -o obj\Debug\main.o
cmd /c if exist bin\Debug\libhello_static_lib.a del bin\Debug\libhello_static_lib.a
mingw32-gcc-ar.exe -r -s bin\Debug\libhello_static_lib.a obj\Debug\main.o
sorry - this program has been built without plugin support
Process terminated with status 1 (0 minute(s), 0 second(s)) 0 error(s), 0 warning(s) (0 minute(s), 0 second(s))

It says, sorry - this program has been built without plugin support. What does that mean? Am I missing sth?

BTW, I also tried building a dynamic library using pretty much the same method and it works fine. The .dll and the lib.a are generated.

Edit:

After switching from mingw32-gcc-ar.exe to ar.exe, everything works just fine. I still don't understand why though.

来源:https://stackoverflow.com/questions/23796017/building-static-library-using-codeblock-with-mingw

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!