Pages: [1]   Go Down
Author Topic: Problems compiling a program  (Read 7720 times)
0 Members and 1 Guest are viewing this topic.
Varna, Bulgaria
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everybody,

I have problems with Arduino 1.0 while trying to comple a program. This is what I get as an error. I am getting this errors even on an empty project.

/home/user/projects/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:91:41: error: attempt to use poisoned "SIG_USART0_RECV"
/home/user/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:101:15: error: attempt to use poisoned "SIG_USART0_RECV"
/home/user/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:132:15: error: attempt to use poisoned "SIG_USART1_RECV"
/home/user/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:145:15: error: attempt to use poisoned "SIG_USART2_RECV"
/home/user/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:158:15: error: attempt to use poisoned "SIG_USART3_RECV"

I am running Gentoo Linux with kernel 3.0.6, avr-libc version 1.8.0, avrdude 5.5, binutils 2.22-r1, gcc-4.5.3-r2.
I have the same problem with Arduino-0022. I cannot understand where is the problem so I need your help and your suggestions.

Thanks!
« Last Edit: February 16, 2012, 09:15:32 pm by ivo1st » Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5856
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It appears to be a problem with deprecated items in avr-libc v1.8.0.
I got this from the savannah site. I presume from past experience that "__AVR_LIBC_DEPRECATED_ENABLE__" is not defined in IDE V1.0.

Quote
/* Deprecated items */
#if !defined(__AVR_LIBC_DEPRECATED_ENABLE__)

#pragma GCC system_header

#pragma GCC poison SIG_INTERRUPT0
#pragma GCC poison SIG_INTERRUPT1
#pragma GCC poison SIG_INTERRUPT2
#pragma GCC poison SIG_INTERRUPT3
#pragma GCC poison SIG_INTERRUPT4
#pragma GCC poison SIG_INTERRUPT5
#pragma GCC poison SIG_INTERRUPT6
#pragma GCC poison SIG_INTERRUPT7
#pragma GCC poison SIG_PIN_CHANGE0
#pragma GCC poison SIG_PIN_CHANGE1
#pragma GCC poison SIG_PIN_CHANGE2
#pragma GCC poison SIG_WATCHDOG_TIMEOUT
#pragma GCC poison SIG_OUTPUT_COMPARE2A
#pragma GCC poison SIG_OUTPUT_COMPARE2B
#pragma GCC poison SIG_OVERFLOW2
#pragma GCC poison SIG_INPUT_CAPTURE1
#pragma GCC poison SIG_OUTPUT_COMPARE1A
#pragma GCC poison SIG_OUTPUT_COMPARE1B
#pragma GCC poison SIG_OUTPUT_COMPARE1C
#pragma GCC poison SIG_OVERFLOW1
#pragma GCC poison SIG_OUTPUT_COMPARE0A
#pragma GCC poison SIG_OUTPUT_COMPARE0B
#pragma GCC poison SIG_OVERFLOW0
#pragma GCC poison SIG_SPI
#pragma GCC poison SIG_USART0_RECV
#pragma GCC poison SIG_USART0_DATA
#pragma GCC poison SIG_USART0_TRANS
#pragma GCC poison SIG_COMPARATOR
#pragma GCC poison SIG_ADC
#pragma GCC poison SIG_EEPROM_READY
#pragma GCC poison SIG_INPUT_CAPTURE3
#pragma GCC poison SIG_OUTPUT_COMPARE3A
#pragma GCC poison SIG_OUTPUT_COMPARE3B
#pragma GCC poison SIG_OUTPUT_COMPARE3C
#pragma GCC poison SIG_OVERFLOW3
#pragma GCC poison SIG_USART1_RECV
#pragma GCC poison SIG_USART1_DATA
#pragma GCC poison SIG_USART1_TRANS
#pragma GCC poison SIG_2WIRE_SERIAL
#pragma GCC poison SIG_SPM_READY
#pragma GCC poison SIG_INPUT_CAPTURE4
#pragma GCC poison SIG_OUTPUT_COMPARE4A
#pragma GCC poison SIG_OUTPUT_COMPARE4B
#pragma GCC poison SIG_OUTPUT_COMPARE4C
#pragma GCC poison SIG_OVERFLOW4
#pragma GCC poison SIG_INPUT_CAPTURE5
#pragma GCC poison SIG_OUTPUT_COMPARE5A
#pragma GCC poison SIG_OUTPUT_COMPARE5B
#pragma GCC poison SIG_OUTPUT_COMPARE5C
#pragma GCC poison SIG_OVERFLOW5
#pragma GCC poison SIG_USART2_RECV
#pragma GCC poison SIG_USART2_DATA
#pragma GCC poison SIG_USART2_TRANS
#pragma GCC poison SIG_USART3_RECV
#pragma GCC poison SIG_USART3_DATA
#pragma GCC poison SIG_USART3_TRANS

#endif  /* !defined(__AVR_LIBC_DEPRECATED_ENABLE__) */
Logged

Varna, Bulgaria
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your reply.

I saw this too, but I am now aware how to patch it. Is there any solution or patch available?
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5856
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which board do you have selected in the IDE?

I think I found part of the solution, but I haven't found where these are defined. The second line is the new define for the HardwareSerial.cpp.

Code:
//#if defined(SIG_USART1_RECV)
#if defined(USART1_RX_vect)

Does someone know where these are defined? It appears to be by board type.

I am still checking in my spare time.

edit: I think I found the defines (avr/io.h), but the include files are by board type, and there are several. Knowing which board you have selected will help.
« Last Edit: February 17, 2012, 07:51:53 am by SurferTim » Logged

Varna, Bulgaria
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I understand what you say. I am using Arduino Mega 2560  smiley
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5856
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

One more thing you should know...I will try about anything, so you must decide what you want to do.

Here is what I found. The main file was "../avr/io.h".
The Mega2560 includes the header "../avr/io2560.h".
That file includes the header "../avr/iomxx0_1.h", and this is an excerpt from that file. Note both the new and old format are defined. According to the defines in HardwareSerial.cpp, the new format will have precedence.

Code:
/* USART0, Rx Complete */
#define USART0_RX_vect _VECTOR(25)
#define SIG_USART0_RECV _VECTOR(25)

Insure that file has both defines for all those USARTs mentioned in the error. That is about as good as I can do.

edit: You will probably find these files somewhere in your /usr/ folder. Do a search for one of them.


« Last Edit: February 17, 2012, 11:15:12 am by SurferTim » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Y'll

I am very impressed by the speed and quality of the reply and offered solutions.
There are two things I do not understand, and will be happy to learn:

1.  How come this problem reared its head here, all of a sudden.  Earlier today I built the
     sketch I am working on, several times without a hitch.
     This evening it started complaining about my use of prog_char, etc. elsewhere in the
     code.  It did not complain until this evening!
     The only change I made was to add another library, supporting another piece of hardware.
     There is no reference in the latest addition to the __AVR_LIBC_DEPRECATED_ENABLE__ macro.
     nor is there any mention of this macro anywhere in my code, or the sketch libraries.
     Strange, is it not?

2.  Why is the Arduino web site contain examples choke full of prog_this and prog_that?
2a. Why is the developer that checks in this message not provide a clear backwards competability
     for a while.  This is important as we can see from the "sudden" breakage.

Otherwise, I am as happy as a clam with Arduino et al.


Sincerely,

Sheem-On

Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5856
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

prog_char is a deprecated variable (data type) in avr-libc v1.8.0 (newest version).
(edit2: You probably downloaded it with the last package upgrade from your repository without knowing it)
Here is the bug report and fix for the bug you mentioned:
http://code.google.com/p/arduino/issues/detail?id=795

It was found recently by another forum member, and fixed relatively quickly.
http://arduino.cc/forum/index.php/topic,87186.0.html

edit: To answer your last question, this is open source software. The developers do as good a job as one could expect, considering it is one group writing the avr-gcc compiler, another group writing the avr-libc library, and still another group writing the Arduino IDE. Sometimes, communication between the groups is not as good as it should be. But since it is open source (thankfully), users like me can dig into the code and help them out.  smiley
« Last Edit: February 20, 2012, 08:56:15 am by SurferTim » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I have the same problem:
/home/user/projects/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:91:41: error: attempt to use poisoned "SIG_USART0_RECV"
/home/user/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:101:15: error: attempt to use poisoned "SIG_USART0_RECV"
/home/user/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:132:15: error: attempt to use poisoned "SIG_USART1_RECV"
/home/user/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:145:15: error: attempt to use poisoned "SIG_USART2_RECV"
/home/user/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:158:15: error: attempt to use poisoned "SIG_USART3_RECV"

I am using Arduino mega ADK - how to resolve it ?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've probably found a solution to this pretty annoying problem.
Since I'm running Debian wheezy and I'm pretty lazy i just put the following line as a third line into my Arduino.h
Code:
#define __AVR_LIBC_DEPRECATED_ENABLE__ 1

You can find the Arduino.h (at least on a linux system) under:
Code:
/usr/share/arduino/hardware/arduino/cores/arduino

Hope that helps as a temporary fix
Logged

Ballina, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've probably found a solution to this pretty annoying problem.
Since I'm running Debian wheezy and I'm pretty lazy i just put the following line as a third line into my Arduino.h
Code:
#define __AVR_LIBC_DEPRECATED_ENABLE__ 1

You can find the Arduino.h (at least on a linux system) under:
Code:
/usr/share/arduino/hardware/arduino/cores/arduino

Hope that helps as a temporary fix

Just wanted to say thank.  I've been trying to get code for my Mega 2560 building since switching to Eclipse for my IDE.  Had my UNO up and running pretty easily but the Mega code wouldn't compile due to this very problem.  Putting that line at the top of my Arduino.h file fixed the problem.  Thank you!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I got stuck on the same problem on FreeBSD 9.1-RELEASE, installing arduino from /usr/ports/devel/arduino

I added the line to Arduino.h, and restarted arduino.

Problem solved.

Thank you fmorgner
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It isn't working like it should.
I'm not sure if the modification has anything to do with it.

The upload completes without any errors now, but the mega doesn't work at all.
I get nothing on serial. It seems like the mega is either hanging, or isn't booting up.
The only way to fix it, is to upload the sketch using another computer.

perhaps a bug with mega on Arduino-1.0.4 or FreeBSD port.

Logged

Pages: [1]   Go Up
Jump to: