LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Making executabe files (https://www.linuxquestions.org/questions/linux-newbie-8/making-executabe-files-333700/)

mili 06-15-2005 12:16 AM

Making executabe files
 
Hai friends

i have developed an application in c language. Now I want to make an executable file for that.
I don't know how to do....so please help me

hardcorelinux 06-15-2005 12:40 AM

http://www.linuxquestions.org/questi...2001/10/2/7011

mili 06-15-2005 01:22 AM

i don't want to make .exe file. i want to execute my program
using its name.. like vi..
my program name is 'lncur' . i want to run my program using command
lncur. is there any way to do this

lowpingnoob 06-15-2005 01:24 AM

Quote:

Originally posted by mili
i don't want to make .exe file. i want to execute my program
using its name.. like vi..
my program name is 'lncur' . i want to run my program using command
lncur. is there any way to do this


hardcorelinux 06-15-2005 01:35 AM

chmod 755 lncur

./lncur

mili 06-15-2005 01:51 AM

i want to use only' lncur' as a command.is there any way

zackarya 06-15-2005 02:12 AM

Assuming your using gcc and it's a single file the command would be

gcc -Wall -o whatyouwanttonamethefile thenthesourcefile.c

-Wall gives you very verbose compiling. You should always use it.
-o tells the compiler the name you want to call your file

So for example with Incur as the name I want to execute and Incur.c as the
name of the file to compile I would do

gcc -Wall -o Incur Incur.c

Hope that helps.

Zack

mili 06-15-2005 02:40 AM

in this case also i have to give ./lncur
i want to use only 'lncur' to run

michaelk 06-15-2005 06:34 AM

linux only searches for a command using the path environment. Since the directory where lncur is located is not in your path then with out the ./ you will see a command not found error. BTW ./ is a shortcut for current working directory.

To see your current path environment use the following command:
echo $PATH

You can add a directory to your users path environment via your /.bash_profile file like:
PATH=$PATH:/data/myprogram

To add the path for all users add the directory to the /etc/profile file.

Of course you can always move the executable to a directory that is already in the path.

pokemaster 06-15-2005 06:59 AM

Hmm -- tough question... it depends how it was developed. You might have to do a
Code:

qmake
make

or perhaps
Code:

gcc main.c
maybe just
Code:

make
Did you write the app for qt? gnome? using an application editor? or is it a text-based proggy from emacs? do you have makefiles? and the list goes on, unfortunately. Let us know how you wrote the program, and what files are involved, then we can give you something to go on...

pokemaster 06-15-2005 07:04 AM

sorry, i got a bit ahead of myself there -- i thought you were looking for compiling info.

All you have to do is go into one of the bin directories (me, i prefer /usr/local/bin), be root, and type
[code]
ln -s *path to your program* /usr/local/bin/lncur
[code]

This should do what you want...

mili 06-16-2005 01:32 AM

thank you sir ..it works....


All times are GMT -5. The time now is 02:15 AM.