1 Reply Latest reply on Jun 12, 2017 10:01 PM by anks

    Adding existing header and source

    shuji_mikami_2509641

      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?

        • 1. Re: Adding existing header and source
          anks

          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.