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