I met a very weird situation with my c++ project. When I include standard libraries such as "#include <cmath>" and "#include <cstdlib>" in main.c file, it can be successfully built and run. However, if I want to call a function file including these libraries, for example random.c, I got the error like "fatal error: cstdlib: No such file or directory".
Does anybody have any idea about that? I don't think the standard library need to be linked. I am using GNU GCC compiler with default setup.
C compiler: gcc.exe
C++ compiler: g++.exe
Linker for dynamic libs: g++.exe
Linker for static libs: ar.exe
Debugger: GDB/CDB debugger: Default
Resource compiler: windres.exe
Make program: mingw32-make.exe
Many thanks!