Go Down

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

ScottG



Can you tell me exactly where on github you have release 43 & 44 .pkg files.  I looked and couldn't find them.  Maybe it would help if we knew which release was the first on to give me this problem.


The log with all changes is available at http://github.com/rei-vilo/embedXcode/commits/master


How do I find the .pkg file on github?  I want to download r43, but all I see is your source files, not a .pkg file.

avenue33

GitHub only hosts the source code, not the installer package.

ScottG


I just downloaded the latest release, which I'm pretty sure is r45.  I created a new project on my local hard drive.  When I run Build, it says it's successful, but I get an error that says" Workspace Integrity.  Couldn't load project" and the project is not loaded.  See screenshots.


I don't know why, but this problem is gone.  New projects are building normally now.

avenue33


I don't know why, but this problem is gone.  New projects are building normally now.


I'm glad it works now. Enjoy embedXcode :)

jimaobian

#334
Apr 26, 2013, 09:20 am Last Edit: Apr 26, 2013, 09:24 am by jimaobian Reason: 1
Hi,
I found I can't build "Marlin" in embedXcode, while in Arduino IDE, it works well. The error code is here

Code: [Select]

7.2-LINK: .elf < . mega2560 Builds/ .
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-gcc -mmcu=atmega2560 -lm -Wl,--gc-sections -Os  -o Builds/embeddedcomputing.elf Builds/LocalLibrary.o Builds/main.o Builds/embeddedcomputing.a -lc
Builds/embeddedcomputing.a(MarlinSerial.o): In function `__vector_25':
/Users/my/Documents/Arduino/libraries/Marlin/MarlinSerial.cpp:54: multiple definition of `__vector_25'
Builds/embeddedcomputing.a(HardwareSerial.o):/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/Arduino/HardwareSerial.cpp:118: first defined here
Builds/embeddedcomputing.a(MarlinSerial.o):(.bss.rx_buffer+0x0): multiple definition of `rx_buffer'
Builds/embeddedcomputing.a(HardwareSerial.o):/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/Arduino/HardwareSerial.cpp:113: first defined here
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld: Warning: size of symbol `rx_buffer' changed from 68 in Builds/embeddedcomputing.a(HardwareSerial.o) to 132 in Builds/embeddedcomputing.a(MarlinSerial.o)
make: *** [Builds/embeddedcomputing.elf] Error 1


Marlin rewrites the serial library, which is conflict to HardwareSerial. It's really odd why Arduino can compile it...
How can I deal with it?

avenue33

If Marlin rewrites HardwareSerial, edit the main makefile
Code: [Select]
EXCLUDE_LIBS = HardwareSerial
as described in section 5.2.2 Exclude Librairies.

Now, if two libraries define the same constants or variables, conflict is unavoidable.

jimaobian

I have tested it, but it didn't work either. the HardwareSerial.cpp is the core of arduino instead of the library.

avenue33

#337
Apr 26, 2013, 01:48 pm Last Edit: Apr 26, 2013, 02:20 pm by avenue33 Reason: 1
It seems MarlinSerial also raises problems here, there and even at GitHub.

As far as I understand, your project with the MarlinSerial library does compile with the Arduino IDE. Which release of the Arduino IDE are you using? Which Arduino board are you using?

As a matter of facts, Arduino does a lot of things under the hood. In normal C++, if a library declares a public variable, another library can't declare the same public variable.

Now, as I don't have the code for the MarlinSerial library, I can't be of much help.

Try new release

embedXcode • Apr 26, 2013 release 46 • Excluded libraries from core, application and user

where excluded libraries include all libraries, core, application and user.

ScottG

I created a project in Xcode and everything works fine.  I wanted to open it in the Arduino IDE and compile it, but the problem is since main.cpp is in the same directory as my .ino file, Arduino IDE opens up main.cpp as as tab.  When I try to compile I get an error because main.cpp isn't needed by the Arduino IDE.  Any suggestion as to getting around this?

ScottG

I have a library called panstamp.h that won't compile in xcode.  The problem is PRR isn't defined.  It compiles fine in the Arduino IDE.   PRR is defined in Arduino's library iom328p.h

avenue33


I created a project in Xcode and everything works fine.  I wanted to open it in the Arduino IDE and compile it, but the problem is since main.cpp is in the same directory as my .ino file, Arduino IDE opens up main.cpp as as tab.  When I try to compile I get an error because main.cpp isn't needed by the Arduino IDE.  Any suggestion as to getting around this?


Remember, with Xcode, you're working with true C++. The main.cpp is a standard for C++ but Arduino IDE hides it.

The only solution is to create another folder with the name of the sketch (eg. embed1) and copy the main sketch .ino and all the .h .cpp except main.cpp.

avenue33


I have a library called panstamp.h that won't compile in xcode.  The problem is PRR isn't defined.  It compiles fine in the Arduino IDE.   PRR is defined in Arduino's library iom328p.h


The iom328p.h file is not an Arduino library. Instead, the iom328p.h file is part of the AVR toolchain. It is located deep under the toolchain folder.

Code: [Select]
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/include/avr/iom328p.h

embedXcode is provided with the path to the tool-chain and no specific operation is carried out concerning one specific file. It is really strange as other files are used.

I need the code of the project to investigate and see what's happening.

ScottG



embedXcode is provided with the path to the tool-chain and no specific operation is carried out concerning one specific file. It is really strange as other files are used.

I need the code of the project to investigate and see what's happening.


It happens when creating a new project. Just put the panstamp library in your libraries folder and create a new project and you should get the same error.  Panstamp library is located here:
http://code.google.com/p/panstamp/downloads/detail?name=panstamp_arduino_1.0.zip&can=2&q=


ScottG


The only solution is to create another folder with the name of the sketch (eg. embed1) and copy the main sketch .ino and all the .h .cpp except main.cpp.


I noticed if in make.cpp, if I comment out:
Code: [Select]
//Sketch
#include "MyNewProject.ino"


it will compile in Arduino IDE. 

This isn't a big deal to do when I need too, but I'm wondering if I can conditionally include this line with #ifdef or #ifndef.  Do you know of a defined constant that would be defined when xcode tries to compile this line, but would not be defined if the Arduino IDE compiled it?  Then I could do something like this

Code: [Select]
#ifdef XCODE_IS_COMPILING
#include "MyNewProject.ino"
#endif

avenue33




embedXcode is provided with the path to the tool-chain and no specific operation is carried out concerning one specific file. It is really strange as other files are used.

I need the code of the project to investigate and see what's happening.


It happens when creating a new project. Just put the panstamp library in your libraries folder and create a new project and you should get the same error.  Panstamp library is located here:
http://code.google.com/p/panstamp/downloads/detail?name=panstamp_arduino_1.0.zip&can=2&q=


panStamp is a whole new platform and is not currently supported by Arduino.

I'd need a couple of these boards so I can investigate and add support to them.

Go Up