Ask a Question related to Ubuntu, Design and Development.
-
Tom Clydesdale #1
Compiler Startup
I haven't done any programming for a considerable time and would like to
pick it up again. I've loaded what I think are the GCC and GPC compilers
with no apparent problems. However, I can't find the darned things!!
Can someone give me a clue as to how they can be initiated - I would have
anticipated their appearance in a "Path" file at least. Also appreciated
would be the location of the documentation files which I also think were
installed.
TIA
Tom
Tom Clydesdale Guest
-
CHM Compiler
Has anyone come across a DW extension that'll compile to CHM files? - Maybe using H tags for topics or ...? Thanks, Corona -
Re[4]: [PHP-DEV] PHP compiler
Hello Antony, Wednesday, August 6, 2003, 8:43:13 PM, you wrote: AD> If archive is all what you want to get, then what prevents you to write... -
Re[6]: [PHP-DEV] PHP compiler
Hello Wez, Wednesday, August 6, 2003, 9:30:17 PM, you wrote: WF> This isn't really an internals matter, and isn't going to happen in the core... -
Re[2]: [PHP-DEV] PHP compiler
The only problem with that approach is that you have to distribute the php executable and your program is loaded using a command line similar to: ... -
Compiler Error Message: The compiler failed with error code 128.
Hi. I am having trouble running my aspx code. I created two simple webforms, which i try to run from two different directories one is giving me... -
Alexander Koch #2
Re: Compiler Startup
Hello Tom,
usually the GCC and GPC executable files will be installed under /usr/bin
This directory is in the PATH so you can just execute these files from
the command line by typing "gcc" or "gpc". If this doesn't work, have a
look at you path variable with the command
echo $PATH
or look in the /usr/bin directory with
ls /usr/bin/g?c
UNIX Documentation files comes in the form of man(nual) and/or info pages.
The command
man gcc
respectively
info gcc
should do the trick. Or where you talking about system documentation for
programming?
I hope that helps.
Alex
Tom Clydesdale schrieb:> I haven't done any programming for a considerable time and would like to
> pick it up again. I've loaded what I think are the GCC and GPC compilers
> with no apparent problems. However, I can't find the darned things!!
>
> Can someone give me a clue as to how they can be initiated - I would have
> anticipated their appearance in a "Path" file at least. Also appreciated
> would be the location of the documentation files which I also think were
> installed.
>
> TIA
> TomAlexander Koch Guest
-
Eric Meyers #3
Re: Compiler Startup
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 2006-04-07, Tom Clydesdale <t.clydes@comcast.net> wrote:Use which, as in ...> I haven't done any programming for a considerable time and would like to
> pick it up again. I've loaded what I think are the GCC and GPC compilers
> with no apparent problems. However, I can't find the darned things!!
>
> Can someone give me a clue as to how they can be initiated - I would have
> anticipated their appearance in a "Path" file at least. Also appreciated
> would be the location of the documentation files which I also think were
> installed.
>
> TIA
> Tom
which gcc
or even better
slocate gcc
Eric
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFENxc6cLztWWU+V+oRAuWHAKCjCrjXhqmaZkr2Nw1RnH uTUEWyzgCcDRJL
EJLDsjqKtt2Cynd9/MkXm9o=
=kjvZ
-----END PGP SIGNATURE-----
Eric Meyers Guest
-
Tom Clydesdale #4
Re: Compiler Startup
On Fri, 07 Apr 2006 20:51:53 -0500, Eric Meyers wrote:
Thank you gentlemen you gave me the mental clue for proceeding - my> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 2006-04-07, Tom Clydesdale <t.clydes@comcast.net> wrote:>>> I haven't done any programming for a considerable time and would like to
>> pick it up again. I've loaded what I think are the GCC and GPC compilers
>> with no apparent problems. However, I can't find the darned things!!
>>
>> Can someone give me a clue as to how they can be initiated - I would have
>> anticipated their appearance in a "Path" file at least. Also appreciated
>> would be the location of the documentation files which I also think were
>> installed.
>>
>> TIA
>> Tom
> Use which, as in ...
>
> which gcc
>
> or even better
> slocate gcc
>
> Eric
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQFENxc6cLztWWU+V+oRAuWHAKCjCrjXhqmaZkr2Nw1RnH uTUEWyzgCcDRJL
> EJLDsjqKtt2Cynd9/MkXm9o=
> =kjvZ
> -----END PGP SIGNATURE-----
problem turned out to be semantics (?) in that both programs require the
version number as part of the program name (ie. gcc-4.0). Without version
number they remain unknown.
With all my attempts to install gcc I wound up with 3 versions loaded
(272, 3.4 & 4.0) and I wonder which might be most desirable since ubuntu
seems to consider all as "current".
Again many thanks,
Tom
Tom Clydesdale Guest
-
Shea Martin #5
Re: Compiler Startup
Tom Clydesdale wrote:
IMHO, unless you have a reason not to, use 4.0, or whatever the latest> On Fri, 07 Apr 2006 20:51:53 -0500, Eric Meyers wrote:
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 2006-04-07, Tom Clydesdale <t.clydes@comcast.net> wrote:>> Use which, as in ...>>> I haven't done any programming for a considerable time and would like to
>>> pick it up again. I've loaded what I think are the GCC and GPC compilers
>>> with no apparent problems. However, I can't find the darned things!!
>>>
>>> Can someone give me a clue as to how they can be initiated - I would have
>>> anticipated their appearance in a "Path" file at least. Also appreciated
>>> would be the location of the documentation files which I also think were
>>> installed.
>>>
>>> TIA
>>> Tom
>>
>> which gcc
>>
>> or even better
>> slocate gcc
>>
>> Eric
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.1 (GNU/Linux)
>>
>> iD8DBQFENxc6cLztWWU+V+oRAuWHAKCjCrjXhqmaZkr2Nw1RnH uTUEWyzgCcDRJL
>> EJLDsjqKtt2Cynd9/MkXm9o=
>> =kjvZ
>> -----END PGP SIGNATURE-----
> Thank you gentlemen you gave me the mental clue for proceeding - my
> problem turned out to be semantics (?) in that both programs require the
> version number as part of the program name (ie. gcc-4.0). Without version
> number they remain unknown.
>
> With all my attempts to install gcc I wound up with 3 versions loaded
> (272, 3.4 & 4.0) and I wonder which might be most desirable since ubuntu
> seems to consider all as "current".
>
> Again many thanks,
> Tom
>
is. Using a makefile or IDE which handles the makefile for you will
save you the grunt work of manually calling g++ mycodefile.cpp for all
your files.
~S
Shea Martin Guest
-
Tom Clydesdale #6
Re: Compiler Startup
>>> On 2006-04-07, Tom Clydesdale <t.clydes@comcast.net> wrote:
>>>> I haven't done any programming for a considerable time and would like to
>>>> pick it up again. I've loaded what I think are the GCC and GPC compilers
>>>> with no apparent problems. However, I can't find the darned things!!
>>>>
>>>> Can someone give me a clue as to how they can be initiated - I would have
>>>> anticipated their appearance in a "Path" file at least. Also appreciated
>>>> would be the location of the documentation files which I also think were
>>>> installed.
>>>>
>>>> TIA
>>>> TomWell, I got it loaded, installed a link to the program and tried to run a>
very small test - the file <stdio> appears to be missing! I've checked
all the specified files seem to be loaded - can someone point me in the
correct direction?
TIA Tom
Tom Clydesdale Guest
-
Richard #7
Re: Compiler Startup
"Tom"posted the following on 2006-04-08:
No they dont : go to the synaptic package manager and install> On Fri, 07 Apr 2006 20:51:53 -0500, Eric Meyers wrote:
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 2006-04-07, Tom Clydesdale <t.clydes@comcast.net> wrote:>>>>> I haven't done any programming for a considerable time and would like to
>>> pick it up again. I've loaded what I think are the GCC and GPC compilers
>>> with no apparent problems. However, I can't find the darned things!!
>>>
>>> Can someone give me a clue as to how they can be initiated - I would have
>>> anticipated their appearance in a "Path" file at least. Also appreciated
>>> would be the location of the documentation files which I also think were
>>> installed.
>>>
>>> TIA
>>> Tom
>> Use which, as in ...
>>
>> which gcc
>>
>> or even better
>> slocate gcc
>>
>> Eric
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.1 (GNU/Linux)
>>
>> iD8DBQFENxc6cLztWWU+V+oRAuWHAKCjCrjXhqmaZkr2Nw1RnH uTUEWyzgCcDRJL
>> EJLDsjqKtt2Cynd9/MkXm9o=
>> =kjvZ
>> -----END PGP SIGNATURE-----
> Thank you gentlemen you gave me the mental clue for proceeding - my
> problem turned out to be semantics (?) in that both programs require the
> version number as part of the program name (ie. gcc-4.0). Without version
> number they remain unknown.
>
"gcc" and just type "gcc" at the command line.
Richard Guest
-
-
Alexander Koch #9
Re: Compiler Startup
R schrieb:
there is an "l" missing> sudo apt-get install build-essentia
sudo apt-get install build-essential
Alexander Koch Guest
-
Centurion #10
Re: Compiler Startup
Tom Clydesdale wrote:
FWIW, there is no such thing as <stdio>. There's these options:>>>>>> On 2006-04-07, Tom Clydesdale <t.clydes@comcast.net> wrote:
>>>>> I haven't done any programming for a considerable time and would like
>>>>> to
>>>>> pick it up again. I've loaded what I think are the GCC and GPC
>>>>> compilers
>>>>> with no apparent problems. However, I can't find the darned things!!
>>>>>
>>>>> Can someone give me a clue as to how they can be initiated - I would
>>>>> have
>>>>> anticipated their appearance in a "Path" file at least. Also
>>>>> appreciated would be the location of the documentation files which I
>>>>> also think were installed.
>>>>>
>>>>> TIA
>>>>> Tom
>> Well, I got it loaded, installed a link to the program and tried to run a>>
> very small test - the file <stdio> appears to be missing! I've checked
> all the specified files seem to be loaded - can someone point me in the
> correct direction?
>
> TIA Tom
#include <stdio.h> // for C programs
#include <cstdio> // for C++ programs
In short, C includes are the same as they always were. C++ including C
libraries drop the ".h" suffix and add a "c" to the front. So <stdio.h>
becomes <cstdio>, <math.h> becomes <cmath>, etc. This naming convention
DOESN'T apply to system-specific headers though, like <sys/socket.h> remain
the same for both C and C++. Confused? ;)
Another gotcha with C++ is that if you've been out of the saddle a while,
you'll find the compiler doesn't assume you're using the standard namespace
so a lot of "old code" simply wont compile on newer compilers (or wont
compile without complaining bitterly). So to get around it you need to
add:
using namespace std; // after the includes and before main()
So the obligatory "Hello World!" app written in C++ these days looks like
this:
#include <iostream>
using namespace std;
int main(void){
cout << "Hello World!" << endl;
return 0;
}
The same thing without the namespace declaration looks like this:
....
std::cout << "Hello World!" << std::endl;
....
See the difference?
HTH,
James
--
America's best buy for a quarter is a telephone call to the right person.
Centurion Guest



Reply With Quote

