LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 07-21-2010, 03:40 AM   #1
aa.bb.cc
LQ Newbie
 
Registered: Jul 2010
Posts: 10

Rep: Reputation: 0
Exclamation make command for an application


hello

i have made a small program to find the md5 checksum of a string.i am using xshell to compile the program.
Code:
#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";
	MD5Init(&context);
	MD5Update(&context,(const void*) p, 5);
	MD5Update(&context,(const void*) p2, 7);
	MD5End(&context,digest);
	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, 04:25 AM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by aa.bb.cc 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, 04:36 AM   #3
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 138Reputation: 138
Quote:
Originally Posted by aa.bb.cc 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, 05:11 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,314

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

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

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
Quote:
Originally Posted by aa.bb.cc View Post
i am using xshell to compile the program.
What is "xshell"?
 
  


Reply


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 12:43 PM
how to make an application as a service sharad Linux - General 2 02-26-2007 04:11 AM
I accidentally deleted make file in /usr/local/bin, now cannot use make command.... Niceman2005 Linux - Software 2 11-17-2004 08:55 PM
make application default reaky Linux - Software 5 05-24-2004 12:33 AM
make: cc: command not found make: *** [gzip.o]error 127 zyjk Linux - Newbie 5 02-08-2002 10:58 AM


All times are GMT -5. The time now is 05:58 AM.

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