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

Error when compiling: reference member 'f' binds to a temporary object whose lifetime would be shorter #261

Open
yywangvr opened this issue Nov 22, 2018 · 5 comments

Comments

@yywangvr
Copy link

acado-master/acado/code_generation/export_function_declaration.cpp:44:82: error:
reference member 'f' binds to a temporary object whose lifetime would be shorter
than the lifetime of the constructed object
...) : ExportStatement( ), f( ExportFunction() )
^~~~~~~~~~~~~~~~
/Users/Yuyang/Downloads/acado-master/acado/code_generation/export_function_declaration.hpp:104:25: note:
reference member declared here
const ExportFunction& f;
^
1 error generated.
make[2]: *** [acado/CMakeFiles/acado_toolkit_s.dir/code_generation/export_function_declaration.cpp.o] Error 1
make[1]: *** [acado/CMakeFiles/acado_toolkit_s.dir/all] Error 2
make: *** [all] Error 2

@yywangvr
Copy link
Author

Who can help me, thank you very much

heyyeh12 added a commit to heyyeh12/acado that referenced this issue Apr 27, 2019
@tomcattiger1230
Copy link

Do you work on OSX? @yuyang01

@dpinte
Copy link

dpinte commented May 12, 2019

@tomcattigerkkk got the same issue. The fix suggested by @heyyeh12 solves the problem.

@yywangvr
Copy link
Author

Do you work on OSX? @yuyang01

It works on my mac.

@whateverforever
Copy link

Had the same issue on macOS big sur, fix by @heyyeh12 works :)

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

4 participants