Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-21-2010, 02:40 AM   #1
LQ Newbie
Registered: Jul 2010
Posts: 10

Rep: Reputation: 0
Exclamation make command for an application


i have made a small program to find the md5 checksum of a string.i am using xshell to compile the program.
#include <string.h>

#include <stdio.h>
#include <sys/types.h>
#include <md5.h>

int main(int argc, char * argv) {
	MD5_CTX context;
	char digest[33];
	const char * p = "hello";
	const char * p2 = " world\n";
	MD5Update(&context,(const void*) p, 5);
	MD5Update(&context,(const void*) p2, 7);
	printf("%s\n", digest);
    return 0;
can you please tell me what should be the make command for this program. i tried using -I switch, didnt work.

thanks in advance
Old 07-21-2010, 03:25 AM   #2
Sergei Steshenko
Senior Member
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Originally Posted by View Post
... i tried using -I switch, didnt work. ...
  1. what was the full command line ?
  2. what documentation and/or tutorials did you read ?
  3. which keywords did you use while performing WEB search (if any) ?
Old 07-21-2010, 03:36 AM   #3
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
Originally Posted by View Post
can you please tell me what should be the make command for this program. i tried using -I switch, didnt work.
What exactly have you tried? If you're determined to use make, and your file is saved as (say) program.c, then you should just be able to issue the command "make program". If this goes wrong, please cut and paste the complete output of the command.

(I must stress the cut and paste (don't try and type it out) and complete. Please don't just cut and paste the first/last section of the output - if you don't know what you're looking for, you may miss something important we can use to help you.)
Old 07-21-2010, 04:11 AM   #4
Senior Member
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,421

Rep: Reputation: 199Reputation: 199
I explained in another thread!
You need to link the library.

try this: (I called your code aa.c)
export LDLIBS=-lmd 
make aa
cc -O2 -pipe   aa.c -lmd -o aa
Old 07-21-2010, 07:27 AM   #5
LQ 5k Club
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Originally Posted by View Post
i am using xshell to compile the program.
What is "xshell"?


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
My error in mkisofs command to make a command line iso mg92865 Linux - Newbie 1 06-20-2008 11:43 AM
how to make an application as a service sharad Linux - General 2 02-26-2007 03:11 AM
I accidentally deleted make file in /usr/local/bin, now cannot use make command.... Niceman2005 Linux - Software 2 11-17-2004 07:55 PM
make application default reaky Linux - Software 5 05-23-2004 11:33 PM
make: cc: command not found make: *** [gzip.o]error 127 zyjk Linux - Newbie 5 02-08-2002 09:58 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:22 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