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.

The size of the final .out file is too big

Other Parts Discussed in Thread: TEST2

I am trying to port some part of the OpenCV 2.4.2 to the C64+ DSP with CCS 5.2. When I test some of the OpenCV functions in the main function, I find that the size of the final executable file .out produced by the compiler is almost 20MB. It is too big. It seems that all the functions of OpenCV have been linked into the .out file other than only the functions called by the main function. My question is how to reduce the size of .out file. My test method is as below.

1.  test.cpp

void test1()

{}

void test2()

{}

2. main.cpp

int main()

{

   test1();

   return 0;

}

  • HI,

    Did you make sure that you are not building with "Debug" configuration?

    Other way is to check the map file generated after build and you can come to know about what all functions are linked.

    Regards

    Radhesh

  • HI Radhesh,

    Thanks for your reply. I indeed built the project with the "Debug" configuration as I want to debug the project using breakpoint. My question is if it is possible to just link the functions called by the main function under the "Debug" mode?

    Regards

    Bo

  • HI Bo,

    I think it is possible. Can you try enabling "--gen_func_subsections" in the project build properties? This makes sure that only the functions that are referenced in the application are linked into the final executable.

    Regards

    Radhesh

  • Hi Radhesh,

    I am in China. Now I am taking  eight days ' holiday for National Day. I will do some test according to you advice when I come back to work. Thanks again.

    Regards

    Bo

  • Hi Radhesh,

    I tried the build option "--gen_func_subsections". The size of the final executable is reduced largely. It works. Thanks!

    Regards

    Bo