Linking Problem

Johannes Ruscheinski ruschein at gmail.com
Tue Sep 20 09:12:27 PDT 2011


Hi Ryan,

On 20 September 2011 09:05, Ryan Schmidt <ryandesign at macports.org> wrote:
>
> On Sep 20, 2011, at 11:01, Johannes Ruscheinski wrote:
>
>> I am trying to build a C++ program that uses the MD5() and SHA1()
>> functions.  I think they're being included via the
>>
>> #include <openssl/md5.h>
>> #include <openssl/sha.h>
>>
>> include directives.   I did add the -lssl linker flag but still get
>> linker errors complaining about a missing _MD5 and _SHA1.   Any ideas
>> which library I need to add to my linker command line.   Also, I am
>> using a g++ from MacPorts and not the XCode one.
>
> How about adding -lcrypto?

That worked, thanks!

>
> This isn't really a MacPorts question.

I wasn't sure if there wasn't a library in MacPorts that would resolve
my problem.  I am already linking against a bunch of libraries that I
only got via MacPorts because I am porting a fair-sized library with
many dependencies.

Thanks again!

>
>
>



-- 
Johannes

Obligatory current favourite quotes:

"We are all atheists about most of the gods that societies have ever
believed in. Some of us just go one god further."
--Richard Dawkins

"Religion is regarded by the common people as true, by the wise as
false, and by the rulers as useful".
 -- Seneca
"I have more confidence in the methods of science, based on the amazing
record of science and its ability over the centuries to answer
unanswerable questions, than I do in the methods of faith (what are they?)."
 -- David J. Gross "Physics Nobel Laureate"

"Atheism is a religion to the same extent that not collecting stamps is a
 hobby."
 -- seen on Slashdot.org

http://xkcd.com/808/


More information about the macports-users mailing list