<?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: Can I use my own .h .cpp files?</title>
		<link>http://forums.leaflabs.com/topic.php?id=1013</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:21:52 +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=1013" rel="self" type="application/rss+xml" />

		<item>
			<title>mbolivar on "Can I use my own .h .cpp files?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1013#post-6171</link>
			<pubDate>Thu, 01 Sep 2011 08:51:19 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">6171@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;see this thread for information on multiple source files:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=1008&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=1008&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;previous post by edisoner deleted for spam signature.&#60;/p&#62;
&#60;p&#62;since this was edisoner's first post, i've deleted the account as well.  if you were a real person, come back, but don't post spam.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "Can I use my own .h .cpp files?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1013#post-6159</link>
			<pubDate>Wed, 31 Aug 2011 15:14:51 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">6159@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;It's possible to change makefile to allow compilation. When writing libraries, I also have to include a rules.mk file in the same directory as the library.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>frpr on "Can I use my own .h .cpp files?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1013#post-6158</link>
			<pubDate>Wed, 31 Aug 2011 14:33:13 +0000</pubDate>
			<dc:creator>frpr</dc:creator>
			<guid isPermaLink="false">6158@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello,&#60;br /&#62;
I would like to split one big file &#34;main.cpp&#34; into more files. But I get compile-time error:&#60;br /&#62;
undefined reference to ...&#60;/p&#62;
&#60;p&#62;Situation before:&#60;br /&#62;
I have PC, Ubuntu and the unix-toolchain. I use Geany as the text editor.&#60;br /&#62;
It works well thanks your cookery-book (&#60;a href=&#34;http://leaflabs.com/docs/unix-toolchain.html)&#34; rel=&#34;nofollow&#34;&#62;http://leaflabs.com/docs/unix-toolchain.html)&#60;/a&#62;.&#60;br /&#62;
Normally I make changes in &#34;main.cpp&#34; (modified blinky project) then &#34;make flash&#34;  and then &#34;make install&#34;.&#60;br /&#62;
Everything works.&#60;/p&#62;
&#60;p&#62;Situation now:&#60;br /&#62;
I make two new files: &#34;my.h&#34; and &#34;my.cpp&#34; and write some C code. Inside &#34;main.cpp&#34; I call a function declared in &#34;my.h&#34; and defined in &#34;my.cpp&#34;.&#60;br /&#62;
The files are saved at some location as &#34;main.cpp&#34; and as &#34;Makefile&#34; (~/_arm32/).&#60;br /&#62;
But I get compile-time errors:&#60;br /&#62;
main.cpp:22: undefined reference to `my_hex'&#60;br /&#62;
main.cpp:26: undefined reference to `my_buff'&#60;br /&#62;
It seems that the compiler doesn't see my two new files. Do I need modify &#34;Makefile&#34; or is there another problem ? &#60;/p&#62;
&#60;p&#62;file &#34;my.h&#34; looks like&#60;br /&#62;
/*&#60;br /&#62;
file:      my.h&#60;br /&#62;
*/&#60;br /&#62;
#ifndef _MY_H&#60;br /&#62;
#define _MY_H&#60;/p&#62;
&#60;p&#62;#ifdef __cplusplus&#60;br /&#62;
extern &#34;C&#34; {&#60;br /&#62;
#endif&#60;/p&#62;
&#60;p&#62;#include &#34;libmaple_types.h&#34;&#60;/p&#62;
&#60;p&#62;/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */&#60;/p&#62;
&#60;p&#62;extern void my_hex(void *dest, uint32 nr); // some my func&#60;/p&#62;
&#60;p&#62;extern unsigned char my_buff[20];          // some my variable  &#60;/p&#62;
&#60;p&#62;/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */&#60;br /&#62;
#ifdef __cplusplus&#60;br /&#62;
}&#60;br /&#62;
#endif&#60;/p&#62;
&#60;p&#62;#endif //_MY_H
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
