H
Haro Panosyan
Suppose I have defined a templete function prototype in a header
file and the body in .cpp file and created executable without actually
calling the templete function.
Now let say from that executable I am loading a shared object and
executing(dlsym-ing) some f() function, which inside calls the templete
function.
(Of course the header file with templete prototype is included in
shared object source file, so it could be compiled.)
If I run the executable then I am getting an error:
"referenced symbol not found"
which is exactly what I am expecting, because there was no actual
call of the templete function in the executable, hence no such
function code was generated by a compiler.
My question is it possible to make this work?
To me it is not possible, but who knows, may be there are some compile
options specificly designed for this case, something like to tell
dynamic linker to create a function code during runtime.
Sounds to hard to be true , or I am lost.
Thanks,
-haro
file and the body in .cpp file and created executable without actually
calling the templete function.
Now let say from that executable I am loading a shared object and
executing(dlsym-ing) some f() function, which inside calls the templete
function.
(Of course the header file with templete prototype is included in
shared object source file, so it could be compiled.)
If I run the executable then I am getting an error:
"referenced symbol not found"
which is exactly what I am expecting, because there was no actual
call of the templete function in the executable, hence no such
function code was generated by a compiler.
My question is it possible to make this work?
To me it is not possible, but who knows, may be there are some compile
options specificly designed for this case, something like to tell
dynamic linker to create a function code during runtime.
Sounds to hard to be true , or I am lost.
Thanks,
-haro