More info on compile errors?

Status
Not open for further replies.

ipaq3115

Active member
Hey guys, is there anyway to get more info on a compile error than what I can see with verbose mode in the arduino log?

I've got a library that compiles on older versions of arduino/teensyduino but won't compile on the latest. (arduino 1.8.5 teensyduino 1.41) It's a fairly large library and I'm having trouble narrowing down exactly what the problem is.

Aside from a few warnings the only error indication I get is "Error compiling for board Teensy 3.6" and it couldn't initialize the constructor from the library, presumably because the library itself won't compile for some unknown reason. Any guidence would be appreciated!
 
Likely the issue would be identified if the full verbose output were presented.
It will show what libraries are being used from where - like an old copy from sketchbook/libraries.
The failed lib compile resulted in that object not being present for linking which is why the final error. So the library needs to fixed to work.
 
This is the full output. I can't find any actual errors though. All I see are warnings which shouldn't stop it from compiling right?

Code:
Arduino: 1.8.5 (Windows 10), TD: 1.41, Board: "Teensy 3.6, Serial, 24 MHz, Faster, US English"

C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\arduino-builder -dump-prefs -logger=machine -hardware C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware -hardware C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\portable\packages -tools C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\tools-builder -tools C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\tools\avr -tools C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\portable\packages -built-in-libraries C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\libraries -libraries C:\Users\Tim\Dropbox\_Radio_Projects\libraries -fqbn=teensy:avr:teensy36:usb=serial,speed=24,opt=o2std,keys=en-us -ide-version=10805 -build-path C:\Users\Tim\AppData\Local\Temp\arduino_build_504489 -warnings=none -build-cache C:\Users\Tim\AppData\Local\Temp\arduino_cache_851106 -verbose C:\Users\Tim\Dropbox\_Radio_Projects\THiEF_CRP\THiEF_CRP.ino
C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\arduino-builder -compile -logger=machine -hardware C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware -hardware C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\portable\packages -tools C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\tools-builder -tools C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\tools\avr -tools C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\portable\packages -built-in-libraries C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\libraries -libraries C:\Users\Tim\Dropbox\_Radio_Projects\libraries -fqbn=teensy:avr:teensy36:usb=serial,speed=24,opt=o2std,keys=en-us -ide-version=10805 -build-path C:\Users\Tim\AppData\Local\Temp\arduino_build_504489 -warnings=none -build-cache C:\Users\Tim\AppData\Local\Temp\arduino_cache_851106 -verbose C:\Users\Tim\Dropbox\_Radio_Projects\THiEF_CRP\THiEF_CRP.ino
Using board 'teensy36' from platform in folder: C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\teensy\avr
Using core 'teensy3' from platform in folder: C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\teensy\avr
Detecting libraries used...
"C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w  -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -felide-constructors -std=gnu++14 -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK66FX1M0__ -DTEENSYDUINO=141 -DARDUINO=10805 -DF_CPU=24000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\teensy\avr\cores\teensy3" "C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\sketch\THiEF_CRP.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w  -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -felide-constructors -std=gnu++14 -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK66FX1M0__ -DTEENSYDUINO=141 -DARDUINO=10805 -DF_CPU=24000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\teensy\avr\cores\teensy3" "C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\sketch\THiEF_CRP.ino.cpp" -o "C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -felide-constructors -std=gnu++14 -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK66FX1M0__ -DTEENSYDUINO=141 -DARDUINO=10805 -DF_CPU=24000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\teensy\avr\cores\teensy3" "C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\sketch\THiEF_CRP.ino.cpp" -o "C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\sketch\THiEF_CRP.ino.cpp.o"
In file included from C:\Users\Tim\Dropbox\_Radio_Projects\THiEF_CRP\THiEF_CRP.ino:2:0:

C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\sketch\bluetooth/bluetooth.h: In member function 'int iWrap::h(const char*, ...)':

C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\sketch\bluetooth/bluetooth.h:940:17: warning: unused variable 'returnval' [-Wunused-variable]

             int returnval = vdprintf((int)&db, format, ap);

                 ^

In file included from C:\Users\Tim\Dropbox\_Radio_Projects\THiEF_CRP\THiEF_CRP.ino:79:0:

C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\sketch\AsciiParser.h: In member function 'void AsciiParser::send(const char*)':

AsciiParser.h:137: warning: unused variable 'checksum' 
         int checksum = 0;

             ^

THiEF_CRP: In function 'void handleComPorts()':
THiEF_CRP:694: warning: variable 't' set but not used 
     static elapsedMillis t = 30001;

                          ^

front_end: In function 'void tune(long long int, int)':
front_end:418: warning: unused variable 't' 
     long long t;

               ^

In file included from C:\Users\Tim\Dropbox\_Radio_Projects\THiEF_CRP\THiEF_CRP.ino:79:0:

C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\sketch\AsciiParser.h: In member function 'void AsciiParser::detectAndPack()':

AsciiParser.h:84: warning: iteration 5u invokes undefined behavior 
             for(int i=0;i<8;i++) debugPort.printf("%X ", tmp_msg.ary[i]); debugPort.printf("\r\n");

                                                                       ^

C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\sketch\AsciiParser.h:84:26: note: containing loop

             for(int i=0;i<8;i++) debugPort.printf("%X ", tmp_msg.ary[i]); debugPort.printf("\r\n");

                          ^

front_end: In function 'void tune(long long int, int)':
front_end:168: warning: 'tx_r' may be used uninitialized in this function 
     long long tmp_tx,tx_n,tx_r,tx_a;

                           ^

front_end:169: warning: 'tmp_rx' may be used uninitialized in this function 
     long long tmp_rx,rx_n,rx_r,rx_a;

               ^

front_end:420: warning: 'tmp_tx' may be used uninitialized in this function 
     tmp_tx *= 10; // Convert to Hz from tens of Hz

                 ^

C:\Users\Tim\Dropbox\_Radio_Projects\THiEF_CRP\THiEF_CRP.ino: At global scope:

THiEF_CRP:124: warning: 'int {anonymous}::d(const char*, ...)' defined but not used 
     int d(const char* format, ...) {

         ^

Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"C:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\teensy/../tools/arm/bin/arm-none-eabi-gcc" -O2 -Wl,--gc-sections,--relax,--defsym=__rtc_localtime=1527716795 "-TC:\Users\Tim\_data\Software_Development\Arduino\arduino-1.8.5\hardware\teensy\avr\cores\teensy3/mk66fx1m0.ld" -lstdc++  -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -o "C:\Users\Tim\AppData\Local\Temp\arduino_build_504489/THiEF_CRP.ino.elf" "C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\sketch\THiEF_CRP.ino.cpp.o" "C:\Users\Tim\AppData\Local\Temp\arduino_build_504489/..\arduino_cache_851106\core\core_teensy_avr_teensy36_usb_serial,speed_24,opt_o2std,keys_en-us_6be3e453757c12687fdbf23baf3c4f4e.a" "-LC:\Users\Tim\AppData\Local\Temp\arduino_build_504489" -larm_cortexM4lf_math -lm
C:\Users\Tim\AppData\Local\Temp\arduino_build_504489\sketch\THiEF_CRP.ino.cpp.o: In function `__static_initialization_and_destruction_0':

C:\Users\Tim\Dropbox\_Radio_Projects\THiEF_CRP/THiEF_CRP.ino:81: undefined reference to `iWrap::iWrap(bool, bool, bool)'

collect2.exe: error: ld returned 1 exit status

Error compiling for board Teensy 3.6.
 
It is a link error. Look at the last few lines of your listing. Looks like a constructor for iWrap
 
Yeah, I saw that but I figured that happened because the library couldn't be compiled for some other reason?

The constructor for iWrap is there and this library compiles just fine in an older version of arduino/teensyduino so I figure something in the compiler is changed.

Is there no other place to look for error logs? Right now I'm randomly commenting things out trying to make it compile which will probably work eventually but it's a slow process.
 
Hard to say! Don’t see the source files. You may have constructor defined but not implemented. At least not with the right parameters
 
but I figured that happened because the library couldn't be compiled for some other reason?

From the portion you've shown us, there doesn't seem to be any other actual error that would cause this.

The constructor for iWrap is there and this library compiles just fine in an older version of arduino/teensyduino so I figure something in the compiler is changed.

Usually newer compilers generate more errors or warnings for bad code.

Since you're not seeing such an error (or it isn't in the portion you showed us), I'd guess the compiler isn't likely to blame.

Is there no other place to look for error logs?

This is it. Arduino shows you all the compiler errors & warnings.

Right now I'm randomly commenting things out trying to make it compile which will probably work eventually but it's a slow process.

We could probably help...

But you'd need to trim it to a smaller program that still has the error and posting all the stuff here, so we can copy it into Arduino and get the same error. If you look over the many thread on this forum, we're very good at diagnosing these kinds of problems when we can reproduce them. When we have to blind guess, we're probably around 25-50% effective...
 
From the portion you've shown us, there doesn't seem to be any other actual error that would cause this.

Usually newer compilers generate more errors or warnings for bad code.

Since you're not seeing such an error (or it isn't in the portion you showed us), I'd guess the compiler isn't likely to blame.

This is it. Arduino shows you all the compiler errors & warnings.

Yeah, that's why I was confused. This is the entire error text in the Arduino output log.

We could probably help...

But you'd need to trim it to a smaller program that still has the error and posting all the stuff here, so we can copy it into Arduino and get the same error. If you look over the many thread on this forum, we're very good at diagnosing these kinds of problems when we can reproduce them. When we have to blind guess, we're probably around 25-50% effective...

Of course. I didn't want to bug you guys with debugging my huge code. I was just hoping there was some hidden place to find more errors that I could follow.

For some reason I was having a heck of a time narrowing down the code and keeping the error.

For now I've rewritten/copied the parts of the code I needed. If I can get a smaller piece of code that reproduces the error I will definitely post it here, thanks.
 
Status
Not open for further replies.
Back
Top