SOLVED: NetBeans compiling - 'comm' was not declared in this scope


I’m working with the Windows toolchain that was generously created by mumblepins and I’m getting the error in the title of this post when doing a clean compile in NetBeans. My guess is that I’m missing a compiler definition (or more likely several) but I have no idea where to turn. I’ve done a bunch of Googling and nothing seems to turn up.

For more info, the error occurs in logging.h when compiling spark_protocol.cpp.

Also I did a fresh Git clone from the repo today.

Thanks in advance for the help!

Building cpp file: src/spark_protocol.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/communication/platform-0-prod-0/src/
arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F10X_MD -DPLATFORM_THREADING=0 -DPLATFORM_ID=0 -DPLATFORM_NAME=core -DUSBD_VID_SPARK=0x1D50 -DUSBD_PID_DFU=0x607F -DUSBD_PID_CDC=0x607D -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -DPRODUCT_ID=0 -DPRODUCT_FIRMWARE_VERSION=65535 -DSYSTEM_VERSION_STRING=0.6.1-rc.2 -DRELEASE_BUILD -Werror -I./src -I../hal/inc -I../hal/shared -I../dynalib/inc -I../services/inc -I../wiring/inc -I./lib/mbedtls/include -I./lib/tropicssl/include -Ilib/tropicssl/include -I. -MD -MP -MF ../build/target/communication/platform-0-prod-0/src/spark_protocol.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DMBEDTLS_CONFIG_FILE="<mbedtls_config.h>" -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"comm\""  -fno-exceptions -fno-rtti -fcheck-new -std=gnu++11 -c -o ../build/target/communication/platform-0-prod-0/src/spark_protocol.o src/spark_protocol.cpp
../services/inc/logging.h: In static member function 'static const char* _LogCategoryWrapper<T>::name()':
<command-line>:0:21: error: 'comm' was not declared in this scope
../services/inc/logging.h:263:16: note: in expansion of macro 'LOG_MODULE_CATEGORY'
         return LOG_MODULE_CATEGORY;
make[1]: *** [../build/target/communication/platform-0-prod-0/src/spark_protocol.o] Error 1
make[1]: Leaving directory `/c/WirelessGauge_0.1/communication'
make: *** [communication] Error 2

So, I have experimented and found that this is only a problem when building in NetBeans. I can do a build from the commandline with no issues. When I run a build form NetBeans I get the error. I did manage to figure out how to pass the PLATFORM=photon to make. That can be evidenced here:

C:\Particle\Toolchain\MinGW\msys\1.0\bin\make.exe PLATFORM=photon -f makefile clean
Building firmware for Production Photon, platform ID: 6, product ID: 6

So, now it may be a flag (or flags) being passed to the compiler by default in NetBeans that is not being passed when compiling from the commandline.

Any ideas?

Since I posted this I had the idea to compare the options padded when compiling through NetBeans and commandline. Unfortunately no smoking gun. They are identical!

It gets curiouser and curiouser!

I finally solved this problem by posting in the NetBeans forum.

It turns out that there are two settings in the NetBeans project that can affect binary library search paths.

If anyone else is having these problems you can go into the project settings and disable the following:

Under Build un-check “Modify Tool Collection Path”

Under Code Assistance un-check “Use Build Analyzer”

1 Like

I had the same problem. Thanks for post the solution. It was a lot of help for me.
But I remain in doubt as to compile for a specific platform (photon, lectron, etc).
Thanks a Lots