Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link error in code generated by SOUL 1.0.82 #59

Closed
wtholliday opened this issue Feb 10, 2021 · 2 comments
Closed

link error in code generated by SOUL 1.0.82 #59

wtholliday opened this issue Feb 10, 2021 · 2 comments

Comments

@wtholliday
Copy link

wtholliday commented Feb 10, 2021

I'm getting a link error when compiling with clang/osx for the DiodeClipper example.

Undefined symbols for architecture x86_64:
  "Diode::parameters", referenced from:
      Diode::createParameterList() in CAudioKit.o

When I move the definition of Diode::parameters to a cpp file, it links. Diode::parameters is a constexpr so I would have expected it to only need a definition in the class, unlike a normal static variable.

Also, the code generated by 1.0.82 says 0.9.0 at the top. I've double-checked that I'm running 1.0.82:

% ~/bin/soul | head

   _____ _____ _____ __ 
  |   __|     |  |  |  |     SOUL toolkit
  |__   |  |  |  |  |  |__   (C)2020 ROLI Ltd.
  |_____|_____|_____|_____|

  SOUL version 1.0.82
  Build date: Feb  5 2021 18:44:37
  LLVM version: 9.0.1

% ~/bin/soul generate --cpp DiodeClipper.soul | head
Building: /Users/holliday/AudioKit/Sources/CAudioKit/Nodes/Effects/Distortion/DiodeClipper.soul
Building: /Users/holliday/AudioKit/Sources/CAudioKit/Nodes/Effects/Distortion/DiodeClipper.soul
//      _____ _____ _____ __
//     |   __|     |  |  |  |        Auto-generated C++
//     |__   |  |  |  |  |  |__      SOUL Version 0.9.0
//     |_____|_____|_____|_____|     https://soul.dev
//

#include <array>
#include <functional>
#include <cmath>
#include <cstddef>
@cesaref
Copy link
Contributor

cesaref commented Feb 10, 2021

Thanks for the report, we're investigating.

@julianstorer
Copy link
Contributor

This turns out to be because our code uses inline constexpr statics, which is a C++17 feature. if you recompile with your compiler set to C++17 or later then it should work fine.

I'm going to add a check to the generated code so that it fails for < C++17 to avoid any confusion, and we'll also sort out the version number, thanks for flagging that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants