// A basic C++ cell
// define a beakerx_main function with an optional parameter for the return value
#include <iostream>
void beakerx_main(){
std::cout << "Hello world 1!" << std::endl;
return;
}
// A basic C++ cell
// define a beakerx_main function with an optional parameter for the return value
#include <iostream>
void beakerx_main(){
std::cout << "Hello world 2!" << std::endl;
return;
}
null Hello world 2!
// You can define functions
#include <string>
std::string distant;
void setDistant(){
distant = std::string("This is far away");
}
null
// right now we don't support this functionality (https://github.com/twosigma/beakerx/issues/5228)
// and call functions defined in other C++ cells
#include <string>
#include <iostream>
extern std::string distant;
extern void setDistant();
void beakerx_main(std::string &ret){
setDistant();
ret = distant;
}
/tmp/beakerx_2ad09f22-01d6-4feb-8bf1-0a10627a1b68775373743641203437/liba922dbe1-89a5-48ba-afcf-73e16126c398.so: undefined symbol: _Z7distantB5cxx11