user28260: I'm trying to get a rather large sketch working with a teensy LC.  I'd like to break it into headers and C files, but the multi-file sketch fails to compile.  When I put everything into a single, monolithic sketch, it runs fine.  I've #included the h files where they are needed, using single quotes, and have confirmed that my h files are in the same folder as my sketch.  Is there an additional step to go through specific to teensy?  I've managed to do this tons of times using a standard arduino.
Here is a basic sketch:
This is the main sketch file:
   #include "tst.h"
void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
  doNothing();
}

This is tst.h
void doNothing();

This is tst.c
#include "tst.h"
void doNothing()
{
  int i = 0;
}

I get the  error "undefined reference to doNothing() in function loop"

user13432: 
I get the error "undefined reference to doNothing() in function loop"

The C++ compiler cannot find doNothing(). This is mainly due to the incomplete header file and mix of C and C++. 
Two things are needed to avoid this type of problem; 1) protect the file from multiple includes (in the same compile), 2) make the function visible to the C++ compiler as a C function (without name mangling).   
tst.h:
#ifndef TST_H
#define TST_H

#ifdef __cplusplus
extern "C"{
#endif

void doNothing();

#ifdef __cplusplus
} // extern "C"
#endif
#endif

Cheers!

28260: <p>I'm trying to get a rather large sketch working with a teensy LC.  I'd like to break it into headers and C files, but the multi-file sketch fails to compile.  When I put everything into a single, monolithic sketch, it runs fine.  I've #included the h files where they are needed, using single quotes, and have confirmed that my h files are in the same folder as my sketch.  Is there an additional step to go through specific to teensy?  I've managed to do this tons of times using a standard arduino.</p>

<p>Here is a basic sketch:</p>

<p>This is the main sketch file:</p>

<pre><code>   #include "tst.h"
void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
  doNothing();
}
</code></pre>

<p>This is tst.h</p>

<pre><code>void doNothing();
</code></pre>

<p>This is tst.c</p>

<pre><code>#include "tst.h"
void doNothing()
{
  int i = 0;
}
</code></pre>

<p>I get the  error "undefined reference to doNothing() in function loop"</p>
 13432: <blockquote>
  <p>I get the error "undefined reference to doNothing() in function loop"</p>
</blockquote>

<p>The C++ compiler cannot find doNothing(). This is mainly due to the incomplete header file and mix of C and C++. </p>

<p>Two things are needed to avoid this type of problem; 1) protect the file from multiple includes (in the same compile), 2) make the function visible to the C++ compiler as a C function (without name mangling).   </p>

<p>tst.h:</p>

<pre><code>#ifndef TST_H
#define TST_H

#ifdef __cplusplus
extern "C"{
#endif

void doNothing();

#ifdef __cplusplus
} // extern "C"
#endif
#endif
</code></pre>

<p>Cheers!</p>
