Help with GCC?
Help with GCC?
When I try to compile c code in gcc it comes up with an error, something like, Unrecognised command '-lang-c'
What does this mean & how can I rectify it?
What does this mean & how can I rectify it?
Re:Help with GCC?
How do you compile? What C code? What version is gcc? How did you get that gcc, and how was it configured?KieranFoot wrote: When I try to compile c code in gcc it comes up with an error, something like, Unrecognised command '-lang-c'
What does this mean & how can I rectify it?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Help with GCC?
there's nothing like "-lang-c" in parameters for GCC ... you're probably screwing up the building process or trying to pass parameters targetted at compiler X to compiler Y.
Could you provide a bit more information at *what* you're trying to compile and *what* you're trying to use ?
(e.g. attach your makefile or tell us the command you typed)
Could you provide a bit more information at *what* you're trying to compile and *what* you're trying to use ?
(e.g. attach your makefile or tell us the command you typed)
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Help with GCC?
now, *that*'s funny
- what does gcc --version returns ?
- does it work better if the file is named "myfile.c" (with a lower-case c as extension) than "myfile.C" ?
- what is the "myfile.???" argument you give after the filename ? You know "-c" flag tells the compiler "i just want you to compile this file into a relocatable, linkable object. Don't worry if there are unresolved dependencies, or missing libraries or whatever"
and once again, what's your dev. environment ? linux ? djgpp ? cygwin ? ...
- what does gcc --version returns ?
- does it work better if the file is named "myfile.c" (with a lower-case c as extension) than "myfile.C" ?
- what is the "myfile.???" argument you give after the filename ? You know "-c" flag tells the compiler "i just want you to compile this file into a relocatable, linkable object. Don't worry if there are unresolved dependencies, or missing libraries or whatever"
and once again, what's your dev. environment ? linux ? djgpp ? cygwin ? ...
Re:Help with GCC?
OK, let's see. Since you haven't told us anything about the contents of Myfile.C, I'll assume:
When *I* type "Gcc -c Myfile.C Myfile.???", I get "Gcc: Myfile.???: No such file or directory.", so you probably did type something else.
Insufficient Information - Unable to reproduce.
Try again.
READY.
*blinking cursor*
Code: Select all
int main()
{
return 42;
}
Insufficient Information - Unable to reproduce.
Try again.
READY.
*blinking cursor*
Every good solution is obvious once you've found it.
Re:Help with GCC?
- gcc --help
Usage: gcc [options] file...
Options:
--help Display this information
(Use '-v --help' to display command line options of sub-processes)
<pype>... stuff omitted for compactness ...</pype>
-x <language> Specify the language of the following input files
Permissable languages include: c c++ assembler none
'none' means revert to the default behaviour of
guessing the language based on the file's extension
<pype>... stuff omitted for compactness ...</pype>
- gcc -v --help | & grep -i lang
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(bsd) -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) --help help-dummy /usr/tmp/ccCVDdfB.i
-lang-c Assume that the input sources are in C
-lang-c89 Assume that the input is C89; depricated
-lang-c++ Assume that the input sources are in C++
-lang-objc Assume that the input sources are in ObjectiveC
-lang-objc++ Assume that the input sources are in ObjectiveC++
-lang-asm Assume that the input sources are in assembler
-lang-chill Assume that the input sources are in Chill
<pype>... stuff omitted for compactness ...</pype>
-
haven't you learned copy-paste in school ??
Usage: gcc [options] file...
Options:
--help Display this information
(Use '-v --help' to display command line options of sub-processes)
<pype>... stuff omitted for compactness ...</pype>
-x <language> Specify the language of the following input files
Permissable languages include: c c++ assembler none
'none' means revert to the default behaviour of
guessing the language based on the file's extension
<pype>... stuff omitted for compactness ...</pype>
- gcc -v --help | & grep -i lang
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(bsd) -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) --help help-dummy /usr/tmp/ccCVDdfB.i
-lang-c Assume that the input sources are in C
-lang-c89 Assume that the input is C89; depricated
-lang-c++ Assume that the input sources are in C++
-lang-objc Assume that the input sources are in ObjectiveC
-lang-objc++ Assume that the input sources are in ObjectiveC++
-lang-asm Assume that the input sources are in assembler
-lang-chill Assume that the input sources are in Chill
<pype>... stuff omitted for compactness ...</pype>
-
haven't you learned copy-paste in school ??
Re:Help with GCC?
@sdfgb: And what is the point of this all? What do you mean, besides intending to provoke.
Re:Help with GCC?
For one, he's pointing out that KieranFoot could have gotten online help quite easy.
Second, he's pointing out that there *is* a -lang-c option to GCC.
Third, that still doesn't help since KieranFoot is a bit vague on what his problem is.
Second, he's pointing out that there *is* a -lang-c option to GCC.
Third, that still doesn't help since KieranFoot is a bit vague on what his problem is.
Every good solution is obvious once you've found it.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Help with GCC?
@bilazy: i guess the "code poet" (recognize him ? random-5-letters guest) is trying to say that i'm stupid because there *is* -c-lang option flag in his copy of GCC and that simply using "gcc -v --help" would have told me.
@code poet: i learnt *not* to copy/paste at school, for copy/pasting is the root of evil bugz.
and
So it seems "-lang-<language>" is not *that* widely available ...
@codepoet: would you mind becoming a member, one day, so that we don't have the feeling we talk to a wall but instead to a person ? or maybe you're just a program, in which case you should receive my apologize and upgrade to the latest available version of yourself.
@code poet: i learnt *not* to copy/paste at school, for copy/pasting is the root of evil bugz.
Code: Select all
users/martin> gcc -v
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/3.3/specs
Configured with: (....)
Thread model: posix
gcc version 3.3 20030226 (prerelease) (SuSE Linux)
users/martin> gcc -c-lang
gcc: unrecognized option `-c-lang'
gcc: no input files
Code: Select all
users/martin> /opt/gnu/bin/gcc -v
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.3/specs
gcc version 2.95.3 20010315 (SuSE)
users/martin> /opt/gnu/bin/gcc -c-lang
gcc: unrecognized option `-c-lang'
gcc: No input files
@codepoet: would you mind becoming a member, one day, so that we don't have the feeling we talk to a wall but instead to a person ? or maybe you're just a program, in which case you should receive my apologize and upgrade to the latest available version of yourself.
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Help with GCC?
@solar: maybe maybe, He's due respect for holding out the holy grail for old KieranFoot, but mark your third point which amongst three is the one which weighs most.
@pype: Of course a moment of recoginition is present - despite the lack of lyra in his lenghty post. That poet could have expressed this with less words without spoiling database space. No need for apology. He's of course due to an update, I think. *rofl*
Maybe someone already has invented a brain flasher.
@pype: Of course a moment of recoginition is present - despite the lack of lyra in his lenghty post. That poet could have expressed this with less words without spoiling database space. No need for apology. He's of course due to an update, I think. *rofl*
Maybe someone already has invented a brain flasher.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
Re:Help with GCC?
Erm... Pype? You are aware that the option is "-lang-c", not "-c-lang" as in your posting?
Every good solution is obvious once you've found it.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Help with GCC?
<doh>
My mind is temporarily absent ... /dev/brain is screening your call ... please talk after the beep ...
CTRL+H
</doh>
Well, according to `info gcc`,
My mind is temporarily absent ... /dev/brain is screening your call ... please talk after the beep ...
CTRL+H
</doh>
Well, according to `info gcc`,
So i guess my typo isn't that troublesome(...) If cpp does not recognize the extension, it will treat the file as C; this is the most generic mode.
*Note:* Previous versions of cpp accepted a `-lang' option which
selected both the language and the standards conformance level.
This option has been removed, because it conflicts with the `-l'
option.
Re:Help with GCC?
You're forgetting the -o option. What he wants is for gcc to compile and asseble myfile.C, and spit out myfile.???, but he's forgetting -o.Solar wrote: OK, let's see. Since you haven't told us anything about the contents of Myfile.C, I'll assume:
When *I* type "Gcc -c Myfile.C Myfile.???", I get "Gcc: Myfile.???: No such file or directory.", so you probably did type something else.Code: Select all
int main() { return 42; }
Insufficient Information - Unable to reproduce.
Try again.
READY.
*blinking cursor*
The correct way of doing that is:
gcc -c myfile.C -o myfile.???
As far as the no -lang-c option, I don't see that specified anyways. It probably stems from an old version of GCC.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Help with GCC?
in every shell i know, 'myfile.???' is a wildcard name saying "myfile. followed by any three character". I'd say the make/batch file he's using is obsolete.