Skip to content

Instantly share code, notes, and snippets.

@ParkerTewell
Last active February 2, 2022 22:27
Show Gist options
  • Save ParkerTewell/daafaeb2aa7685c2ca78073d2e6c4e3a to your computer and use it in GitHub Desktop.
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
// 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 *')
@teuben
Copy link

teuben commented Feb 2, 2022

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);
| ~~~~~~~~~~~~~^~~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment