This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Question about building a new project

Hello:

I wrote a very simple short code on my project.

/*  * main.c  */ int main(void) {  

 int a=3,b=4,sum=0;

 sum=a+b;

printf("sum=%d",sum);

 return 0; }

 

I selected "Build All". But when I clicked debugging and the triangle, I could not see my result.  Instead, the CCS showed:

"Can't find a source file at "/tmp/TI_MKLIBoTdwIk/SRC/exit.c"
Locate the file or edit the source lookup path to include its location."

I cannot see the value of the sum.

What's the meaning of this?

 

thanks

  • Hi Yu,

    "Can't find a source file at "/tmp/TI_MKLIBoTdwIk/SRC/exit.c"
    Locate the file or edit the source lookup path to include its location."

    What's the meaning of this?

    It means the project execution completed ie the execution reached to "return 0"

    You can use "while(1)" instead "return 0"

    I cannot see the value of the sum.

    You have to include "stdio.h" in your project and do step by step debugging, then you would see  the output in "Console" window.

  • Hi Yu zhang39,

    The possibilities of not getting print messages are

    1. For using printf(), standard library function, stdio.h is needed.

    2. In CCS, you opened the console window?. were you able to build your code successfully? without any errors as you have not included the stdio.h?

    Yu says said:
    "Can't find a source file at "/tmp/TI_MKLIBoTdwIk/SRC/exit.c"
    Locate the file or edit the source lookup path to include its location."


    When the program execution reaches to the line, "return 0", it is searching for some exit code to be run. Since it cannot find the exit code, it throws error. This can be solved in two ways.

    1. Either include the exit code or

    2. Do not exit through "return 0" , instead be in while (1) loop without exiting.

     

    Regards,

    Shankari

    ------------------------------------------------------------------------------------------------------------------

    Please click the verify answer button if this post answer your question.

    ------------------------------------------------------------------------------------------------------------------