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. General Programming
  3. C / C++ / MFC
  4. Compiling a single dll from several .lib

Compiling a single dll from several .lib

Scheduled Pinned Locked Moved C / C++ / MFC
6 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.
  • T Offline
    T Offline
    Themis
    wrote on last edited by
    #1

    Hi, I am trying to compile a single dll from several static library projects in VS2005. However as it seems the compiler does not link the .lib libraries to the dll unless they are referenced in the dynamic library project. Is there any way (linker flag?) that I can aggregate several .libs in a dll file without having to reference their classes/functions/vars? Thanks, Themis

    C 1 Reply Last reply
    0
    • T Themis

      Hi, I am trying to compile a single dll from several static library projects in VS2005. However as it seems the compiler does not link the .lib libraries to the dll unless they are referenced in the dynamic library project. Is there any way (linker flag?) that I can aggregate several .libs in a dll file without having to reference their classes/functions/vars? Thanks, Themis

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      Themis wrote:

      Is there any way (linker flag?) that I can aggregate several .libs in a dll file without having to reference their classes/functions/vars?

      if you're not referencing them, why do you want them included in your DLL ??

      image processing toolkits | batch image processing | blogging

      T 1 Reply Last reply
      0
      • C Chris Losinger

        Themis wrote:

        Is there any way (linker flag?) that I can aggregate several .libs in a dll file without having to reference their classes/functions/vars?

        if you're not referencing them, why do you want them included in your DLL ??

        image processing toolkits | batch image processing | blogging

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        to aggregate them in a single "super-DLL" ?


        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

        T 1 Reply Last reply
        0
        • T toxcct

          to aggregate them in a single "super-DLL" ?


          [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

          T Offline
          T Offline
          Themis
          wrote on last edited by
          #4

          Yes I want to create a super-DLL that others (apps or dll) can link and refer to its included objects. However I don't want to merge the several .lib projects into one .dll project to generate my dynamic library as my .libs do not match conceptually, hence I prefer to have them separate in the Solution Explorer. Think of a large base dll with several support projects, like networking, serialization, utilities etc. all merged in a single project_base.dll. Cheers, Themis

          C 1 Reply Last reply
          0
          • T Themis

            Yes I want to create a super-DLL that others (apps or dll) can link and refer to its included objects. However I don't want to merge the several .lib projects into one .dll project to generate my dynamic library as my .libs do not match conceptually, hence I prefer to have them separate in the Solution Explorer. Think of a large base dll with several support projects, like networking, serialization, utilities etc. all merged in a single project_base.dll. Cheers, Themis

            C Offline
            C Offline
            Chris Losinger
            wrote on last edited by
            #5

            add your .LIBs to the Additional Dependencies field in the Linker/Input propoerty page. then you will need to explicitly export all of the functions and variables from the various .LIBs, from the DLL.

            image processing toolkits | batch image processing | blogging

            T 1 Reply Last reply
            0
            • C Chris Losinger

              add your .LIBs to the Additional Dependencies field in the Linker/Input propoerty page. then you will need to explicitly export all of the functions and variables from the various .LIBs, from the DLL.

              image processing toolkits | batch image processing | blogging

              T Offline
              T Offline
              Themis
              wrote on last edited by
              #6

              I have already added the dependencies in the dll properties. However I am not sure what you mean when you say "you will need to explicitly export all of the functions and variables from the various .LIBs, from the DLL". I export symbols (classes/functions) using dllexport in each project. Do you mean that I have to do anything more in the dll project? The fact is that without referencing a class from the dll project it will not be linked by the linker to the target dll. I am wondering if I can bypass this linker "optimization" and make the linker unconditionally add a class' code in the dll. Cheers, Themis

              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