没有在Linux下的C++中安装的共享对象和包含

HFL*_*FLW 1 c++ linux

我正在编写一个程序,它有两个我需要使用的库:v8和v8-juice.不幸的是,v8-juice无法编译为静态库,因为它与模板有关.还有一些其他的怪癖需要将v8编译为共享对象.

因此,当我编译我的程序时,我最终得到了两个可执行文件运行所需的共享对象.我的问题是,有没有一种方法可以包含这些共享对象而无需在linux下安装它们?对不起,如果这是一个新问题,我对C++很新.

Max*_*kin 5

共享库可以与可执行文件位于同一文件夹中.男子ld.so:

   $ORIGIN and rpath

   ld.so  understands the string $ORIGIN (or equivalently ${ORIGIN}) in an
   rpath specification (DT_RPATH or DT_RUNPATH) to mean the directory con-
   taining  the  application  executable.  Thus, an application located in
   somedir/app could be compiled with gcc  -Wl,-rpath,'$ORIGIN/../lib'  so
   that  it  finds  an  associated shared library in somedir/lib no matter
   where somedir is located in the directory hierarchy.  This  facilitates
   the  creation  of  "turn-key"  applications  that  do  not  need  to be
   installed into special directories, but can instead  be  unpacked  into
   any directory and still find their own shared libraries.
Run Code Online (Sandbox Code Playgroud)