I'm trying to use Code Blocks to compile some programs under C instead of C++. They were written a long time ago and have C specific code. I set the compile option: -x c so that it will use the gnu c compiler. I also set the "Save build log to HTML file when build is finished." option so I got results in html format, which explains the html tags in my post. After doing a clean then a build, I got:
------------------------------------
mingw32-gcc.exe -Wall -g -x c -c G:\MYSRC\main.c -o obj\Debug\main.o<br />
G:\MYSRC\main.c: In function 'main':<br />
<font color="#0000ff">G:\MYSRC\main.c:8:5: warning: implicit declaration of function 'xmalloc' [-Wimplicit-function-declaration]</font><br />
<font color="#0000ff">G:\MYSRC\main.c:8:12: warning: assignment makes pointer from integer without a cast [enabled by default]</font><br />
<font color="#0000ff">G:\MYSRC\main.c:6:12: warning: variable 'mylist' set but not used [-Wunused-but-set-variable]</font><br />
mingw32-gcc.exe -o bin\Debug\simple.exe obj\Debug\main.o <br />
obj\Debug\main.o: In function `main':<br />
<font color="#ff0000">G:/MYSRC/main.c:8: undefined reference to `xmalloc'</font><br />
collect2.exe: error: ld returned 1 exit status<br />
------------------------------------
I took the advice at the post:
How to compile only in C Mode only. Using GCC compiler
« on: August 08, 2013, 05:45:09 pm »
and changed the Toolchain executables for Linker dynamic libs from mingw32-g++.exe to mingw32-gcc.exe. That had no effect.
This is weird. It's running the compile twice. What could be causing this?