adding own c files [SOLVED]

Firmware/software/electronics/mechanics
Post Reply
Che.
Member
Posts: 62
Joined: Tue Jul 28, 2015 1:47 pm
Location: Germany

adding own c files [SOLVED]

Post by Che. »

hi,

i want to add my own c files to the project.
after coding the function in a new c file in drivers>src i added a .h file.

when running "make CLOAD" i get the error "undefined reference to `myFunction'.

what am i doing wrong?

thanks for all answers.

Greets, Che.
Last edited by Che. on Fri Oct 23, 2015 2:44 pm, edited 1 time in total.
vivekrk44
Beginner
Posts: 7
Joined: Sun Nov 23, 2014 6:17 pm

Re: adding own c files

Post by vivekrk44 »

In the folders there is the MakeFile which needs to be updated. If you tell me your file names ill show you what to update and where
Che.
Member
Posts: 62
Joined: Tue Jul 28, 2015 1:47 pm
Location: Germany

Re: adding own c files

Post by Che. »

vivekrk44 wrote:In the folders there is the MakeFile which needs to be updated. If you tell me your file names ill show you what to update and where
hi vivekrk44,

lets name the file "example.c" with an "example.h".
the code in the makefile looks very confusing to me, tutorials i found on google seem very extensive.
i would be happy if you had a short "steps to do"-instruction. i know i am asking for a big favor, thank you in advance!
Che.
Member
Posts: 62
Joined: Tue Jul 28, 2015 1:47 pm
Location: Germany

Re: adding own c files

Post by Che. »

i worked it out already.

1.) simply go to the "makefile" in the project explorer in eclipse in crazyflie-firmware folder (double click)
2.) browse to #########Source files configuration############
3.) just add your modulename in the appropriate line in the same pattern as the other modules are implemented.

for example:

... example.o

;)

hope that helps anyone.

greets,
Che
Post Reply