Build Is Not Creating ANY Object Files

I have a huge, complex ESP32 project, involving many dozens of classes, which seems to have run face-first into some incompatibility with the Arduino build system. It has been working fine for a long, long time, but I recently did some “re-factoring” to clean things up, and the build now fails spectacularly. Problem is, I can’t see anything wrong with the code itself, and the errors are just bizarre.

It goes through the motions of compiling all of the libraries, but when I look at the build directory, there are absolutely NO .o files, or ANY output files of any kind, except for the includes.cache file, and the preproc directory, with a single ctags file in it! All of the correct source files are present, and located where they should be. The build blows up on compiling the .ino file, with the following first error (of many similar ones):

In file included from E:\Users\RayL\Documents\Arduino\Build\sketch\src/Comm/CommBase.h:12:0,

                 from e:\Users\RayL\Documents\Arduino\SmartGaugeESP32\SmartGaugeESP32.ino:20:

E:\Users\RayL\Documents\Arduino\Build\sketch\src/Comm/DumbGaugeComm.h:8:1: error: expected class-name before '{' token

 {

 ^

In file included from E:\Users\RayL\Documents\Arduino\Build\sketch\src/Comm/CommBase.h:13:0,

                 from e:\Users\RayL\Documents\Arduino\SmartGaugeESP32\SmartGaugeESP32.ino:20:

It seems to not recognize that CommBase is a valid class, even though it has to be parsing CommBase.h.
Here is DumbGaugeComm.h, which generates the error.

#pragma once


#include "CommBase.h"


class DumbGaugeComm : public CommBase
{                                                                      <<=====  THIS LINE
    DumbGaugeComm(void);
    ~DumbGaugeComm(void);

    void ProcessMsg(void);
};

CommBase IS properly defined in CommBase.h, which is in its proper place in the build tree, along with DumbGaugeComm.h. So, all the source files are where they should be in the build tree, but the build fails.

Clearly, it IS compiling ALL of the libraries, with NO errors, but not saving their object files. Then, when it tries to compile the sketch itself, it blows up because none of the library binaries actually exist.

Here’s the odd thing I noticed, in looking at the build console output:

EVERY command line that does a library compile gives the output file path as “-o nul”! The only command line that give a proper output file path is the one compiling the .ino file, which is the one that fails.

Here is the tail of the command line that should compile the CommBase library:

"-IC:\\Users\\RayL\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4\\libraries\\Update\\src" "-IC:\\Users\\RayL\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4\\libraries\\SPI\\src" "E:\\Users\\RayL\\Documents\\Arduino\\Build\\sketch\\src\\Comm\\CommBase.cpp" -o nul

EVERY other compiler command line looks the same, with the same “-o nul” on the end.

Anyone have a clue how/why this is happening? Or even where to look?

Can you back up one IDE release?

Paul

Well, this is odd.... I found the problem. In the .h file I included above, I accidentally left off the "public:" declaration before the constructor. Why on earth that little error results in the base class becoming unknown, and all the object file paths being set to nul, is a complete mystery to me. But, with that one change, I'm now getting sensible error messages, and the build now includes object files for the libraries.

That was a bizarre one, even by Arduino build standards....