I am trying to compile a set of .c files from an open source project into a static library. I created a VC ++ 9 project file, installed everything as usual. I add two .c files to the project. They do not have special compilation settings - all settings are set at the project level and are set to the default value, except that I disabled the precompiled headers.
I click "Build project" - VC ++ says "Done", two .obj files and a .lib file are created, but the functions from the .c files are missing in the resulting .lib file.
If I add #errorone of the two files at the very beginning, VC ++ will stop compiling and reporting. But if I do the same with another file, it just silently compiles and does not report an error, so it obviously does not compile the file and therefore functions do not get into the .lib file.
Now I suppose that if I add some text (for example #error) as the first line of the .c file, the compiler will see it regardless of the preprocessor settings, compiler options, etc. But I have a file log.c:
#error
whatever text follows
and Visual C ++:
1>------ Build started: Project: MyProject, Configuration: Debug Win32 ------
1>Compiling...
1>log.c
1>Build log was saved at "file://whatever\Debug\BuildLog.htm"
1>MyProject - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
What happens to the compiler and how can I change it?
source
share