Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-2391

Use of global static intializers in code creates problems for a correct Windows static build

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Auto Closed
    • None
    • None
    • C++ Client
    • Windows XP SP3
      Visual C++ 9.0

    Description

      The use of global static intilaizers like the StaticInit struct in:

      qpid\cpp\src\qpid\client\windows\TCPConnector.cpp
      qpid\cpp\src\qpid\client\windows\SslConnector.cpp

      won't work at runtime in a static compile/link of qpidc. The transport factory registrations won't happen since the linker will strip out these unreferenced symbols. Not a problem in the DLL model. There are few options for addressing this in the linker command line (e.g., /INCLUDE:<mangled name of symbol>), in the devenv ("Link Library Dependencies", "Use Library Dependency Inputs"), or writing function wrappers to force load - none of which seem very useful.

      There may be more instances of this pattern in the code elsewhere.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pmackinn Pete MacKinnon
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: