Error detecting library fnet_serial.c

xoxu

Member
Hi,

I am trying to compile the NativeEthernet / UDPSendReceiveString example from teensyduino for a teensy 4.1 and I get a strange error:
Error while detecting libraries included by C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FNET\s rc\service\serial\fnet_serial.c
The code that I am developing have the same problem
Doesn't do it on the example through normal ethernet / UDPSendReceiveString library.
I am running with Arduino 1.8.13 and Teensyduino 1.53

Any idea?
Thanks
 
I remember one person had an issue like this a year ago when I originally ported it for USB Ethernet on the Teensy 3.6 and 4.0 before the Teensy 4.1 was available. I don’t remember if he fixed it or what he did to fix it nor was I able to recreate the issue on my end no matter what I tried. There was some efforts on my part to try and fix it, but as I couldn’t recreate the problem nothing ever came of it. You may want to try either a clean install or consider trying the beta release version of Teensyduino.
 
No luck on my side.
I tried on an other computer with latest version of arduino and teensyduino and that didn't work
On my computer I tried to reinstall fresh, cleaning the app data folder, registry, removing my folder of library, changing the compilation optimisation, going for the latest beta teensyduino and nothing changed for my code, same error and
Error compiling for board Teensy 4.1.
.
On all the examples using fnet serial (nativeEthernetUDP, FNET_Native_Ethernet,...) I still have the same error but the compilation succeed...
 
Found why I had the :
Error compiling for board Teensy 4.1.
Not related to fnet_serial error, just a redefinition of the mac address on one of my files...
Doesn't change the fact that I still have this fnet_serial error and you may have it too (first fresh compilation with verbose mode and display all) but doesn't stop the compilation
 
Now that you mention it I do remember that being a previous issue, the other guy wasn't able to compile for other reasons, but I know I did try to fix this error as well even though it didn't cause problems. There's not really any information on what causes the error to pop up nor does it stop the file from functioning so even though I couldn't stop the error I just left it as is since it doesn't cause any problems besides throwing a red hearing for people using verbose output.
 
Code:
Error while detecting libraries included by C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FNET\src\service\serial\fnet_serial.c

I get this same error when building programs with the latest FNET/NativeEthernet. When I googled it, I found this thread, and also a page with what sounds like a reasonable explanation. The page is associated with a library called Marlin that was ported to Arduino, and the author says the error is a result of Arduino's pre-processor doing something strange with "empty" macro definitions with comments at the end, such as:

#define FEATURE1 // enable feature1

The author says that later, in some circumstances, FEATURE1 can be replaced by the comment "// enable feature1". Why that would lead to an error message about libraries, I don't know, but here's the link:

https://www.gitmemory.com/issue/MarlinFirmware/Marlin/19720/707994652
 
Unfortunately this is not the case here, as the file in question doesn't have any empty defines with comments at the end, nor do the files it's including or there would be a lot more of these errors showing up. I wish Arduino gave more information about what the actual error is, but after searching for possible causes nothing ever came of it so I dropped the non-issue.
 
I got the same error, but it doesn't seem to affect my build since it still runs fine.
Here's the error with the line before,
Code:
/media/data/arduino-1.8.19/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=156 -DARDUINO=10819 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/media/data/arduino-1.8.19/hardware/teensy/avr/cores/teensy4 -I/media/data/arduino-1.8.19/hardware/teensy/avr/libraries/SPI -I/media/data/arduino-1.8.19/hardware/teensy/avr/libraries/NativeEthernet/src -I/media/data/arduino-1.8.19/hardware/teensy/avr/libraries/FNET/src -I/home/pinaar/Arduino/libraries/DateTime -I/home/pinaar/Arduino/libraries/DateTimeStrings -I/media/data/arduino-1.8.19/hardware/teensy/avr/libraries/Time /media/data/arduino-1.8.19/hardware/teensy/avr/libraries/FNET/src/service/serial/fnet_serial.c -o /dev/null
[COLOR=#ff0000]Error while detecting libraries included by /media/data/arduino-1.8.19/hardware/teensy/avr/libraries/FNET/src/service/serial/fnet_serial.c[/COLOR]
The line after is identical, except it's compiling shell/fnet_shell.c.
 
Follow up on my previous post. I ran the command line I copied from the IDE log into a Unix terminal and it showed,
fnet_serial.c:135:42: error: macro "putchar" passed 2 arguments, but takes just 1
stream->putchar(stream->id, character);
so I deleted the extra arg and it compiled clean, but then when I ran it in the IDE, the opposite message came up in the log,
fnet_serial.c:136:5: error: too few arguments to function 'stream->putchar'
stream->putchar(character);
so I put the arg back in I didn't see the error!
But this morning, I ran the IDE and the original error is there.
I compared the two command lines with errors and noticed the second time it's running "arm-none-eabi-gcc -c" v "arm-none-eabi-g++ -E -CC -x c++" and the Includes are exactly the same, though some of the other arguments differ.
 
Hi,
I am trying to compile the NativeEthernet / UDPSendReceiveString example from teensyduino for a teensy 4.1 and I get a strange error
I know this thread is a bit old, but I am having the same issue which was reported by the original author. Has anyone found out the cause of this?
 
I know this thread is a bit old, but I am having the same issue which was reported by the original author. Has anyone found out the cause of this?

NativeEthernet is becoming (if not already) obsolescent, so I suggest moving to QNEthernet, which is now better supported. If switching libraries alone doesn't solve the issue, you can post the question to one of the QNEthernet forum threads, and the author (shawn) is quite responsive.
 
Back
Top