Code removal??

Comments

9 comments

  • Avatar
    Michael Johnson

    There's a keep symbols linker project property.

    Regards

    Michael

    0
    Comment actions Permalink
  • Avatar
    Michael Freeman

    Is there a way to not have project involved? The older versions worked without messing with project settings, what changed? I like to use this code in other projects and there are 40 functions in 4 different files. Also it would be a pain to have to fix each one.

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    The "Enable Unused Symbol Removal" property is set by default. You could try setting this to "No". How are you getting the addresses of the functions at run-time if you aren't referencing them?

    0
    Comment actions Permalink
  • Avatar
    Michael Freeman

    Okay got it fixed. It seems I was missing the include file with the prototypes for the functions. However I was tricked by tool into thinking it worked before. I was using code, still missing prototypes, that was part of the project somewhere else. Then I changed the functions that were only used in this spot and that when it broke. 

    The missing piece: extern boolean fnSerial0_Open(SCommSettings *psrSettings);

    boolean (*g_pfnSerialOpen)(SCommSettings *psrSettings);
    g_pfnSerialOpen = fnSerial0_Open;

    0
    Comment actions Permalink
  • Avatar
    Michael Freeman

    Boy, include files can make life just hard sometimes. I went back to figure out why I got no warning or error before. One of the include files had an include to the file that had the prototypes.

    Sorry for the false alarm and thanks for the help
    Michael Freeman

    0
    Comment actions Permalink
  • Avatar
    Pjmonty

    I'm trying to find the "Enable Unused Symbol Removal" property.  Exactly where is it located?  I want the linker to remove unused functions and would like to verify that it is doing so.

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    View the properties window, click on the project node in the project explorer. In the properties window type "Enable U" in the search box.

    0
    Comment actions Permalink
  • Avatar
    Pjmonty
    Thanks for the help Michael. I got hung up on your first reply where you mentioned a linker option, so I kept looking there. Turns out it's a build option. My mistake for not looking more thoroughly. I often find it hard to locate options I'm looking for since the project explorer window, the properties window, and the project manager window have overlapping information presented in similar yet subtly different ways. Couple that with the solution properties, project properties, debug, release, and common options, and it can get difficult to find what you're looking for.
    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    I enable the properties display in the project explorer and use the search feature of the properties window.

    0
    Comment actions Permalink

Please sign in to leave a comment.