In the previous KISS-C software we could split our code into 2 different .c files (e.x. include "samplecode.c") to store our functions and keep it separate from the main. In the new KISS IDE 4.0.5 Platform we cant do that. Is there any possible way to do that in the current KISS IDE?
v-v-v-MAIN & ERROR-v-v-v
// Created on Thu May 2 2013
#include "TestLib.c"
int main()
{
printf("Hello, World!\n");
return 0;
}
TestMain.c.o: In function `__set_no_stdout_buffer':
TestMain.c:(.text+0x0): multiple definition of `__set_no_stdout_buffer'
/tmp/700101003546.kovan-serial/:/Users/User 1TestLib.c.o:TestLib.c:(.text+0x0): first defined here
TestMain.c.o: In function `printMessage':
TestMain.c:(.text+0x34): multiple definition of `printMessage'
/tmp/700101003546.kovan-serial/:/Users/User 1TestLib.c.o:TestLib.c:(.text+0x34): first defined here
collect2: ld returned 1 exit status
v-v-v FUNCTION LIBRARY v-v-v
// Created on Thu May 2 2013
void printMessage()
{
printf("Ross's Function\n");
}
Files which are included using
#include
should have a .h extension, not .c. Note that in C programming, it is usually best practice to have function code in .c files, with function prototypes in .h files, and use a linker rather than #include to merge the code together. This makes the compilation process much more efficient. I'm not sure if KISS-IDE supports linking yet... Braden, can you comment on this? In any event, it's acceptable for Botball purposes to just have library code in .h files, even though professional C programmers don't like it.tldr: rename your .c library to a .h file.
There are also reportedly path issues with library files on the Link... you may need to specify the full path to the flash drive; I'm not sure if KIPR fixed this yet.
-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS
this is what our team discovered after talking to someone from Kipr.
If you are compiling with with a usb or wifi target. Not sure about using a flash drive
Hope this helps
Brad A.
Team 13-0624
Fairfield, IL