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

The correct usage of cling::Interpreter #509

Open
zhengxuwen-nc opened this issue Aug 29, 2023 · 0 comments
Open

The correct usage of cling::Interpreter #509

zhengxuwen-nc opened this issue Aug 29, 2023 · 0 comments

Comments

@zhengxuwen-nc
Copy link

My work consists of four CPP files, with two of them involving mutual function calls. In dep.cpp, the onStart function calls the show function in the dog.cpp file. When using cling::Interpreter to declare these CPP files successively (declare dep.cpp first and then declare dog.cpp), how can the issue of the show() function’s logic not being executed when the onStart function is executed be resolved?

For example:
dep.cpp content:

#include "dog.h"
void Dep::onStart(){
Dog dog;
std::cout << "1b\n";
dog.show();
std::cout << "2c\n";
}

dog.cpp content:

void Dog::show(){
std::cout << "dog show\n";
}

The result of executing this code is:

1b
2c

PS: I am unable to completely decouple the mutual calling relationship between the two CPP files.

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

1 participant