Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Linker Issue with including 2 Faust objects

  1. #1
    Junior Member
    Join Date
    Oct 2019
    Posts
    16

    Linker Issue with including 2 Faust objects

    Hello folks,
    I have started experimenting with Faust DSP objects for the Teensy Audio Library and came across some weird linker error. I already started an Github issue on the Faust Github website (https://github.com/grame-cncm/faust/issues/434) and the guy from Faust suggested that I might ask here on the Teensy forum.

    Here is a minimal example to recreate the problem, which i also posted on the Github issue.


    I have an .ino file called oscillators

    HTML Code:
    #include <Audio.h>
    #include "triangle.h"
    #include "sawtooth.h" 
    
    void setup() {
    }
    
    void loop() {
    }
    then I have a .dsp file called triangle.dsp

    HTML Code:
    import("stdfaust.lib");
    process = 200: os.triangle;
    and one called sawtooth.dsp

    HTML Code:
    import("stdfaust.lib");
    process = 200: os.sawtooth;
    The Faust Audio Library Objects are created via the faust2teensy -lib command
    And this is the compiler error in the Arduino IDE:

    HTML Code:
    /tmp/arduino_build_413038/sketch/triangle.cpp: In constructor 'triangle::triangle()':
    triangle.cpp:5003: warning: operation on '((triangle*)this)->triangle::fDSP' may be undefined 
     triangle::triangle() : AudioStream((fDSP = new mydsp())->getNumInputs(), new audio_block_t*[fDSP->getNumInputs()])
                                                                                                                      ^
    /tmp/arduino_build_413038/sketch/sawtooth.cpp: In constructor 'sawtooth::sawtooth()':
    sawtooth.cpp:4950: warning: operation on '((sawtooth*)this)->sawtooth::fDSP' may be undefined 
     sawtooth::sawtooth() : AudioStream((fDSP = new mydsp())->getNumInputs(), new audio_block_t*[fDSP->getNumInputs()])
                                                                                                                      ^
    /tmp/arduino_build_413038/sketch/triangle.cpp.o:(.bss.__exidx_end+0x0): multiple definition of `__exidx_end'
    /tmp/arduino_build_413038/sketch/sawtooth.cpp.o:(.bss.__exidx_end+0x0): first defined here
    /usr/share/arduino/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Disabling relaxation: it will not work with multiple definitions
    /tmp/arduino_build_413038/sketch/triangle.cpp.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider::_Alloc_hider(char*, std::allocator<char> const&)':
    Multiple libraries were found for "SD.h"/tmp/arduino_build_413038/sketch/triangle.cpp:280: multiple definition of `__exidx_start'
    /tmp/arduino_build_413038/sketch/sawtooth.cpp.o:/tmp/arduino_build_413038/sketch/sawtooth.cpp:285: first defined here
    collect2: error: ld returned 1 exit status
    
     Used: /usr/share/arduino/hardware/teensy/avr/libraries/SD
     Not used: /usr/share/arduino/libraries/SD
    Error compiling for board Teensy 4.0.
    And as before, I have attached all the files (including the .h and .cpp files created by Faust) in a .zip folder.

    Maybe someone who knows the Teensy linker can help me out with this problem.

    Thanks in advance,
    Flo
    Attached Files Attached Files
    Last edited by flo; 05-04-2020 at 01:26 PM.

  2. #2
    Junior Member
    Join Date
    Dec 2019
    Posts
    1
    I have the same issue as well, when using more than 1 Faust object, did you solve it?

  3. #3
    Junior Member
    Join Date
    Oct 2019
    Posts
    16
    No, not yet. Maybe there's a fix from the faust developers, but I think not.
    I have been given up on faust for Teensy because of the big data overhead.

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,882
    Both the two .cpp files you included in your zip file have:
    Code:
    unsigned __exidx_start;
    unsigned __exidx_end;
    So when you link it will find both of these. As a quick fix you might try removing one or both of these blocks and see if it builds for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •