Last active
February 2, 2022 22:27
-
-
Save ParkerTewell/daafaeb2aa7685c2ca78073d2e6c4e3a to your computer and use it in GitHub Desktop.
falcON c++03 -> c++11 "cannot cast falcON::vect to falcON::real *" fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Original offending code: | |
vect X; | |
int N = nemoinp(getparam(p), static_cast<real*>(X), Ndim); | |
// The fix: | |
vect X; | |
vect* ptr = &X; | |
int N = nemoinp(getparam(p), ptr, Ndim); | |
// Full error message: | |
// error: cannot cast from type 'falcON::vect' (aka 'vector<Ndim, float>') to pointer type 'falcON::real *' (aka 'float *') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
haven't found a way to compile it clean yet. I get this error: (ignore line numbers, I added some comments)
src/public/lib/nemo++.cc: In instantiation of ‘int falcON::nemoinp(const char*, T*, int) [with T = WDutils::vector<3, float>]’:
src/public/lib/nemo++.cc:174:42: required from here
src/public/lib/nemo++.cc:108:23: error: incomplete type ‘{anonymous}::_inpA<WDutils::vector<3, float> >’ used in nested name specifier
108 | return _inpA::inp(e,x,n);
| ~~~~~~~~~~~~~^~~~~~~