Go Down

Topic: Arduino on Xcode Project — Official Thread (Read 163605 times) previous topic - next topic

hi Avenue33 and gianmarco

if you get this:
make: *** No rule to make target `/Applications/Arduino.app/Contents/Resources/Java/hardware/Sanguino/cores/arduino/pins_arduino.o', needed by `bin/core.a'.  Stop.

It means you are trying to compile for sanguino and he can't find a file in the Sanguino folder. In this case you would need to have the sanguino sources in your arduino app. You can find instructions about that here: http://sanguino.cc/

Also, if you are not trying to build for Sanguino, you should change the build setting in XCode to make it build for your specific board. I have put the instructions on how to do that in the Readme inside the XCode project:
https://github.com/timknapen/Arduino-With-XCode/blob/master/Arduino/ArduinoOnXCode4_2/README

And maybe you didn't download the specific project for XCode4 on github. It is called "ArduinoOnXCode4_2" , I just re-uploaded that.
The one called "ArduinoOnXcode/" is the template for XCode 3.2

let me know if it still fails, I can't test on Lion right now because I'm out of the country.

best,
tim

avenue33

Quote
I don't understand git… :(


Neither do I, even with the nice Git front client installed on my MacBook ;) .

Thanks Tim,
I've downloaded the correct project, tried to compile it (after verifying that the current board is UNO) and still an error appears inside Arduino.h: This header seems not available.

Code: [Select]
#include "pins_arduino.h"

avenue33

Try

Code: [Select]
#include <pins_arduino.h>
instead of
Code: [Select]
#include "pins_arduino.h"

The same problem arises with Eclipse.

are you using the new Arduino app (arduino 1.0) ? My projects are not updated to that version yet. Will try to do it as soon as possible.

For now, it is only tested with Arduino app 0022 like it says in the readme: https://github.com/timknapen/Arduino-With-XCode/blob/master/README

best,
tim.

@Tim: yes, I'm new to C and Arduino and and I downloaded the last version last week.
Having the project for the last version would be great


@avenue33: unfortunately, nothing has changed =(

yes, the newest version (1.0) has changed quite a bit I think.

An example from the release notes of Arduino 1.0:
Quote
The WProgram.h file, which provides declarations for the Arduino API,
  has been renamed to Arduino.h. ...


Your problem is probably related to that.

Just download the 0022 version and see if that works for now. I'll get the a working project with the new Arduino version up on github after next week.

best,
tim.

Thanks Tim, I'll take a look at that trying to solve this issue. I hope so.

Thanks, I'll let you know :)

avenue33

Tim,

On Xcode 4.2.1 running on Mac OS X 10.7.2 with Arduino 0022, I have the following error message

Code: [Select]
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin//avr-ar: bin/core.a: No such file or directory


I haven't installed the FTDIUSBSerialDriver_10_4_10_5_10_6 since it isn't required on OS X.

Any clue?

#54
Dec 14, 2011, 08:16 pm Last Edit: Dec 14, 2011, 08:23 pm by timKnapen Reason: 1
Hey Avenue,

I think that's a big "whoops" on my part...
there is one "/" too many in

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin//avr-ar: bin/core.a: No such file or directory

so my guess is that the AVRDUDE_DIR variable in the makefile is wrong. It was
Code: [Select]
AVRDUDE_DIR = /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/

and I changed it to
Code: [Select]
AVRDUDE_DIR = /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin


You can adjust it yourself or get the updated one from github.

let me know if it works, I can't test on Lion right now.

best,
tim

avenue33

Never mind about the oops!

Code: [Select]
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-ar: bin/core.a: No such file or directory


Unfortunately, the bin/core.a remains orphan.




Swany

Trying to get things going. I am running...

- Lion 10.7.2
- Xcode 4.2.1
- Arduino Version 0022
- timknapen-Arduino-With-XCode-08ce0ae
- Duemilanove 168 (also have a Mega and a few clones)

Sample project builds and upload fine. I started a project that uses the Wire library and get...
Quote
bin/core.a(Wire.o): In function `TwoWire::send(unsigned char)':
Wire.cpp:(.text._ZN7TwoWire4sendEh+0x3c): undefined reference to `twi_transmit'

plus a couple more similar errors. It appears twi.h can't be found. I've tried changing #includes from angle brackets to quotes (and visa versa), moving the twi.c and twi.h out of the "utility" folder and into the same folder as wire.h and wire.cpp, changing stuff in the compat folder (#include "util/twi.h" to #include "utility/twi.h", etc, etc, etc.

Boy there are a bunch of copies of the include files inside the Arduino app. One thing I noticed about the "starter folder" from GitHIb: There references to "arduino" and "libraries" in the project tree were bad (red) so I deleted them and re-added them from the  Arduino app. Was this the right thing to do?

Chasing my tail... Any ideas?

avenue33

The bin/core.a seems to be a source of troubles...

I hope timKnapen could consolidate all the feed-back, fix the issues and release a new version!

Good luck timKnapen :)

haha thanks Avenue,

I am following this conversation, but I am traveling without a computer that runs Lion. I'll be able to fix all these issues in two weeks.

Also thank Swany and gianmarcoodorizzi for all the great feedback!

best,
tim.

avenue33

#59
Dec 18, 2011, 10:52 am Last Edit: Dec 18, 2011, 11:03 am by avenue33 Reason: 1
Bonjour Tim,

No problem.

I've played with the Visual Micro, an Arduino plug-in for Microsoft Visual Studio and it's really nice.

Back to Xcode, the 4.2 release looks really buggy: I had many "Xcode has crashed" messages when I was coding some plain C++.

I'm considering downgrading to the previous stable release Xcode 3. Other candidates are Eclipse and NetBeans. Both have a dedicated Arduino plug-in available.

Since the makefile is too cumbersome, have you considered Ino? It's a command-line version of the Arduino pre-compiler / compiler. It works fine on my MacBook.

Best regards,


Go Up