Solved

how to run program usuing makefile

Posted on 2003-11-28
8
1,180 Views
Last Modified: 2012-05-04

hi i  have a question on makefile. i have  downloaded a  source code.... lots of  .cc and  .hh files are there and also a makefile is also there. i have heard that usuing makefile i can run the program. how can i do that .... plz give some steps.( i am working  in redhat  linux 7.02) and g++ compiler.

so...

(1) how can i run my program? is that makefile help me to run???... some  scripts are there(in makefile), i cannot understand. if it is runnable plz  tell me what i have to do mechanically ?

(2)i have some .cc files in source code. i  have no idea about .cc extension..... is it the c programs for other operating sytems except windows?????

(3) i want to learn something about makefile also. where can i find some tutorial ( easy and understandable)????

thanks...
0
Comment
Question by:sanko50
  • 4
  • 2
  • 2
8 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9836540
Hi sanko50,

1. try typing make at your command prompt .. if that does not work, try make all

2. file.cc
file.cxx
file.cpp
file.C
all refer to C++ source code which must be preprocessed. Note that in `.cxx', the last two letters must both be literally `x'. Likewise, `.C' refers to a literal capital C.
http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2

3.http://www.gnu.org/manual/make-3.79.1/html_chapter/make_toc.html

Cheers!
Sunny:o)
0
 

Author Comment

by:sanko50
ID: 9836829

ok trying......
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 9837210
Actually, C++ files usually are no longer preprocessed, they just get compiled with a different compiler. C++ used to be preprocessed and converted to C by software like cfront, but these days, all C++ compilers are "real" compilers. The make tool "knows" how to convert the different types of source files to object files. For C files, it will for example use the gcc program, and for C++ files the g++ program. You can actually change which compiler is used in the make file by specifying the CC or CXX variable for C and C++ respectively.
0
 

Author Comment

by:sanko50
ID: 9837445

i did that , after writing make  , i got many object files in my directory.... i think it has been succesful..is not it???? but it is not running..... from the readme file i found

Usage: encode [image][width][height][output][ratio]

so i wrote        encode [ lena512.pgm] [512] [512] [output] [ 4:1]


but i got reply   bash:::encode not found ... but encode is in my directory( in a different color...is this color for executables!!!!!!).

LET ME TELL U...... I AM TRYING TO COMPRESS   IMAGE USUING WAVELET TRANSFORMATION.
THAT IS WHY ENCODE IS THERE.

I AM GIVING YOU THE LINK FROM WHERE  I DOWNLOADED..... IS THAT SOURCE CODE WRONG?????(AT LEAST NOT RUNNABLE)

BASICALLY I DONOT KNOW HOW TO RUN USUING MAKEFILE. THIS IS MY FIRST TIME.... I AM DOING JUST FROM  UR COMMENTS.  i read the readme file then i usued
 encode [ lena512.pgm] [512] [512] [output] [ 4:1]
still it is not running..... i think somewhere i have done some mistake  syntactically. i think source code is correct...

i am giving the link
http://www.geoffdavis.net/dartmouth/wavelet/wavelet.html

then downloaded  wavelet.0.3.tar.gz .....then untarred etc etc. then i did  like above steps.

am i wrong  syntactically???? plz have a look on readme file(if possible).
waiting for answer.
NOTE: images are in the image directory. i copied only lena512.pgm  to my directory where all the executables and other headers are there.

thanks

 
 
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 45

Accepted Solution

by:
sunnycoder earned 30 total points
ID: 9837515
>encode [ lena512.pgm] [512] [512] [output] [ 4:1]

[] represent optional paramters ... you need to specify them without the []

encode lena512.pgm 512  512 output  4:1

also, >bash:::encode not found
indicates that your current dir is not in your path ... so use

./encode lena512.pgm 512  512 output  4:1
0
 

Author Comment

by:sanko50
ID: 9837820


(1) ohh...many many  thanks ..  it is working . i am getting output.... but why there is no file naming output in my directory so that i can view the  compressed output  in a imageviewer software
jasc paint shop pro8.

thanks

(2) why r u saying...

" also, >bash:::encode not found
 indicates that your current dir is not in your path ... so use "

why r u saying  so . let me give u more information also.... i am working through telnet ...as soon as i connected .. i typed pwd.

 it is showing  /home/myname

then i changed to the wave dirrectory where all the supporting files and images and exe (including encode) are there. SITTING ON THAT DIRECTORY  i am giving command  " encode"

then why it  says command not found.( of course i tried  encode lena512.pgm 512  512 output  4:1  also but got  >bash:::encode not found  ) . i did not use   " ./ " that was a mistake. can u say why???

thanks for the above successes also but not getting output file in my directory!!!!!!!!!!!!!!!!!!!!!!. i am getting  some output on the screen also.... but in the readme file it says   "  output: name of compressed image  "


0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 9838188
You search path does not contain the current directory. You can verify this by running
echo $PATH
If you want to include this directory in your path, open the file .bashrc in an editor and add the
following line
export PATH=$PATH:.

When you log in the next time, you should be able to run binaries in the current directory.

You should have a file named "output" in our wave directory. If it's not there, maybe the program did automatically attach an extension, so do a
ls -l output.*
to see if it has an extension.

If you log in via telnet, are you doing this from a X11 enabled machine? If so, you should be able to run an image viewer on the remote machine and display the image on your local machine. I don't know which software is available on your remote machine, but try both "xv" and "display". You may also have access to "gimp".

0
 

Author Comment

by:sanko50
ID: 9838587

it is not x11 enabled.... and i am not getting output by   ls -l output.*
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now