Forum
    • Categories
    • Register
    • Login

    Duplicate symbol errors (createDspObject/getModuleList/destroyDspObject) compiling DspNetwork as Dynamic Library on macOS

    Scheduled Pinned Locked Moved Scripting
    1 Posts 1 Posters 4 Views
    Loading More Posts
    • 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.
    • P
      phanniboi
      last edited by

      Environment: macOS, HISE develop branch (up to date with origin/develop), Xcode, compiling a DSP Network as Dynamic Library via batchCompileOSX.sh.

      Error:
      duplicate symbol '_createDspObject' in:
      duplicate symbol '_getModuleList' in:
      duplicate symbol '_destroyDspObject' in:
      ld: 20 duplicate symbols

      Diagnosis:
      Using nm on the compiled .o files, I confirmed these symbols are defined in THREE separate object files instead of one:

      • Main.o
      • include_hi_tools_01.o
      • include_hi_tools_03.o

      The function bodies live in HiseLibraryHeader.h, guarded by:
      #if HI_EXPORT_DSP_LIBRARY
      ...
      #endif

      HI_EXPORT_DSP_LIBRARY is set to 1 in AppConfig.h (autogenerated from the .jucer's ), which is correct/intentional for exporting the DLL.

      The problem: hi_tools_01.cpp and hi_tools_03.cpp both #include "../hi_dsp_library/hi_dsp_library.h" (confirmed via grep), which pulls in HiseLibraryHeader.h and re-generates the factory functions in those translation units as well — in addition to Main.cpp, which is the intended single exporter.

      This seems like it shouldn't happen — hi_tools shouldn't normally depend on hi_dsp_library at all (dependency direction is usually reversed). Is this expected, or is this a bug in how the hi_tools amalgamation includes hi_dsp_library.h? Toggling IS_STATIC_DSP_LIBRARY in Projucer did not change the outcome.

      Happy to share the exact grep/nm commands and full build log if helpful.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      34

      Online

      2.4k

      Users

      13.9k

      Topics

      120.7k

      Posts