本文介绍了autoconf和共享库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我希望我发布到正确的新闻组。我尝试将此提交到 au******@gnu.org 邮件列表,但我看不到任何活动。如果这是错误的 新闻组,我会推荐一个不同来源的引用。 我的问题是: 我的一个源文件使用该库: #include< openssl / md5.h> 这迫使我当我链接 对象以生成可执行文件时,将/usr/lib/libcrypto.so添加到gcc命令。我的gcc命令看起来像 如下: gcc --pedantic -Wall -std = c99 -O2 -g -O2 / usr / lib / libcrypto .so -o main Main.o my_md5.o 我今天正在学习autoconf并且想知道如何断言用户 编译确实有libcrypto.so共享对象。 例如./configure会检查以确保libcrypto.so可用...至少 它的功能 - 例如定义了MD5_Init函数。 这可能吗? 第二个问题: 随着程序的复杂性增加并需要许多这些共享对象,什么是 确保便携性的最佳方法?如果他们没有libcrypto.so,我是否包含libcrypto.c的代码以供用户编译?b $ b?或者我是否向用户提供了 ,其中包含来自编译器的不友好错误消息。 此外,我的libcrypto.so对象的位置可能与其他人不同。我怎么处理这个问题? 谢谢, 马特I hope I am posting this to the right newsgroup. I tried submitting this to the au******@gnu.org mailing list, but I see no activity. If this is the wrongnewsgroup, I would appriciate a reference to a different source.My question was:One of my source files uses the library:#include <openssl/md5.h>This forces me to add /usr/lib/libcrypto.so to the gcc command when I link theobject to produce an executable for instance. My gcc command looks somethinglike below:gcc --pedantic -Wall -std=c99 -O2 -g -O2 /usr/lib/libcrypto.so -o main Main.omy_md5.oI was studying autoconf today and was wondering how I can assert that the usercompiling does in fact have the libcrypto.so shared object.e.g. ./configure would check to make sure libcrypto.so is available... at leastit''s functionality--the function MD5_Init is defined for example.Is this possible?Second Question:As programs grow in complexity and require many of these shared objects, what isthe best way to assure portability? Do I include the code for libcrypto.c forthe user to compile if they don''t have libcrypto.so? Or do I provide the userwith an unfriendly error message from the compiler.Also, the location of my libcrypto.so object may differ from other peoples. Howdo I deal with that?Thanks,Matt推荐答案 希望这会有所帮助。 - AxelHope this helps.--Axel 这确实是错误的新闻组,但似乎你最初发布了这是正确的,没有回复,这对我来说是一个很好的借口。 This is indeed the wrong newsgroup, but it seems you originally posted this in the correct one with no reply, which is a good enough excuse for me. 如果是这样,为什么你不呢?将您的回复发布在正确的 论坛中,主题是什么? Robert GambleIf this is the case, why wouldn''t you post your response in the correctforum where it would be on topic?Robert Gamble 这确实是错误的新闻组,但似乎你最初发布的是正确的,没有回复,对我来说这是一个很好的借口。 This is indeed the wrong newsgroup, but it seems you originally posted this in the correct one with no reply, which is a good enough excuse for me. 如果是这样的话,为什么你不在正确的论坛里发表你的回复呢?会有什么话题? Robert Gamble If this is the case, why wouldn''t you post your response in the correct forum where it would be on topic? Robert Gamble 出于好奇,C程序员的正确新闻组在哪里?讨论(多平台)工具和库?Out of curiosity where is the correct newsgroup for C programmers todiscuss (multi-platform) tools and libraries? 这篇关于autoconf和共享库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!