Adding existing header and source

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I have a trouble in adding existing header file and source file.

   

The directory structure is like following,

   

workspace folder/

   

        project folder(.cydsn)/

   

                 main.c

   

                 UserCode/

   

                        header.h

   

                        source.c

   

I added include path "./UserCode", so, I could call constants declared in header.h from main.c.

   

But, when I call the function declared in header.h and defined in source.c from main.c, 

   

PSoC Creator outputs error "undefined reference to the function".

   

When I create new header and source in PSoC Creator Workspace Explorer, and copy the contents from existing files, PSoC Creator outputs no error.

   

How to fix this error?

0 Likes
1 Solution
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Can you please mention how are you adding your .h and .c files .Are you doing so by right clicking the Source files and Header files and then choosing the Add existing item option

   

PSoC Creator outputs error "undefined reference to the function" when the project doesn't includes files(either.c or .h) properly.

View solution in original post

0 Likes
1 Reply
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Can you please mention how are you adding your .h and .c files .Are you doing so by right clicking the Source files and Header files and then choosing the Add existing item option

   

PSoC Creator outputs error "undefined reference to the function" when the project doesn't includes files(either.c or .h) properly.

0 Likes