public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: simple question
@ 2004-04-16 19:26 lrtaylor
  0 siblings, 0 replies; 26+ messages in thread
From: lrtaylor @ 2004-04-16 19:26 UTC (permalink / raw)
  To: Rnikaeen, gcc-help

You forgot to include the source file on your command line...

Cheers,
Lyle

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Ramin NIkaeen
Sent: Friday, April 16, 2004 1:17 PM
To: gcc-help@gcc.gnu.org
Subject: simple question


Colleaugues,

To test the sanity of a certain static library (libFestival.a), 
I am trying compiling a simple program and linking it to the library.
I get the /usr/lib/crt1.o(.text+0x18): undefined reference to `main'
error. Can someone tell me what is wrong?!

thanks a lot

ramin
-----------------------------------------------------------------
SOURCE CODE
-----------------------------------------------------------------
/*
-I/usr/local/publicVoiceXML/festival-1.4.3.old/src/include
-L/usr/local/publicVoiceXML/festival-1.4.3.old/src/lib
-lFestival
*/

void festival_initialize(int load_init_files,int heap_size);

int main()
{
        festival_initialize(1,2);

        return 0;
}


-----------------------------------------------------------------
COMPILATION
-----------------------------------------------------------------
g++ -L/usr/local/publicVoiceXML/festival-1.4.3.old/src/lib -lFestival
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
jupiter.goldline.net:/home/rnikaeen/test/festival>


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-26  9:13             ` Ángel González
@ 2012-08-26  9:55               ` Jonathan Wakely
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Wakely @ 2012-08-26  9:55 UTC (permalink / raw)
  To: Ángel González
  Cc: Ian Lance Taylor, Florian Weimer, gcc-help, Byron Blue, Georg-Johann Lay

On Aug 25, 2012 10:01 PM, "Ángel González" wrote:
>
> That's probably because the Runtime library exception requires an explicit
> notice on affected files. Had the FSF additionally "licensed" that any
> non-GPL
> code compiled with an official release of gcc is subject to that
> exception and
> is not bound to the GPL due to the compilation.

Many (maybe most) people don't use official releases, they use the
version provided by their distro, which might be modified.

The OP asked a simple question and the answer is that using GCC to
compile non-free code is ok.

This thread should have ended there.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-25 21:23           ` Ian Lance Taylor
@ 2012-08-26  9:13             ` Ángel González
  2012-08-26  9:55               ` Jonathan Wakely
  0 siblings, 1 reply; 26+ messages in thread
From: Ángel González @ 2012-08-26  9:13 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Georg-Johann Lay, Florian Weimer, Byron Blue, gcc-help

On 25/08/12 22:37, Ian Lance Taylor wrote:
> On Sat, Aug 25, 2012 at 1:16 PM, Georg-Johann Lay <gjl@gcc.gnu.org> wrote:
>> Ian Lance Taylor schrieb:
>>
>>> Georg-Johann Lay wrote:
>>>> Ian Lance Taylor schrieb:
>>>>
>>>> Some weeks ago a customer came up with concerns about libgcc, GPL,
>>>> the runtime exception and libgcc code.
>>>>
>>>> The objection against libgcc was that it uses parts that are GPL
>>>> but do *not* come with the runtime exception.
>>>>
>>>> For example, ./libgcc/libgcc2.c includes tm.h which includes files
>>>> from the ARM backend like ./gcc/config/arm/arm.h given the compiler
>>>> is configured for ARM.   arm.h does not come with the library
>>>> exception because it is part of the compiler proper.
>>>>
>>>> The question is now: How is this handled?
>>>>
>>>> Is there a definite statement from the FSF on this case?
>>>> If yes, please point me to it.
>>>> If no, it would be highly appreciated to add a note to the
>>>> FSF or GPL web sites and FAQ.
>>>
>>> I linked to the FSF FAQ earlier, and I think it is clear:
>>>
>>> http://www.gnu.org/licenses/gpl-faq.html#CanIUseGPLToolsForNF
>>
>> hmm. That text is about bison and hairy code.
>> It doesn't even mention "runtime library exception" or #include
> That link poses the question "Can I use GPL-covered tools such as GCC
> to compile [non free programs]?" and answers the question "Yes."
>
> Details like the runtime library exception and #include simply aren't
> relevant.  The issues with the runtime library exception only arise in
> very unusual and, to the best of my knowledge, purely theoretical
> cases.  No ordinary user of GCC will ever encounter them.  The issue
> with #include simply doesn't matter.

That's probably because the Runtime library exception requires an explicit
notice on affected files. Had the FSF additionally "licensed" that any
non-GPL
code compiled with an official release of gcc is subject to that
exception and
is not bound to the GPL due to the compilation.

Most lawyers will get confused if needing to track which files get
automatically
linked by gcc and if they have proper exception.

Should be clear from the first FAQ answer, though:
 http://www.gnu.org/licenses/gcc-exception-3.1-faq.html



Another view about the #include could be that the exception at 

libgcc/libgcc2.c covers all included headers, too. But that may be 
arguable.





>> Of course it is possible to ask the FSF or the GCC steering
>> committee each and every time, but such questions pop up again and
>> again and it might help GCC or other free software if the FAQ was
>> more specific and more explicit on that.  The FAQ could explicitly
>> work out some common use cases like include GPL code in non-GPL
>> code, or the above mentioned inclusion of code without runtime
>> exception from code with runtime exception.
> What questions pop up again and again?  Where do they pop up?  I have
> not seen them.
I have seen many people ask the CanIUseGPLToolsForNF question. Funny thing
is that I don't think they call <big corporation> to check if it's ok to
use their
<software> for <confidential business>.
Not that I have seen explicit exceptions for that on propietary EULAs,
either
(why should they?). Still, many people have doubts about the free software
being viric, when they just want to work with it in user mode.

That makes me think there's a problem in the way many people understood
licenses like GPL. That enters a different realm, though.

Regards

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-25 21:01         ` Georg-Johann Lay
@ 2012-08-25 21:23           ` Ian Lance Taylor
  2012-08-26  9:13             ` Ángel González
  0 siblings, 1 reply; 26+ messages in thread
From: Ian Lance Taylor @ 2012-08-25 21:23 UTC (permalink / raw)
  To: Georg-Johann Lay; +Cc: Florian Weimer, Byron Blue, gcc-help

On Sat, Aug 25, 2012 at 1:16 PM, Georg-Johann Lay <gjl@gcc.gnu.org> wrote:
> Ian Lance Taylor schrieb:
>
>> Georg-Johann Lay wrote:
>>>
>>> Ian Lance Taylor schrieb:
>>>
>>> Some weeks ago a customer came up with concerns about libgcc, GPL,
>>> the runtime exception and libgcc code.
>>>
>>> The objection against libgcc was that it uses parts that are GPL
>>> but do *not* come with the runtime exception.
>>>
>>> For example, ./libgcc/libgcc2.c includes tm.h which includes files
>>> from the ARM backend like ./gcc/config/arm/arm.h given the compiler
>>> is configured for ARM.   arm.h does not come with the library
>>> exception because it is part of the compiler proper.
>>>
>>> The question is now: How is this handled?
>>>
>>> Is there a definite statement from the FSF on this case?
>>> If yes, please point me to it.
>>> If no, it would be highly appreciated to add a note to the
>>> FSF or GPL web sites and FAQ.
>>
>>
>> I linked to the FSF FAQ earlier, and I think it is clear:
>>
>> http://www.gnu.org/licenses/gpl-faq.html#CanIUseGPLToolsForNF
>
>
> hmm. That text is about bison and hairy code.
> It doesn't even mention "runtime library exception" or #include

That link poses the question "Can I use GPL-covered tools such as GCC
to compile [non free programs]?" and answers the question "Yes."

Details like the runtime library exception and #include simply aren't
relevant.  The issues with the runtime library exception only arise in
very unusual and, to the best of my knowledge, purely theoretical
cases.  No ordinary user of GCC will ever encounter them.  The issue
with #include simply doesn't matter.


>> I don't think this is a real problem in practice.  The statement on
>> libgcc/libgcc2.c is clear.  No part of gcc/config/arm/arm.h is copied
>> into libgcc2.c.
>
>
> What if not a copy is #include?  If it is legal to #include any code,
> I could just as well include GPL code in non-GPL software.

I'm sorry, I should have said: no part of gcc/config/arm/arm.h is
copied into libgcc2.o.  Does that make my statement clearer?


>> However, if you are concerned about it, I recommend that you raise the
>> issue with the GCC Steering Committee (by sending
>> an e-mail to gcc@gcc.gnu.org).
>
>
> I have no problem with the GPL, but companies unfamiliar with it
> tend to be kind of paranoid with it...

Yes, and the way to answer that paranoia is to be honest and
straightforward in answering any questions.  It is completely fine to
use GCC to compile proprietary programs.  Nobody has ever been
challenged because they used GCC to build their proprietary program.
It is exceptionally unlikely that anybody ever will be challenge,
since the only part with any standing is the FSF itself, and the FSF
has always said clearly that it is fine to use GCC to compile
proprietary programs.  Should the FSF for some reason change their
position, the law would not be on their side.


> Of course it is possible to ask the FSF or the GCC steering
> committee each and every time, but such questions pop up again and
> again and it might help GCC or other free software if the FAQ was
> more specific and more explicit on that.  The FAQ could explicitly
> work out some common use cases like include GPL code in non-GPL
> code, or the above mentioned inclusion of code without runtime
> exception from code with runtime exception.

What questions pop up again and again?  Where do they pop up?  I have
not seen them.


> If it's no problem, then the page could say so.
>
> I believe that *any* misconceptions about GPL and runtime exception
> should be cleared up as early as possible, and as clearly as
> possible, and as easily to find on the web as possible.
>
> Anything else keeps potential users from using free software.
> That's not the intention of its founders or its authors.

I find the FAQ to be perfectly clear.  But if you find that it is not
clear, I really do urge you to contact the FSF with suggestions for
how to improve it.  I don't see how I can help to improve it, because
to me it seems fine already.

Ian

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-25 20:37       ` Ian Lance Taylor
@ 2012-08-25 21:01         ` Georg-Johann Lay
  2012-08-25 21:23           ` Ian Lance Taylor
  0 siblings, 1 reply; 26+ messages in thread
From: Georg-Johann Lay @ 2012-08-25 21:01 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Florian Weimer, Byron Blue, gcc-help

Ian Lance Taylor schrieb:
> Georg-Johann Lay wrote:
>> Ian Lance Taylor schrieb:
>>
>> Some weeks ago a customer came up with concerns about libgcc, GPL,
>> the runtime exception and libgcc code.
>>
>> The objection against libgcc was that it uses parts that are GPL
>> but do *not* come with the runtime exception.
>>
>> For example, ./libgcc/libgcc2.c includes tm.h which includes files
>> from the ARM backend like ./gcc/config/arm/arm.h given the compiler
>> is configured for ARM.   arm.h does not come with the library
>> exception because it is part of the compiler proper.
>>
>> The question is now: How is this handled?
>>
>> Is there a definite statement from the FSF on this case?
>> If yes, please point me to it.
>> If no, it would be highly appreciated to add a note to the
>> FSF or GPL web sites and FAQ.
> 
> I linked to the FSF FAQ earlier, and I think it is clear:
> 
> http://www.gnu.org/licenses/gpl-faq.html#CanIUseGPLToolsForNF

hmm. That text is about bison and hairy code.
It doesn't even mention "runtime library exception" or #include

> I don't think this is a real problem in practice.  The statement on
> libgcc/libgcc2.c is clear.  No part of gcc/config/arm/arm.h is copied
> into libgcc2.c.

What if not a copy is #include?  If it is legal to #include any code,
I could just as well include GPL code in non-GPL software.

> However, if you are concerned about it, I recommend that you 
> raise the issue with the GCC Steering Committee (by sending
> an e-mail to gcc@gcc.gnu.org).

I have no problem with the GPL, but companies unfamiliar with it
tend to be kind of paranoid with it...

Of course it is possible to ask the FSF or the GCC steering
committee each and every time, but such questions pop up again and
again and it might help GCC or other free software if the FAQ was
more specific and more explicit on that.  The FAQ could explicitly
work out some common use cases like include GPL code in non-GPL
code, or the above mentioned inclusion of code without runtime
exception from code with runtime exception.

If it's no problem, then the page could say so.

I believe that *any* misconceptions about GPL and runtime exception
should be cleared up as early as possible, and as clearly as
possible, and as easily to find on the web as possible.

Anything else keeps potential users from using free software.
That's not the intention of its founders or its authors.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-25 18:20     ` Georg-Johann Lay
@ 2012-08-25 20:37       ` Ian Lance Taylor
  2012-08-25 21:01         ` Georg-Johann Lay
  0 siblings, 1 reply; 26+ messages in thread
From: Ian Lance Taylor @ 2012-08-25 20:37 UTC (permalink / raw)
  To: Georg-Johann Lay; +Cc: Florian Weimer, Byron Blue, gcc-help

On Sat, Aug 25, 2012 at 10:27 AM, Georg-Johann Lay <gjl@gcc.gnu.org> wrote:
> Ian Lance Taylor schrieb:
>
> Some weeks ago a customer came up with concerns about libgcc, GPL,
> the runtime exception and libgcc code.
>
> The objection against libgcc was that it uses parts that are GPL
> but do *not* come with the runtime exception.
>
> For example, ./libgcc/libgcc2.c includes tm.h which includes files
> from the ARM backend like ./gcc/config/arm/arm.h given the compiler
> is configured for ARM.   arm.h does not come with the library
> exception because it is part of the compiler proper.
>
> The question is now: How is this handled?
>
> Is there a definite statement from the FSF on this case?
> If yes, please point me to it.
> If no, it would be highly appreciated to add a note to the
> FSF or GPL web sites and FAQ.

I linked to the FSF FAQ earlier, and I think it is clear:

http://www.gnu.org/licenses/gpl-faq.html#CanIUseGPLToolsForNF

I don't think this is a real problem in practice.  The statement on
libgcc/libgcc2.c is clear.  No part of gcc/config/arm/arm.h is copied
into libgcc2.c.  However, if you are concerned about it, I recommend
that you raise the issue with the GCC Steering Committee (by sending
an e-mail to gcc@gcc.gnu.org).

Ian

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-25 17:30   ` Ian Lance Taylor
  2012-08-25 17:55     ` Bob Plantz
@ 2012-08-25 18:20     ` Georg-Johann Lay
  2012-08-25 20:37       ` Ian Lance Taylor
  1 sibling, 1 reply; 26+ messages in thread
From: Georg-Johann Lay @ 2012-08-25 18:20 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Florian Weimer, Byron Blue, gcc-help

Ian Lance Taylor schrieb:
> On Sat, Aug 25, 2012 at 12:33 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
>> * Byron Blue:
>>
>>> This is the question:
>>>  GCC uses the GNU license scheme. This operating system would be
>>> embedding in our industrial computers and I do not (of course) want
>>> the source code for our operating system to be open source - available
>>> to our competitors. The GNU site is not quite clear in this area and
>>> being new I would not want to "break the rules". Could I ask you for a
>>> bit of clarification on this issue?
>> Unless you take special precautions, GCC copies parts of itself into
>> compiled executables.
> 
> This is false as stated.  It is true that GCC provides runtime
> libraries, and that in some cases the linker (not part of GCC) will
> combine portions of those runtime libraries with the compiled code to
> produce the final executable.
> 
>> The compiled executables must therefore be
>> licensed in a way that is compatible with the GPL.
> 
> This is completely false.
> 
>> However, there is
>> an exception for many parts which can be copied in this way.
> 
> Here you seem to be talking about the runtime libraries.  All parts of
> the runtime libraries have the exception, not "many parts."

Some weeks ago a customer came up with concerns about libgcc, GPL,
the runtime exception and libgcc code.

The objection against libgcc was that it uses parts that are GPL
but do *not* come with the runtime exception.

For example, ./libgcc/libgcc2.c includes tm.h which includes files
from the ARM backend like ./gcc/config/arm/arm.h given the compiler
is configured for ARM.   arm.h does not come with the library
exception because it is part of the compiler proper.

The question is now: How is this handled?

Is there a definite statement from the FSF on this case?
If yes, please point me to it.
If no, it would be highly appreciated to add a note to the
FSF or GPL web sites and FAQ.

All I could find is a remark on a different but related issue,
namely including GPLed headers in non-GPL software.

Richard Stallman wrote 2003-01-09 in [1]:

> [...] I've talked with our lawyer about one specific issue that
> you raised: that of using simple material from header files.
> 
> Someone recently made the claim that including a header file
> always makes a derivative work. 
> 
> That's not the FSF's view. Our view is that just using structure
> definitions, typedefs, enumeration constants, macros with simple
> bodies, etc., is NOT enough to make a derivative work. It would take
> a substantial amount of code (coming from inline functions or macros
> with substantial bodies) to do that.

My assumption is that the policy on including GPL headers without
the runtime exception in GPL sources with the runtime exception is
to be treated similarly.

However, I am not a lawyer and what I think is completely irrelevant.

It there some *official* page that gives explanations on the questions
above?


[1] http://lkml.indiana.edu/hypermail/linux/kernel/0301.1/0362.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-25 17:30   ` Ian Lance Taylor
@ 2012-08-25 17:55     ` Bob Plantz
  2012-08-25 18:20     ` Georg-Johann Lay
  1 sibling, 0 replies; 26+ messages in thread
From: Bob Plantz @ 2012-08-25 17:55 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Florian Weimer, Byron Blue, gcc-help


On 8/25/2012 8:56 AM, Ian Lance Taylor wrote:
> On Sat, Aug 25, 2012 at 12:33 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
>> * Byron Blue:
>>
>>> This is the question:
>>>   GCC uses the GNU license scheme. This operating system would be
>>> embedding in our industrial computers and I do not (of course) want
>>> the source code for our operating system to be open source - available
>>> to our competitors. The GNU site is not quite clear in this area and
>>> being new I would not want to "break the rules". Could I ask you for a
>>> bit of clarification on this issue?
>>
>>
>> Whether these exceptions apply in your case is hard to tell.  It is
>> unlikely that professional legal advice could give you a definitive
>> answer, either.
> In fact an ordinary reading of the license will be entirely
> sufficient.  Of course consulting a lawyer is never a bad idea when
> you are concerned about liability issues.  But I would recommend
> trying to find one already familiar with the legal issues surrounding
> free software, so you don't have to fund his or her education.
>
>
When it comes to legal advice, it has been my experience that there is 
no definitive answer. Depends on the whims of judges, juries, etc.

--Bob


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-25 15:57 ` Florian Weimer
  2012-08-25 16:05   ` Georg-Johann Lay
@ 2012-08-25 17:30   ` Ian Lance Taylor
  2012-08-25 17:55     ` Bob Plantz
  2012-08-25 18:20     ` Georg-Johann Lay
  1 sibling, 2 replies; 26+ messages in thread
From: Ian Lance Taylor @ 2012-08-25 17:30 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Byron Blue, gcc-help

On Sat, Aug 25, 2012 at 12:33 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
> * Byron Blue:
>
>> This is the question:
>>  GCC uses the GNU license scheme. This operating system would be
>> embedding in our industrial computers and I do not (of course) want
>> the source code for our operating system to be open source - available
>> to our competitors. The GNU site is not quite clear in this area and
>> being new I would not want to "break the rules". Could I ask you for a
>> bit of clarification on this issue?
>
> Unless you take special precautions, GCC copies parts of itself into
> compiled executables.

This is false as stated.  It is true that GCC provides runtime
libraries, and that in some cases the linker (not part of GCC) will
combine portions of those runtime libraries with the compiled code to
produce the final executable.

> The compiled executables must therefore be
> licensed in a way that is compatible with the GPL.

This is completely false.

> However, there is
> an exception for many parts which can be copied in this way.

Here you seem to be talking about the runtime libraries.  All parts of
the runtime libraries have the exception, not "many parts."

> This
> exception comes with a set of complex conditions:
>
>   <http://www.gnu.org/licenses/gcc-exception-3.1.html>

As you can see by reading that page, the conditions are not complex.
If you compile your code with GCC, there are no restrictions on your
use of the runtime libraries.  It's true that there are certain
complex mechanisms you can use that will cause your use of the runtime
libraries to be restricted.  However, the license is clear that
ordinary compilation with GCC does not lead to any restrictions.

> Whether these exceptions apply in your case is hard to tell.  It is
> unlikely that professional legal advice could give you a definitive
> answer, either.

In fact an ordinary reading of the license will be entirely
sufficient.  Of course consulting a lawyer is never a bad idea when
you are concerned about liability issues.  But I would recommend
trying to find one already familiar with the legal issues surrounding
free software, so you don't have to fund his or her education.

> I'll ask the FSF to update the link Ian posted.

The link I posted is entirely accurate and there is no need to change it.

Ian

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-25 15:57 ` Florian Weimer
@ 2012-08-25 16:05   ` Georg-Johann Lay
  2012-08-25 17:30   ` Ian Lance Taylor
  1 sibling, 0 replies; 26+ messages in thread
From: Georg-Johann Lay @ 2012-08-25 16:05 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Byron Blue, gcc-help

Florian Weimer schrieb:
> * Byron Blue:
> 
>> This is the question:
>>  GCC uses the GNU license scheme. This operating system would be
>> embedding in our industrial computers and I do not (of course) want
>> the source code for our operating system to be open source - available
>> to our competitors. The GNU site is not quite clear in this area and
>> being new I would not want to "break the rules". Could I ask you for a
>> bit of clarification on this issue?
> 
> Unless you take special precautions, GCC copies parts of itself into
> compiled executables.  The compiled executables must therefore be
> licensed in a way that is compatible with the GPL.  However, there is
> an exception for many parts which can be copied in this way.  This

No, GCC does not "copy parts of itself" into compiled executables.
All code generated by GCC is natively generated and not copied
from somewhere else.

What GCC does is to generate calls to support functions from libgcc.
libgcc is licensed under the GPL but comes with the Runtime Library
Exception (RLE) so that you can link any code against libgcc, even
statically, without turning the final executable to GPL or even
touching the license of your code.

The RLE does not apply if the code must be licensed under GPL for
other reasons, for example because the project uses GPL sources
like the sources of libgcc.

Johann

> exception comes with a set of complex conditions:
> 
>   <http://www.gnu.org/licenses/gcc-exception-3.1.html>
> 
> Whether these exceptions apply in your case is hard to tell.  It is
> unlikely that professional legal advice could give you a definitive
> answer, either.
> 
> I'll ask the FSF to update the link Ian posted.


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-22 13:58 Simple question Byron Blue
                   ` (3 preceding siblings ...)
  2012-08-22 16:39 ` Bob Plantz
@ 2012-08-25 15:57 ` Florian Weimer
  2012-08-25 16:05   ` Georg-Johann Lay
  2012-08-25 17:30   ` Ian Lance Taylor
  4 siblings, 2 replies; 26+ messages in thread
From: Florian Weimer @ 2012-08-25 15:57 UTC (permalink / raw)
  To: Byron Blue; +Cc: gcc-help

* Byron Blue:

> This is the question:
>  GCC uses the GNU license scheme. This operating system would be
> embedding in our industrial computers and I do not (of course) want
> the source code for our operating system to be open source - available
> to our competitors. The GNU site is not quite clear in this area and
> being new I would not want to "break the rules". Could I ask you for a
> bit of clarification on this issue?

Unless you take special precautions, GCC copies parts of itself into
compiled executables.  The compiled executables must therefore be
licensed in a way that is compatible with the GPL.  However, there is
an exception for many parts which can be copied in this way.  This
exception comes with a set of complex conditions:

  <http://www.gnu.org/licenses/gcc-exception-3.1.html>

Whether these exceptions apply in your case is hard to tell.  It is
unlikely that professional legal advice could give you a definitive
answer, either.

I'll ask the FSF to update the link Ian posted.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-22 13:58 Simple question Byron Blue
                   ` (2 preceding siblings ...)
  2012-08-22 15:21 ` David Brown
@ 2012-08-22 16:39 ` Bob Plantz
  2012-08-25 15:57 ` Florian Weimer
  4 siblings, 0 replies; 26+ messages in thread
From: Bob Plantz @ 2012-08-22 16:39 UTC (permalink / raw)
  To: Byron Blue; +Cc: gcc-help

On 8/22/2012 6:05 AM, Byron Blue wrote:
> We are considering moving our operating system to the Linux environment.

I am guessing that you have a proprietary operating system that you have 
written, and you are considering moving further development of that 
operating system to a Linux environment. Note that I say "a Linux," not 
"the Linux." There are many, many Linux environments.

My first question is: What is wrong with your current development 
environment? "If it ain't broke, don't fix it."

I moved from the Apple environment to Linux (several distributions over 
the years) in 1999. There is a significant learning curve. I am very 
happy with my choice, but it cost me lots of time. Is your company 
willing to pay for that time? What do you project they will get in 
return for this investment?

In my case I was in higher education. I believe that our students 
benefited from being able to work in an open-source environment. But 
most of them come to the university knowing only Windows, so there is a 
learning curve for them (which is the whole point of a university 
education!). In a commercial environment learning curves cost money, 
which may not be recovered.

As for licensing issues, I believe you should talk to an attorney who 
specializes in such issues before making any changes. Your preliminary 
research (as you are doing here) may save some attorney billing time, 
but in a commercial venture, I would want the opinion of an attorney. I 
cite the current Apple v Samsung v Apple cases as my evidence.

--Bob


> Our product is a commercial OMNI sonar system used throughout the 
> world in the commercial fishing industry. The software itself and 
> upgrades are free of charge to the user.
> Of course, my choice for the compiler would be GCC.
> I should initially point out that I am unfamiliar with both Linux and 
> therefore GCC.
>
> This is the question:
>  GCC uses the GNU license scheme. This operating system would be 
> embedding in our industrial computers and I do not (of course) want 
> the source code for our operating system to be open source - available 
> to our competitors. The GNU site is not quite clear in this area and 
> being new I would not want to "break the rules". Could I ask you for a 
> bit of clarification on this issue?
> Thank you for your time and efforts,
>
> Byron Blue
> Software Engineering
> MAQ Sonar 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-22 13:58 Simple question Byron Blue
  2012-08-22 14:03 ` Ángel González
  2012-08-22 14:35 ` Ian Lance Taylor
@ 2012-08-22 15:21 ` David Brown
  2012-08-22 16:39 ` Bob Plantz
  2012-08-25 15:57 ` Florian Weimer
  4 siblings, 0 replies; 26+ messages in thread
From: David Brown @ 2012-08-22 15:21 UTC (permalink / raw)
  To: Byron Blue; +Cc: gcc-help

On 22/08/2012 15:05, Byron Blue wrote:
> We are considering moving our operating system to the Linux environment.
> Our product is a commercial OMNI sonar system used throughout the world
> in the commercial fishing industry. The software itself and upgrades are
> free of charge to the user.
> Of course, my choice for the compiler would be GCC.
> I should initially point out that I am unfamiliar with both Linux and
> therefore GCC.

Gcc is very popular on all operating systems, not just Linux.  If it is 
of help during testing, development, or the move to Linux, then you 
might like to get a copy for Windows (assuming that is your old 
environment) - google for the "mingw" gcc build.  Converting your 
application to build using gcc on Windows may let you split the task 
into two steps.

>
> This is the question:
>   GCC uses the GNU license scheme. This operating system would be
> embedding in our industrial computers and I do not (of course) want the
> source code for our operating system to be open source - available to
> our competitors.

When you say "operating system", do you really mean your application? 
/Linux/ is an "operating system", as is Windows, QNX, etc.  If you wrote 
your own operating system, then you don't need Linux.

The operating system has its own license - in the case of Linux, this is 
GPL2.  This means that you /do/ have to make all the source code for 
your Linux installation available to your customers (and likely 
therefore also your competitors).  However, it's not code that /you/ 
wrote, and it is not secret anyway - everyone can download it.  So 
you've lost nothing.

For your own application code, you can license it exactly as you want. 
The licence of the OS does not affect it, nor does the license for the 
compiler (well, technically the license of gcc /does/ affect it - in 
that it explicitly says that you can use whatever licence you want).  So 
you can be as secret or open as you want for your own source code.

Be aware that some libraries may restrict your licensing.  But that 
applies anyway regardless of the OS or compiler.

If you are writing code such as device drivers that link directly to the 
Linux kernel, then there are other licensing issues.  But those are 
connected to Linux, rather than the compiler, so there are better places 
to discuss them (such as the comp.os.linux.embedded newsgroup).

> The GNU site is not quite clear in this area and being
> new I would not want to "break the rules". Could I ask you for a bit of
> clarification on this issue?
> Thank you for your time and efforts,
>
> Byron Blue
> Software Engineering
> MAQ Sonar
>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-22 13:58 Simple question Byron Blue
  2012-08-22 14:03 ` Ángel González
@ 2012-08-22 14:35 ` Ian Lance Taylor
  2012-08-22 15:21 ` David Brown
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 26+ messages in thread
From: Ian Lance Taylor @ 2012-08-22 14:35 UTC (permalink / raw)
  To: Byron Blue; +Cc: gcc-help

On Wed, Aug 22, 2012 at 6:05 AM, Byron Blue <byron@maqsonar.com> wrote:
>
>  GCC uses the GNU license scheme. This operating system would be embedding
> in our industrial computers and I do not (of course) want the source code
> for our operating system to be open source - available to our competitors.
> The GNU site is not quite clear in this area and being new I would not want
> to "break the rules". Could I ask you for a bit of clarification on this
> issue?

The license of GCC does not affect the license of code that you
compile with GCC.

http://www.gnu.org/licenses/gpl-faq.html#CanIUseGPLToolsForNF

Ian

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Simple question
  2012-08-22 13:58 Simple question Byron Blue
@ 2012-08-22 14:03 ` Ángel González
  2012-08-22 14:35 ` Ian Lance Taylor
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 26+ messages in thread
From: Ángel González @ 2012-08-22 14:03 UTC (permalink / raw)
  To: Byron Blue; +Cc: gcc-help

On 22/08/12 15:05, Byron Blue wrote:
> We are considering moving our operating system to the Linux environment.
> Our product is a commercial OMNI sonar system used throughout the
> world in the commercial fishing industry. The software itself and
> upgrades are free of charge to the user.
> Of course, my choice for the compiler would be GCC.
> I should initially point out that I am unfamiliar with both Linux and
> therefore GCC.
>
> This is the question:
>  GCC uses the GNU license scheme. This operating system would be
> embedding in our industrial computers and I do not (of course) want
> the source code for our operating system to be open source - available
> to our competitors. The GNU site is not quite clear in this area and
> being new I would not want to "break the rules". Could I ask you for a
> bit of clarification on this issue?
> Thank you for your time and efforts,
>
> Byron Blue
> Software Engineering
> MAQ Sonar
Compiling a program with gcc does not force it to be released under the
GPL or other free software license.
The compiler being under GPL license means that if you modified *the
compiler*, then those modifications would need to be available under the
GPL terms.
I guess that was your doubt when contacting this mailing list (which
isn't the best one for licensing advice, anyway).

You also talk about "your operating system to be open source" and "using
Linux". If you make your own OS compiled, you're in the above state as
for any other compiled program. If instead of making your own Operating
System, you provide your program installed with a Linux kernel (eg. you
installed on a debian distribution), then yes, you would have to provide
that code available to anyone which purchased your system. But that same
code is already available for anyone from www.debian.org, so not really
a problem for your company IMHO.
You can provide your propietary software (without the code) installed in
a debian distribution (whose code you do provide, but you didn't make
either).
Now, if you needed to modify the Linux kernel, eg. for adding a driver
supporting your sonar, then you *may* need to license it under a free
license (but may also depend on the kernel symbols you used), developing
a propietary kernel driver is trickier, and I'm not completely sure it's
possible.
On the other hand, it's probably on your interest to contribute it to
the kernel under the GPL. The business logic should be at the
application (which is still propietary), the driver would contain code
like "read from port rs232 with a 9600 baud-rate, checking the parity
bit, and providing the stream to /dev/sonar" (not a top secret). If it's
available upstream, you will receive comments from other developers (eg.
"the way you're doing this is wrong, that may lead to deadlocks if
xyz"), and it will be much easier to update from one kernel version to
the next, since you won't need to sync in separately.  And if someone
really wanted to connect your sonar to a different computer running
Linux instead of the computer you provided, they would still be buying
you the hardware, so no profit loss there.

Regards

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Simple question
@ 2012-08-22 13:58 Byron Blue
  2012-08-22 14:03 ` Ángel González
                   ` (4 more replies)
  0 siblings, 5 replies; 26+ messages in thread
From: Byron Blue @ 2012-08-22 13:58 UTC (permalink / raw)
  To: gcc-help

We are considering moving our operating system to the Linux environment.
Our product is a commercial OMNI sonar system used throughout the world in 
the commercial fishing industry. The software itself and upgrades are free 
of charge to the user.
Of course, my choice for the compiler would be GCC.
I should initially point out that I am unfamiliar with both Linux and 
therefore GCC.

This is the question:
  GCC uses the GNU license scheme. This operating system would be embedding 
in our industrial computers and I do not (of course) want the source code 
for our operating system to be open source - available to our competitors. 
The GNU site is not quite clear in this area and being new I would not want 
to "break the rules". Could I ask you for a bit of clarification on this 
issue?
Thank you for your time and efforts,

Byron Blue
Software Engineering
MAQ Sonar 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* simple question
@ 2004-04-16 19:19 Ramin NIkaeen
  0 siblings, 0 replies; 26+ messages in thread
From: Ramin NIkaeen @ 2004-04-16 19:19 UTC (permalink / raw)
  To: gcc-help


Colleaugues,

To test the sanity of a certain static library (libFestival.a), 
I am trying compiling a simple program and linking it to the library.
I get the /usr/lib/crt1.o(.text+0x18): undefined reference to `main'
error. Can someone tell me what is wrong?!

thanks a lot

ramin
-----------------------------------------------------------------
SOURCE CODE
-----------------------------------------------------------------
/*
-I/usr/local/publicVoiceXML/festival-1.4.3.old/src/include
-L/usr/local/publicVoiceXML/festival-1.4.3.old/src/lib
-lFestival
*/

void festival_initialize(int load_init_files,int heap_size);

int main()
{
        festival_initialize(1,2);

        return 0;
}


-----------------------------------------------------------------
COMPILATION
-----------------------------------------------------------------
g++ -L/usr/local/publicVoiceXML/festival-1.4.3.old/src/lib -lFestival
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
jupiter.goldline.net:/home/rnikaeen/test/festival>


^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: simple question
@ 2004-04-16 16:40 lrtaylor
  0 siblings, 0 replies; 26+ messages in thread
From: lrtaylor @ 2004-04-16 16:40 UTC (permalink / raw)
  To: hbena76, gcc-help; +Cc: Rnikaeen

Using gcc for linking c++ programs will not always work, even if you add the C++ library to the link line.  For example, exception handling may not work correctly, because things need to be linked slightly differently to properly handle exception handling on certain platforms.

Use g++.

Cheers,
Lyle

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Houda Benabderrazik
Sent: Friday, April 16, 2004 3:07 AM
To: gcc-help@gcc.gnu.org
Cc: Ramin NIkaeen
Subject: Re: simple question


gcc  -lstdc++ c.cpp
will work.

 --- Ramin NIkaeen <Rnikaeen@goldline.net> a écrit : >

> 
> Valued Colleagues,
> 
> I have built and installed gcc-3.3 on RedHat linux
> 7.2 but I am having 
> problems with the compiler. For several days I have
> been trying to
> figure out the cause of the problem but I have not
> had much success.
> 
> Below is a small sample program and the compiler
> error that I get.
> 
> If someone can give me any pointers as to the cause
> of the problem,
> I will be very thankful.
> 
> best regards
> 
> ramin
> 
> 
>
--------------------------------------------------------------------------------------------
> TEST PROGRAM
>
--------------------------------------------------------------------------------------------
> jupiter.goldline.net:/home/rnikaeen/test>more c.cpp
> 
> #include <iostream>
> #include <string>
> using namespace std;
> 
> int main()
> {
>     cerr << "Enter your name ";
> 
>     return 0;
> }
> 
>
--------------------------------------------------------------------------------------------
> COMPILER OUTPUT
>
--------------------------------------------------------------------------------------------
> jupiter.goldline.net:/home/rnikaeen/test>gcc c.cpp
> /tmp/cc5AisQc.o: In function `main':
> /tmp/cc5AisQc.o(.text+0x1b): undefined reference to
> `std::cerr'
> /tmp/cc5AisQc.o(.text+0x20): undefined reference to
> `std::basic_ostream<char, std::char_traits<char> >&
> std::operator<< <std::char_traits<char>
> >(std::basic_ostream<char, std::char_traits<char>
> >&, char const*)'
> /tmp/cc5AisQc.o: In function
> `__static_initialization_and_destruction_0(int,
> int)':
> /tmp/cc5AisQc.o(.text+0x49): undefined reference to
> `std::ios_base::Init::Init[in-charge]()'
> /tmp/cc5AisQc.o(.text+0x64): undefined reference to
> `std::ios_base::Init::~Init [in-charge]()'
> /tmp/cc5AisQc.o(.eh_frame+0x11): undefined reference
> to `__gxx_personality_v0'
> collect2: ld returned 1 exit status
> 
>
--------------------------------------------------------------------------------------------
> gcc VERSION
>
--------------------------------------------------------------------------------------------
> jupiter.goldline.net:/home/rnikaeen/test>which gcc 
> /usr/local/bin/gcc
> 
> 
> jupiter.goldline.net:/home/rnikaeen/test>gcc -v
> Reading specs from
> /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
> Configured with: ./configure 
> Thread model: posix
> gcc version 3.3
> 
>
--------------------------------------------------------------------------------------------
> RedHat Linux VERSION
>
--------------------------------------------------------------------------------------------
>
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3>uname
> -v
> #1 Thu May 29 08:32:50 EDT 2003
>
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3>uname
> -a
> Linux jupiter.goldline.net 2.4.20-18.7 #1 Thu May 29
> 08:32:50 EDT 2003 i686 unknown
>
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3> 


	

	
		
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! Messenger sur http://fr.messenger.yahoo.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: simple question
  2004-04-15 21:43 Ramin NIkaeen
                   ` (2 preceding siblings ...)
  2004-04-15 21:48 ` Paolo Carlini
@ 2004-04-16  9:06 ` Houda Benabderrazik
  3 siblings, 0 replies; 26+ messages in thread
From: Houda Benabderrazik @ 2004-04-16  9:06 UTC (permalink / raw)
  To: gcc-help; +Cc: Ramin NIkaeen


gcc  -lstdc++ c.cpp
will work.

 --- Ramin NIkaeen <Rnikaeen@goldline.net> a écrit : >

> 
> Valued Colleagues,
> 
> I have built and installed gcc-3.3 on RedHat linux
> 7.2 but I am having 
> problems with the compiler. For several days I have
> been trying to
> figure out the cause of the problem but I have not
> had much success.
> 
> Below is a small sample program and the compiler
> error that I get.
> 
> If someone can give me any pointers as to the cause
> of the problem,
> I will be very thankful.
> 
> best regards
> 
> ramin
> 
> 
>
--------------------------------------------------------------------------------------------
> TEST PROGRAM
>
--------------------------------------------------------------------------------------------
> jupiter.goldline.net:/home/rnikaeen/test>more c.cpp
> 
> #include <iostream>
> #include <string>
> using namespace std;
> 
> int main()
> {
>     cerr << "Enter your name ";
> 
>     return 0;
> }
> 
>
--------------------------------------------------------------------------------------------
> COMPILER OUTPUT
>
--------------------------------------------------------------------------------------------
> jupiter.goldline.net:/home/rnikaeen/test>gcc c.cpp
> /tmp/cc5AisQc.o: In function `main':
> /tmp/cc5AisQc.o(.text+0x1b): undefined reference to
> `std::cerr'
> /tmp/cc5AisQc.o(.text+0x20): undefined reference to
> `std::basic_ostream<char, std::char_traits<char> >&
> std::operator<< <std::char_traits<char>
> >(std::basic_ostream<char, std::char_traits<char>
> >&, char const*)'
> /tmp/cc5AisQc.o: In function
> `__static_initialization_and_destruction_0(int,
> int)':
> /tmp/cc5AisQc.o(.text+0x49): undefined reference to
> `std::ios_base::Init::Init[in-charge]()'
> /tmp/cc5AisQc.o(.text+0x64): undefined reference to
> `std::ios_base::Init::~Init [in-charge]()'
> /tmp/cc5AisQc.o(.eh_frame+0x11): undefined reference
> to `__gxx_personality_v0'
> collect2: ld returned 1 exit status
> 
>
--------------------------------------------------------------------------------------------
> gcc VERSION
>
--------------------------------------------------------------------------------------------
> jupiter.goldline.net:/home/rnikaeen/test>which gcc 
> /usr/local/bin/gcc
> 
> 
> jupiter.goldline.net:/home/rnikaeen/test>gcc -v
> Reading specs from
> /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
> Configured with: ./configure 
> Thread model: posix
> gcc version 3.3
> 
>
--------------------------------------------------------------------------------------------
> RedHat Linux VERSION
>
--------------------------------------------------------------------------------------------
>
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3>uname
> -v
> #1 Thu May 29 08:32:50 EDT 2003
>
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3>uname
> -a
> Linux jupiter.goldline.net 2.4.20-18.7 #1 Thu May 29
> 08:32:50 EDT 2003 i686 unknown
>
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3> 


	

	
		
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! Messenger sur http://fr.messenger.yahoo.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: simple question
  2004-04-15 21:43 Ramin NIkaeen
  2004-04-15 21:47 ` Andreas Tobler
  2004-04-15 21:47 ` Gabriel Dos Reis
@ 2004-04-15 21:48 ` Paolo Carlini
  2004-04-16  9:06 ` Houda Benabderrazik
  3 siblings, 0 replies; 26+ messages in thread
From: Paolo Carlini @ 2004-04-15 21:48 UTC (permalink / raw)
  To: Ramin NIkaeen; +Cc: gcc-help

Ramin NIkaeen wrote:

>If someone can give me any pointers as to the cause of the problem,
>I will be very thankful.
>  
>
Please use g++, not gcc, since yours is a c++ program.

Paolo.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: simple question
  2004-04-15 21:43 Ramin NIkaeen
  2004-04-15 21:47 ` Andreas Tobler
@ 2004-04-15 21:47 ` Gabriel Dos Reis
  2004-04-15 21:48 ` Paolo Carlini
  2004-04-16  9:06 ` Houda Benabderrazik
  3 siblings, 0 replies; 26+ messages in thread
From: Gabriel Dos Reis @ 2004-04-15 21:47 UTC (permalink / raw)
  To: Ramin NIkaeen; +Cc: gcc-help, gcc

"Ramin NIkaeen" <Rnikaeen@goldline.net> writes:

| jupiter.goldline.net:/home/rnikaeen/test>gcc c.cpp

The GNU C++ compiler is named "g++".  Try g++ c.cpp.

-- Gaby

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: simple question
  2004-04-15 21:43 Ramin NIkaeen
@ 2004-04-15 21:47 ` Andreas Tobler
  2004-04-15 21:47 ` Gabriel Dos Reis
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 26+ messages in thread
From: Andreas Tobler @ 2004-04-15 21:47 UTC (permalink / raw)
  To: Ramin NIkaeen; +Cc: gcc-help, gcc

Ramin NIkaeen wrote:

> --------------------------------------------------------------------------------------------
> COMPILER OUTPUT
> --------------------------------------------------------------------------------------------
> jupiter.goldline.net:/home/rnikaeen/test>gcc c.cpp
> 

How about g++ c.cpp ?

Andreas

^ permalink raw reply	[flat|nested] 26+ messages in thread

* simple question
@ 2004-04-15 21:43 Ramin NIkaeen
  2004-04-15 21:47 ` Andreas Tobler
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Ramin NIkaeen @ 2004-04-15 21:43 UTC (permalink / raw)
  To: gcc-help; +Cc: gcc



Valued Colleagues,

I have built and installed gcc-3.3 on RedHat linux 7.2 but I am having 
problems with the compiler. For several days I have been trying to
figure out the cause of the problem but I have not had much success.

Below is a small sample program and the compiler error that I get.

If someone can give me any pointers as to the cause of the problem,
I will be very thankful.

best regards

ramin


--------------------------------------------------------------------------------------------
TEST PROGRAM
--------------------------------------------------------------------------------------------
jupiter.goldline.net:/home/rnikaeen/test>more c.cpp

#include <iostream>
#include <string>
using namespace std;

int main()
{
    cerr << "Enter your name ";

    return 0;
}

--------------------------------------------------------------------------------------------
COMPILER OUTPUT
--------------------------------------------------------------------------------------------
jupiter.goldline.net:/home/rnikaeen/test>gcc c.cpp
/tmp/cc5AisQc.o: In function `main':
/tmp/cc5AisQc.o(.text+0x1b): undefined reference to `std::cerr'
/tmp/cc5AisQc.o(.text+0x20): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/cc5AisQc.o: In function `__static_initialization_and_destruction_0(int, int)':
/tmp/cc5AisQc.o(.text+0x49): undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/cc5AisQc.o(.text+0x64): undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/cc5AisQc.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

--------------------------------------------------------------------------------------------
gcc VERSION
--------------------------------------------------------------------------------------------
jupiter.goldline.net:/home/rnikaeen/test>which gcc 
/usr/local/bin/gcc


jupiter.goldline.net:/home/rnikaeen/test>gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configured with: ./configure 
Thread model: posix
gcc version 3.3

--------------------------------------------------------------------------------------------
RedHat Linux VERSION
--------------------------------------------------------------------------------------------
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3>uname -v
#1 Thu May 29 08:32:50 EDT 2003
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3>uname -a
Linux jupiter.goldline.net 2.4.20-18.7 #1 Thu May 29 08:32:50 EDT 2003 i686 unknown
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* simple question
@ 2002-11-27 10:11 cowen
  0 siblings, 0 replies; 26+ messages in thread
From: cowen @ 2002-11-27 10:11 UTC (permalink / raw)
  To: gcc-help

Hello all.

This is perhaps a stupid newbie question. I'm implementing gammln, one of 
the numerical recipes
(available from 
http://www.ulib.org/webRoot/Books/Numerical_Recipes/bookcpdf.html, chapter 6).

gammln (or lnGamma as I've named it) computes the natural log of the gamma 
function, which
should allow one to compute interesting things, like factorials.

Here's the code:

***************** utils.h **************************************

#ifndef UTILS_H
#define UTILS_H

double lnGamma ( double xx );

#endif // UTILS_H


**************** utils.c **************************************

#include <math.h>

double lnGamma ( double xx )
{
         int j;
         double x,y,tmp,ser;
         static double cof[6] = {
                 76.18009172947146,
                 -86.50532032941677,
                 24.01409824083091,
                 -1.231739572450155,
                 0.1208650973866179e-2,
                 -0.5395239384953e-5
         };

         y = x = xx;
         tmp  = x + 5.5;
         tmp -= ( x + 0.5 ) * log( tmp );
         ser = 1.000000000190015;

         for ( j = 0; j <= 5; j++ )
                 ser += cof[j]/++y;

         return -tmp + log( 2.5066282746310005 * ser/x );
}

**************************** test.c 
*******************************************

#include <stdio.h>
#include <math.h>
#include "utils.h"

int main ()
{
     int i;
     for ( i = 1; i <= 20; i++ ) {
         printf( "%3d!: %.0f\n", i, exp( lnGamma(  i + 1.0 ) ) );
     }
     return 0;
}

*************************************************************************************

Here's the output:

   1!: 1
   2!: 2
   3!: 6
   4!: 24
   5!: 120
   6!: 720
   7!: 5040
   8!: 40320
   9!: 362880
  10!: 3628800
  11!: 39916800
  12!: 479001600
  13!: 6227020800
  14!: 87178291200
  15!: 1307674368006
  16!: 20922789888126
  17!: 355687428098601
  18!: 6402373705783494
  19!: 121645100410059440
  20!: 2432902008204834800

**********************************************************

This is obviously wrong. (15! is evidence enough.)

The algorithm, however, is correct -- I lifted it
directly from the numerical recipe, and I'm fairly confident that
the authors have not made an error. I've built and run the example
on different platforms. The result is always the same.


Here is a primitive Makefile:


all: utils.o test.o test.exe

%.o: %.c
         gcc -c -g -Wall -o $@ $^

test.exe:
         gcc -o $@ -g -Wall utils.o test.o



Any suggestions would be most helpful.

Thanks in advance,
Charles.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: simple question
  2000-08-08 10:46 RPathiyal
@ 2000-08-08 18:18 ` Alexandre Oliva
  0 siblings, 0 replies; 26+ messages in thread
From: Alexandre Oliva @ 2000-08-08 18:18 UTC (permalink / raw)
  To: RPathiyal; +Cc: help-gcc

On Aug  8, 2000, RPathiyal@aol.com wrote:

> i then typed gcc hello.c at the linux prompt and the computer paused
> for a second and then another linux prompt came up.  my question is,
> does this mean that the file compiled properly?

Yep

> also, is there any way for me to see the output (eg. see "Hello
> World" printed to the screen)?

Sure, just run the program.  It's called `a.out' if you don't use the
`-o' flag.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

^ permalink raw reply	[flat|nested] 26+ messages in thread

* simple question
@ 2000-08-08 10:46 RPathiyal
  2000-08-08 18:18 ` Alexandre Oliva
  0 siblings, 1 reply; 26+ messages in thread
From: RPathiyal @ 2000-08-08 10:46 UTC (permalink / raw)
  To: help-gcc

hi,

i'm new to GCC and its capabilities.  i recently configured, built and installed GCC 2.95.2 for a redhat linux 6.1 machine with no problems.  i created a simple hello.c file to test the compiler.  

#inlucde <stdio.h>
int main ()
{   printf("\nHello World\n");
    return 0;
}

i then typed gcc hello.c at the linux prompt and the computer paused for a second and then another linux prompt came up.  my question is, does this mean that the file compiled properly?  also, is there any way for me to see the output (eg. see "Hello World" printed to the screen)?  or does the GCC only compile files and not run them?  or do i need to add an option to the gcc command in order to get an output?  please help me.  i dont know the material very well enough to understand the documentation all that well.  also, please email any responses to me at this address (RPathiyal@aol.com) as i am not on the mailing list.  Thanks in advance for any help.

sanjay pathiyal


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2012-08-25 21:23 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-16 19:26 simple question lrtaylor
  -- strict thread matches above, loose matches on Subject: below --
2012-08-22 13:58 Simple question Byron Blue
2012-08-22 14:03 ` Ángel González
2012-08-22 14:35 ` Ian Lance Taylor
2012-08-22 15:21 ` David Brown
2012-08-22 16:39 ` Bob Plantz
2012-08-25 15:57 ` Florian Weimer
2012-08-25 16:05   ` Georg-Johann Lay
2012-08-25 17:30   ` Ian Lance Taylor
2012-08-25 17:55     ` Bob Plantz
2012-08-25 18:20     ` Georg-Johann Lay
2012-08-25 20:37       ` Ian Lance Taylor
2012-08-25 21:01         ` Georg-Johann Lay
2012-08-25 21:23           ` Ian Lance Taylor
2012-08-26  9:13             ` Ángel González
2012-08-26  9:55               ` Jonathan Wakely
2004-04-16 19:19 simple question Ramin NIkaeen
2004-04-16 16:40 lrtaylor
2004-04-15 21:43 Ramin NIkaeen
2004-04-15 21:47 ` Andreas Tobler
2004-04-15 21:47 ` Gabriel Dos Reis
2004-04-15 21:48 ` Paolo Carlini
2004-04-16  9:06 ` Houda Benabderrazik
2002-11-27 10:11 cowen
2000-08-08 10:46 RPathiyal
2000-08-08 18:18 ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).