Which Cling Option is used to switch between archive library and DLL when creating interface method source file(Similar CINT Option is -w0)

Cint Option
-w [0/1] → Switch between archive library and DLL when creating interface method source file.
Example : cint -w0 -n…/output.cxx -D_MakeCINT_ -I…/…/folder sample.h
Above command is used to load sample.h , folder directory and MakeCINT macro and pushes interface to output.cxx

Question realted Cling;
Could help me to fiind similar option for cling to switch between archive library and DLL when creating interface method source.

Welcome to the ROOT Forum!
I’m not sure to understand you question, but maybe @Axel or @vvassilev understand better what you’re asking for…

Please don’t use CINT.

For cling none of that is needed; you can simply

#include <header>
call_function()

without the need to generate an interface library.

@Axel / @bellenot / @vvassilev
Could you please help me how to load only .hpp file and call functions without loading .cpp files.
Eaxmple program:
Demo.hpp:-
class Demo{
int sampleFun();
};
Demo.cpp:-
int Demo::sampleFun(){ return 1;}

I had got below error after loading only demo.hpp and called sampleFun() function in Cling.
ERROR:
“IncrementalExecutor::executeFunction: symbol ‘_ZN4Demo7sampleFunEV’ unresolved while linking [cling interface function]!
You are probably missing the defination of Demo::sampleFun()
Maybe you need to load the corresponding shared library?”

Could you please help me with how to load shared library in cling (calling a function by just loading .hpp file)

Sure - cling needs to know the definition of the function to be able to call it. What about #include "Demo.cpp"?

I was able to call functions of a class by loading shared Library (.so file) and header file.
.L project.so
.L demo.hpp
Demo d;
d.sampleFun();

With the help of above commands, i was able to call fucntions of a class by loading .so file and .hpp file
Issue got resolved.
Thanks @Axel @bellenot for quick help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.