Go Down

Topic: compiler snafu: twi.c compiles. wire.c no-scope twi_init() (Read 701 times) previous topic - next topic

Xnloder

Hello, world.

I'm building a distributed robotic control system using a 2560 as central control and an array of UNO 328p as stepper controllers with the 2560<->328p talking over twi.

I'm using AVRStudio4 with Project Options compiler set to WinAVR-20100110 avr-c++.exe and linker make.exe.  This setup works for a the 2560 code.  Both the 2560 and 328p have the same Project Options (except for target cpu)...same include files paths, same compilation options.

The problem occurs when I compile the 328p code.  After a make clean, the compile sequence halts at wire.cpp, which can't 'see' twi_init.  This occurs _after_ twi.c compiles.  Actual error message:

../../libraries/Wire/Wire.cpp:60: error: 'twi_init' was not declared in this scope

Suggestions?  Thanks!

--Xnloder

PaulS

Quote
I'm using AVRStudio4

Do you have the same issue in the Arduino IDE?

Xnloder

there are _many_ twi.h files in my system.  Using default compiler includes <> means the compiler picks whichever of these it finds first.  Apparently the one it found didn't work. 

This bug was fixed by changing the #include to contain explicit directory information.

Xnloder

The problem does not occur using the IDE.  But then you don't know what is happening 'under the hood', don't get map files, aren't able to do the stuff you came to Arduino to do...IDE is great to begin with, but is not a tool for real development. 

On the other hand, it works, so maybe it is a real tool.

Go Up