Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将静态库(potracelib)与另一个库链接,在Makefile.am中编写什么?_C_Makefile_Autotools_Automake - Fatal编程技术网

将静态库(potracelib)与另一个库链接,在Makefile.am中编写什么?

将静态库(potracelib)与另一个库链接,在Makefile.am中编写什么?,c,makefile,autotools,automake,C,Makefile,Autotools,Automake,我需要链接libpotrace并将其编译成libgerbv。我应该在Makefile.am中写什么?我尝试了各种方法,如LDADD、LIBDIR、LDFLAGS等,但没有成功 我的结构如何: gerbv/gerbv测试->来自git、master brach的文件 gerbv/libs/potrace/potrace test->potrace->sourceforge.com上的文件,最新版本 我使用Debian Jessie,我可以分别编译这两个程序,这两个程序我都不知道,我如何将pot

我需要链接libpotrace并将其编译成libgerbv。我应该在Makefile.am中写什么?我尝试了各种方法,如LDADD、LIBDIR、LDFLAGS等,但没有成功

我的结构如何:

  • gerbv/gerbv测试->来自git、master brach的文件
  • gerbv/libs/potrace/potrace test->potrace->sourceforge.com上的文件,最新版本
我使用Debian Jessie,我可以分别编译这两个程序,这两个程序我都不知道,我如何将potrace链接到gerbv并编译它。头文件(.h)已正确包含,但我没有成功链接.so或.a/la lib。即使在/usr/local/lib或/usr/lib中安装了potrace也没有成功

有人能告诉我吗?最好的方法是下载这两个程序,编译无误,然后将输入的内容写入gerbv/src/makefile.Am。


已更新
我加载了干净的版本,只做了此修改:

  • /root/NBP/gerbv/gerbv test/src/Makefile.am
    • 增加


      • /root/NBP/gerbv/gerbv test/src/exportimage.c
        • 添加在顶部

          #include "../../libs/potrace/potrace-test/src/potracelib.h"
          
          添加到void exportimage_render_到_surface_和_destroy(…),这将测试共享库是否正确链接。c是libgerbv的一部分,我需要在其中包含libpotrace

          char *v = potrace_version();
          

          完成此修改后,我通过以下方式构建它:

          • libpotrace
            • root:~/NBP/gerbv/libs/potrace/potrace-test# autoreconf && ./configure --with-libpotrace && make
              
              运行没有问题。。。

              • gerbv/libgerbv
                • root:~/NBP/gerbv/gerbv-test# autoreconf && ./configure && make
                  
                  这导致:

                  ...
                  make[3]: Entering directory '/root/NBP/gerbv/gerbv-test/src'
                  make[3]: *** No rule to make target 'libpotrace.la', needed by 'libgerbv.la'.  Stop.
                  make[3]: Leaving directory '/root/NBP/gerbv/gerbv-test/src'
                  Makefile:498: recipe for target 'all' failed
                  make[2]: *** [all] Error 2
                  make[2]: Leaving directory '/root/NBP/gerbv/gerbv-test/src'
                  Makefile:472: recipe for target 'all-recursive' failed
                  make[1]: *** [all-recursive] Error 1
                  make[1]: Leaving directory '/root/NBP/gerbv/gerbv-test'
                  Makefile:401: recipe for target 'all' failed
                  make: *** [all] Error 2
                  

                  使用此Makefile.am添加解决:

                  libgerbv_la_LIBADD = ../../libs/potrace/potrace/src/libpotrace.la
                  libgerbv_la_DEPENDENCIES  = ../../libs/potrace/potrace/src/libpotrace.la
                  

                  使用此Makefile.am添加解决:

                  libgerbv_la_LIBADD = ../../libs/potrace/potrace/src/libpotrace.la
                  libgerbv_la_DEPENDENCIES  = ../../libs/potrace/potrace/src/libpotrace.la
                  

                  嗨,你能在这里发布
                  makefile.am
                  吗?使用
                  -L
                  包含链接库的路径和
                  -L
                  。Makefile.am来自/root/NBP/gerbv/gerbv test/src/Makefile.am,如上编辑(第84-86行)autoreconf&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&。只需将其解压缩到/root/NBP/。任何方向如何链接它都会对我有很大帮助。这是关于C还是C++?请选择一个,不要随意发送标签。嗨,你能在这里发布
                  makefile.am
                  吗?使用
                  -L
                  包含链接库的路径和
                  -L
                  。Makefile.am来自/root/NBP/gerbv/gerbv test/src/Makefile.am,如上编辑(第84-86行)autoreconf&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&。只需将其解压缩到/root/NBP/。任何方向如何链接它都会对我有很大帮助。这是关于C还是C++?请选择一个,不要随意发送标签。