hi guys…how can i compile and run a program in C
gorginos wrote:
> hi guys…how can i compile and run a program in C
as usual, begin here: http://tinyurl.com/ybgtu4w
–
palladium
Well this is kind of a general questions as to the exact instructions depend of the source code you have or if you writting something on your own. First off, go to YaST>Software>Software Management and select the patterns tab. Make sure you have “Base Development” checked and “C/C++ Development” checked. If not, check them and allow them to install.
To install a source file, you go to the folder where the program is located in terminal mode and most often you will execute the commands ./configure, make and then make install however, different source files have different requirements not to mention Dependant Programs that may need to be loaded.
In general, it is better to install applications that have already been compiled for openSUSE and installed through the Software Manager.
Thank You,
I took a look at your posts, do you get back for an answer as well ? I see three posts, all with just a single question, no feedback with results or whatever.
@gorginos: I have to apologize. Was too fast in my judgement, mixing you with some other poster.
Then again: train yourself to give as much info as you can. Which openSUSE, desktop. 32/64bit etc, what do you want to achieve, how far did you get?
@gorginos:
If you want a good answer, you need to post a good question. It is not good
to post something like “What is the answer to all questions?” and omit every
further information on what you tried yourself before to find out the
answer.
A little bit of information on which problem you really want to solve is
also not wasted time.
Do you want to compile a program you’ve got from elsewhere (a tar ball for
example)?
Do you want to compile a piece of code you found somewhere?
Do you plan to start to write your own C programs?
Did you write a C program and do not know how to convert it into something
you or someone else can use?
and so on and so on
Nobody can guess that.
so guys sorry if i have been so general in my posts but i have no free time with my work…so i use open suse 11.2 desktop 32bits…i want to compile and run my own programs and those i can find in the internet from the konsole…i remember in ubuntu i use gcc to compile and a.out to run my programs but i dont know in suse if its the same :\
gorginos wrote:
>
> so guys sorry if i have been so general in my posts but i have no free
> time with my work…so i use open suse 11.2 desktop 32bits…i
> want to compile and run my own programs and those i can find in the
> internet from the konsole…i remember in ubuntu i use gcc to compile
> and a.out to run my programs but i dont know in suse if its the same :
>
>
gcc is the same in opensuse, it is more or less (means that there are also
other c compilers for linux) THE c compiler for linux.
So simply follow jdmcdaniel3 post and install the corresponding development
pattern or do
zypper in gcc
as root if you only want to have the compiler and nothing else.
If you want to compile code from the internet you should install more than
only gcc (you will sometimes need also gcc-c++ for example) and sometimes
cmake, automake, autoconf etc. .
so the best that i can is to install the Base Development Packages pattern from YaST manager and find a lot of other packages that likely i need?
gorginos wrote:
>
> so the best that i can is to install the Base Development Packages
> pattern from YaST manager and find a lot of other packages that likely i
> need?
>
>
The base development pattern will most likely include everything you need. I
just wanted to point out that not every software from the internet for linux
is written in c but also in other languages and sometimes not with the
standard
configure
make
make install
triplet but for example with build systems like cmake or something else.
i see…ok thanks all for your help rotfl!
i have comple a simple program that i wrote with gcc in the console…now what i can do to run it ??
gorginos wrote:
> i have comple a simple program that i wrote with gcc in the
> console…now what i can do to run it ??
did you ‘make install’ it as root?
just go to the command line and execute the command you specified as
the executable…
–
palladium
did you ‘make install’ it as root?
just go to the command line and execute the command you specified as
the executable…
can you help me a bit with this:
cause i’m new to suse
gorginos wrote:
> can you help me a bit with this:\ cause i’m new to suse
are you also new to writing computer programs?
you say you wrote a program in C and compiled it…are you working
from a how to, tutorial, or what? do your instructions end once the
program you wrote is compiled?
i don’t believe it, turn the page!
i can’t help you any more than i already did: http://tinyurl.com/ybgtu4w
–
palladium
gorginos wrote:
>
>> did you ‘make install’ it as root?
>>
>> just go to the command line and execute the command you specified as
>> the executable…
>
> can you help me a bit with this:
> cause i’m new to suse
>
>
http://www.network-theory.co.uk/docs/gccintro/gccintro_9.html
there is absolutely nothing suse specific. It is exactly the same on all
linux platforms I worked with (at least five different ones).
mkdir -p ~/test
cd ~/test
echo 'int main(int argc, char **argv) { printf("Hello"); }' > test.c
gcc test.c
./a.out
You will get a warning but you can correct the source (It is left as an exercise to you).
are you also new to writing computer programs?
you say you wrote a program in C and compiled it…are you working
from a how to, tutorial, or what? do your instructions end once the
program you wrote is compiled?i don’t believe it, turn the page!
i can’t help you any more than i already did: Let me google that for you
thank you so must for your help i really appriciate it