<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Porting Arduino Library - Compile Errors</title>
		<link>http://forums.leaflabs.com/topic.php?id=908</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:07:33 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=908" rel="self" type="application/rss+xml" />

		<item>
			<title>mikep on "Porting Arduino Library - Compile Errors"</title>
			<link>http://forums.leaflabs.com/topic.php?id=908#post-5651</link>
			<pubDate>Wed, 13 Jul 2011 10:55:27 +0000</pubDate>
			<dc:creator>mikep</dc:creator>
			<guid isPermaLink="false">5651@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Alright, I will get something posted. In the meantime I have the Ethernet library  (for ENC28J60) and a simple webserver working on another STM32 board, using the STM Library SPI and GPIO config commands and pure C. Now I still want to port this to the Maple, I think my biggest issue is really not understanding the C/C++ mix, because the existing library consists of a bunch of .c and .h files and I guess that is where it falls down. But I'll let you know when I have it uploaded.&#60;br /&#62;
Mike
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "Porting Arduino Library - Compile Errors"</title>
			<link>http://forums.leaflabs.com/topic.php?id=908#post-5631</link>
			<pubDate>Tue, 12 Jul 2011 16:25:42 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">5631@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;can you link to your port in its current state, Ill see If I can get it to build
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mikep on "Porting Arduino Library - Compile Errors"</title>
			<link>http://forums.leaflabs.com/topic.php?id=908#post-5609</link>
			<pubDate>Sat, 09 Jul 2011 17:37:46 +0000</pubDate>
			<dc:creator>mikep</dc:creator>
			<guid isPermaLink="false">5609@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thank you for your answer postlathian,&#60;br /&#62;
I am using the regular Maple IDE (0.0.11), which is probably not the best idea when porting a library from Arduino :)&#60;br /&#62;
I already had the .h file wrapped in the directive&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;br /&#38;gt;
#ifdef __cplusplus&#38;lt;br /&#38;gt;
extern &#38;quot;C&#38;quot; {&#38;lt;br /&#38;gt;
#endif&#38;lt;br /&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;And I also looked at the EEPROM library here: &#60;a href=&#34;https://github.com/adamfeuer/libmaple/tree/eeprom_25xxx/libraries/EEPROM25xxx&#34; rel=&#34;nofollow&#34;&#62;https://github.com/adamfeuer/libmaple/tree/eeprom_25xxx/libraries/EEPROM25xxx&#60;/a&#62; which also has a C API and is including wirish.h.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "Porting Arduino Library - Compile Errors"</title>
			<link>http://forums.leaflabs.com/topic.php?id=908#post-5606</link>
			<pubDate>Sat, 09 Jul 2011 15:41:46 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">5606@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Ill let iperry or mbolivar correct me here but I think the answer is likely that in your case you cant. In general, you can mix and match c/c++ files if:&#60;/p&#62;
&#60;p&#62;A) all your c code declarations are wrapped in an appropriate&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;#ifdef __cplusplus
extern &#38;quot;C&#38;quot; {
#endif&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;blocks (see any random .h file in libmaple)&#60;/p&#62;
&#60;p&#62;B) you are using the correct c++ compiler (arm-none-eabi-g++ not arm-none-eabi-gcc). You can see in a regular libmaple command line build how the compiler is treating C and C++ files with different compilers. &#60;/p&#62;
&#60;p&#62;If you provide a bit more information about your build environment, and link to sources, we can probably track down where its going wrong. You might have success just by changing the C files that include wirish to .cpp files.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mikep on "Porting Arduino Library - Compile Errors"</title>
			<link>http://forums.leaflabs.com/topic.php?id=908#post-5603</link>
			<pubDate>Sat, 09 Jul 2011 13:51:02 +0000</pubDate>
			<dc:creator>mikep</dc:creator>
			<guid isPermaLink="false">5603@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi All,&#60;br /&#62;
I am trying to port the Arduino Ethernet library (for ENC28J60) to the Maple. The Arduino library is located here: &#60;a href=&#34;http://blog.thiseldo.co.uk/?p=570&#34; rel=&#34;nofollow&#34;&#62;http://blog.thiseldo.co.uk/?p=570&#60;/a&#62;&#60;br /&#62;
I did all the type conversions (unit8_t -&#38;gt; uint8 etc.) and took out the avr-specific includes, but now I am at a point where I get some cryptic (to me at least) compile errors as soon as I try to include &#34;wirish.h&#34;&#60;br /&#62;
The errors are like this:&#60;br /&#62;
&#60;code&#62;&#60;br /&#62;
from C:\Users\Michael\Documents\MapleIDE\libraries\EtherShield28J60_062011\enc28j60.c:21:&#60;/p&#62;
&#60;p&#62;C:\Program Files (x86)\Leaflabs_Maple\maple-ide-0.0.11\hardware\leaflabs\cores\maple/boards.h:118: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'boardUsesPin'&#60;/p&#62;
&#60;p&#62;                 from C:\Users\Michael\Documents\MapleIDE\libraries\EtherShield28J60_062011\enc28j60.c:21:&#60;/p&#62;
&#60;p&#62;C:\Program Files (x86)\Leaflabs_Maple\maple-ide-0.0.11\hardware\leaflabs\cores\maple/io.h:201: error: expected ';', ',' or ')' before '=' token&#60;/p&#62;
&#60;p&#62;                 from C:\Users\Michael\Documents\MapleIDE\libraries\EtherShield28J60_062011\enc28j60.c:21:&#60;/p&#62;
&#60;p&#62;C:\Program Files (x86)\Leaflabs_Maple\maple-ide-0.0.11\hardware\leaflabs\cores\maple/wirish_math.h:56: error: conflicting types for 'random'&#60;/p&#62;
&#60;p&#62;C:\Program Files (x86)\Leaflabs_Maple\maple-ide-0.0.11\hardware\leaflabs\cores\maple/wirish_math.h:47: note: previous declaration of 'random' was here&#60;/p&#62;
&#60;p&#62;                 from C:\Users\Michael\Documents\MapleIDE\libraries\EtherShield28J60_062011\enc28j60.c:21:&#60;/p&#62;
&#60;p&#62;C:\Program Files (x86)\Leaflabs_Maple\maple-ide-0.0.11\hardware\leaflabs\cores\maple/HardwareSPI.h:71: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'HardwareSPI'&#60;br /&#62;
&#60;/code&#62;&#60;br /&#62;
This goes on for a while, basically most of the files include'd in wrish.h generate a similar error.&#60;br /&#62;
Line 21 in enc28j60.c is this:&#60;br /&#62;
&#60;code&#62;&#60;br /&#62;
#include &#34;wirish.h&#34;&#60;br /&#62;
&#60;/code&#62;&#60;br /&#62;
What am I doing wrong?&#60;br /&#62;
These low-level files I am working on are C files that are used by the Ethernet.cpp file.&#60;br /&#62;
Can wirish not be included in a C file? Is there any better way to troubleshoot this and get to the bottom of this error?&#60;br /&#62;
Thank you,&#60;br /&#62;
Mike
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
