joaoleal / CppADCodeGen

Source Code Generation for Automatic Differentiation using Operator Overloading
Other
162 stars 36 forks source link

Conversion error in getCustomLibraryExtension() #52

Closed EmbersArc closed 4 years ago

EmbersArc commented 4 years ago

Getting error: cannot convert ‘const std::unique_ptr<const std::__cxx11::basic_string<char> >’ to ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’} in return while compiling.

https://github.com/joaoleal/CppADCodeGen/blob/640fffb8c74236062fe5f9b98164f54b5f4ca14e/include/cppad/cg/model/dynamic_lib/dynamic_library_processor.hpp#L84

Explicit casting seems to fix this.

Compiler: GCC 9.2.1 and Clang 9.0.1 CppAD: 20200000.2 CppADCodegen: 2.4.2

bradbell commented 4 years ago

I have seen this error using g++, but it went away when I changed to just using clang. Which compiler is generating your error message ?

EmbersArc commented 4 years ago

It's in both gcc and clang with C++17.

EmbersArc commented 4 years ago

Calling _customLibExtension.get() might be the easiest fix.

joaoleal commented 4 years ago

I'll add the .get() so that it will compile with your gcc/clang.

acxz commented 4 years ago

Thx for the fix! When can we expect this change to be released in master or a new release? (It is build breaking for me rn)

joaoleal commented 4 years ago

New release 2.4.3 with the fix.

acxz commented 4 years ago

Sweet! Can we go ahead and close this issue?