Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-25-2011, 02:03 PM   #1
LQ Newbie
Registered: Jan 2011
Posts: 2

Rep: Reputation: 0
undefined reference to `SHA256_Update'

I get this error :

debug/ undefined reference to `SHA256_Update'
debug/ undefined reference to `SHA256_Final'
debug/ undefined reference to `SHA256_Init'
collect2: ld returned 1 exit status

please could some one help me

which packed i must install on fedora 10

Old 01-26-2011, 11:43 AM   #2
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
You don't give nearly enough information in your post. For future reference, you should say what you're trying to do, the commands you're using, etc.

I am assuming that you are compiling something, and you are getting those errors.

I am assuming that you are using gcc to compile the program--meaning that the program is written in C.

I am assuming that SHA256_Update(), SHA256_Final(), and SHA256_Init() are all part of the same library: libmd (as indicated on this online man page)

If those assumptions are incorrect, you need to say which ones are wrong. Otherwise, your problem is likely with your compile command. The errors you posted indicate that gcc cannot link to the function definitions. When you use an external library, you must specifically tell gcc to link with it using the "-l" option. The typical way to do that is to remove the "lib" from the library name and use what is left with the -l. For example, for libmd:
gcc -o my_program -lmd my_source.c

Last edited by Dark_Helmet; 01-26-2011 at 11:45 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
undefined reference to.... crapodino Programming 1 01-13-2008 07:05 PM
Undefined reference to: ashlesha Programming 5 11-08-2006 01:07 PM
undefined reference? Sharky01252 Programming 3 11-07-2006 11:36 AM
Undefined Reference ChemicalBurn Programming 2 02-14-2005 03:01 AM
undefined reference mp4-10 Programming 3 01-25-2005 12:38 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:48 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration