0

I have the following code:

It’s fairly self-explanatory: lib.c is built as a static library, main.c is built as part of the executable, and build.bat simply builds everything. When I run build.bat, I get an “undefined reference to `memset'” error. Should be reproducible on your end. I built it with 8.30.0 and 4.8.4 and got the error. Note that if you change ‘#if 0’ to ‘#if 1’, you don’t get the warning. Also, if you build the exe using gcc instead of ld, you don’t get the error.

Open Source Tools Support selected answer