Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. file size and #include

file size and #include

Scheduled Pinned Locked Moved Mobile
questionc++toolshelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rodent
    wrote on last edited by
    #1

    noob question (tools: eVC++ w/ppc2k2 sdk)... if header files are #include'd but the functions from their corresponding libraries never called, does the final compiled file include the unused functions thereby increasing file size? fyi, the issue i'm trying to better understand is whether i #include windows.h or a subset. tia..

    J 1 Reply Last reply
    0
    • R rodent

      noob question (tools: eVC++ w/ppc2k2 sdk)... if header files are #include'd but the functions from their corresponding libraries never called, does the final compiled file include the unused functions thereby increasing file size? fyi, the issue i'm trying to better understand is whether i #include windows.h or a subset. tia..

      J Offline
      J Offline
      Joao Paulo Figueira
      wrote on last edited by
      #2

      Most of the functions declared in these #includes are implemented in DLLs. System DLLs are in ROM, so this is irrelevant for the final size of your application. Regards, João Paulo

      R 1 Reply Last reply
      0
      • J Joao Paulo Figueira

        Most of the functions declared in these #includes are implemented in DLLs. System DLLs are in ROM, so this is irrelevant for the final size of your application. Regards, João Paulo

        R Offline
        R Offline
        rodent
        wrote on last edited by
        #3

        thanks and it makes sense for functions implemented in DLLs. two followup ?'s: 1) what about the case where the unused functions are implemented in static libraries? are these unused fcn's compiled in even if they're not called? 2) is there a straightforward way when looking at the wince header files to determine if the api is implemented in a DLL or a static library? thanks!

        J 1 Reply Last reply
        0
        • R rodent

          thanks and it makes sense for functions implemented in DLLs. two followup ?'s: 1) what about the case where the unused functions are implemented in static libraries? are these unused fcn's compiled in even if they're not called? 2) is there a straightforward way when looking at the wince header files to determine if the api is implemented in a DLL or a static library? thanks!

          J Offline
          J Offline
          Joao Paulo Figueira
          wrote on last edited by
          #4

          rodent¹ wrote: 1) what about the case where the unused functions are implemented in static libraries? are these unused fcn's compiled in even if they're not called? Depends on your linker, but the general answer is yes. rodent¹ wrote: 2) is there a straightforward way when looking at the wince header files to determine if the api is implemented in a DLL or a static library? Unfortunately, no. Regards, João Paulo

          M 1 Reply Last reply
          0
          • J Joao Paulo Figueira

            rodent¹ wrote: 1) what about the case where the unused functions are implemented in static libraries? are these unused fcn's compiled in even if they're not called? Depends on your linker, but the general answer is yes. rodent¹ wrote: 2) is there a straightforward way when looking at the wince header files to determine if the api is implemented in a DLL or a static library? Unfortunately, no. Regards, João Paulo

            M Offline
            M Offline
            Mike Dimmick
            wrote on last edited by
            #5

            For #1: The linker supplied with eVC will remove unused packages (called COMDATs in the documentation) if the /OPT:REF switch is turned on. This is turned on by default, unless the /DEBUG switch is enabled, in which case it's turned off. To force the linker to remove unreferenced functions, the compiler must be instructed to package each function in its own COMDAT. You do this by specifying the /Gy option to the compiler (called 'Enable function-level linking' in the 'Customize' category of the Project Settings dialog). If this option is not enabled, the linker can only include or exclude individual object files. A static library basically consists of multiple object files with a header describing what's in it. From memory, Microsoft's static libraries are compiled with this option enabled.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups