public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc 3.3 cmath undefined errors
@ 2005-05-18 20:39 Wesley Smith
  2005-05-18 23:39 ` Eljay Love-Jensen
  0 siblings, 1 reply; 7+ messages in thread
From: Wesley Smith @ 2005-05-18 20:39 UTC (permalink / raw)
  To: gcc-help

Hi, I'm trying to compile a program that uses the cmath functions. 
I've been looking for about a week for a solutino to this problem, so
hopefully someone will have a hint.  Here's a partial output from gcc:

Any ideas as to whjat might cause this?

thanks,
wes

CompileC "build/FLTK Test.build/FLTK
Test.build/Objects-normal/ppc/main.o" main.cpp normal ppc c++
com.apple.compilers.gcc.3_3
    cd "/Users/na/Programming/FLTK Test"
    /usr/bin/gcc-3.3 -x c++ -arch ppc -pipe -Wno-trigraphs
-fasm-blocks -fpascal-strings -g -O0 -mtune=G4 -fmessage-length=0
-ffix-and-continue -fzero-link "-F/Users/na/Programming/FLTK
Test/build" "-I/Users/na/Programming/FLTK Test/build/include"
-I/sw/include "-I/Users/na/Programming/FLTK Test/build/FLTK
Test.build/FLTK Test.build/DerivedSources"
"-Wp,-header-mapfile,/Users/na/Programming/FLTK Test/build/FLTK
Test.build/FLTK Test.build/FLTK Test.hmap" -c
"/Users/na/Programming/FLTK Test/main.cpp" -o
"/Users/na/Programming/FLTK Test/build/FLTK Test.build/FLTK
Test.build/Objects-normal/ppc/main.o"
In file included from /usr/include/gcc/darwin/3.3/c++/bits/locale_facets.tcc:41,
                 from /usr/include/gcc/darwin/3.3/c++/locale:47,
                 from /usr/include/gcc/darwin/3.3/c++/bits/ostream.tcc:37,
                 from /usr/include/gcc/darwin/3.3/c++/ostream:515,
                 from /usr/include/gcc/darwin/3.3/c++/iterator:70,
                 from /sw/include/Magick++/STL.h:15,
                 from /sw/include/Magick++.h:11,
                 from /Users/na/Programming/FLTK Test/main.cpp:6:
/usr/include/gcc/darwin/3.3/c++/cmath: In function `float std::acos(float)':
/usr/include/gcc/darwin/3.3/c++/cmath:102: error: `::acos' undeclared
(first use here)
/usr/include/gcc/darwin/3.3/c++/cmath: At global scope:
/usr/include/gcc/darwin/3.3/c++/cmath:105: error: `acos' not declared
/usr/include/gcc/darwin/3.3/c++/cmath: In function `long double
std::acos(long double)':
/usr/include/gcc/darwin/3.3/c++/cmath:112: error: `long double
std::acos(long double)' used prior to declaration
/usr/include/gcc/darwin/3.3/c++/cmath:112: error: `::acos' undeclared
(first use here)
/usr/include/gcc/darwin/3.3/c++/cmath: At global scope:
/usr/include/gcc/darwin/3.3/c++/cmath:115: error: `asin' not declared

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

* Re: gcc 3.3 cmath undefined errors
  2005-05-18 20:39 gcc 3.3 cmath undefined errors Wesley Smith
@ 2005-05-18 23:39 ` Eljay Love-Jensen
  2005-05-18 23:45   ` Wesley Smith
  0 siblings, 1 reply; 7+ messages in thread
From: Eljay Love-Jensen @ 2005-05-18 23:39 UTC (permalink / raw)
  To: Wesley Smith, gcc-help

Hi Wesley,

I created this file
------------------------------
#include <iterator>
------------------------------

g++ -a wesley.cpp

No problems.  Running Darwin, using either GCC 3.3 (g++-3.3) or GCC 4.0 (g++-4.0).

Can you create a small source file that replicates the behavior, and post it to this forum?

>Any ideas as to whjat might cause this?

Not sure.  My first guess is:  bad code in main.cpp, Magick++.h, or Magick++/STL.h.

Thanks,
--Eljay

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

* Re: gcc 3.3 cmath undefined errors
  2005-05-18 23:39 ` Eljay Love-Jensen
@ 2005-05-18 23:45   ` Wesley Smith
  2005-05-18 23:53     ` Eljay Love-Jensen
  0 siblings, 1 reply; 7+ messages in thread
From: Wesley Smith @ 2005-05-18 23:45 UTC (permalink / raw)
  To: gcc-help

Hi Eljay,

thanks for the info.  I will try it out shortly and post code relating
the problem.  I have a question though about gcc -x c++/g++.  Are
these the same thing?  What's the difference?

thanks,
wes

On 5/18/05, Eljay Love-Jensen <eljay@adobe.com> wrote:
> Hi Wesley,
> 
> I created this file
> ------------------------------
> #include <iterator>
> ------------------------------
> 
> g++ -a wesley.cpp
> 
> No problems.  Running Darwin, using either GCC 3.3 (g++-3.3) or GCC 4.0 (g++-4.0).
> 
> Can you create a small source file that replicates the behavior, and post it to this forum?
> 
> >Any ideas as to whjat might cause this?
> 
> Not sure.  My first guess is:  bad code in main.cpp, Magick++.h, or Magick++/STL.h.
> 
> Thanks,
> --Eljay
> 
>

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

* Re: gcc 3.3 cmath undefined errors
  2005-05-18 23:45   ` Wesley Smith
@ 2005-05-18 23:53     ` Eljay Love-Jensen
  2005-05-19  4:01       ` Wesley Smith
  0 siblings, 1 reply; 7+ messages in thread
From: Eljay Love-Jensen @ 2005-05-18 23:53 UTC (permalink / raw)
  To: Wesley Smith, gcc-help

Hi Wes,

>I have a question though about gcc -x c++/g++.  Are these the same thing?  What's the difference?

They are not the same thing.

gcc executes the C toolchain, and puts in C flags, C defines and C libraries.

g++ executes the C++ toolchain, and puts in C++ flags, C++ defines, and C++ libraries.

What all the little fiddly bits are I'm not 100% sure.  Use the -v flag (verbose) to see what they produce for you on your system.

Careful use of gcc can make it behave identical to g++.  But why bother?  :-)

HTH,
--Eljay

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

* Re: gcc 3.3 cmath undefined errors
  2005-05-18 23:53     ` Eljay Love-Jensen
@ 2005-05-19  4:01       ` Wesley Smith
  2005-05-20  9:32         ` Nix
  0 siblings, 1 reply; 7+ messages in thread
From: Wesley Smith @ 2005-05-19  4:01 UTC (permalink / raw)
  To: gcc-help

Apparently, on OSX, gcc dynamically calls g++ or gcc depending on the
source file extension names.  In any case, I tried calling g++ from
the command line and got the same errors.  I'm using a library called
Imagemagick (thus the magick++).  Here's my code:

#include <Magick++.h> 
#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	Magick::Image image;
	image.read("/Users/na/Documents/IGERT/vcsel.gif" );
	
	return 0;
}


To use this, you must have Imagemagick installed (it can be finked). 
I've gotten no response from anyone on the Imagemagick lists about
this.  So, does anyone know of any good opensource image
processing/graphics libraries?

thanks,
wes


On 5/18/05, Eljay Love-Jensen <eljay@adobe.com> wrote:
> Hi Wes,
> 
> >I have a question though about gcc -x c++/g++.  Are these the same thing?  What's the difference?
> 
> They are not the same thing.
> 
> gcc executes the C toolchain, and puts in C flags, C defines and C libraries.
> 
> g++ executes the C++ toolchain, and puts in C++ flags, C++ defines, and C++ libraries.
> 
> What all the little fiddly bits are I'm not 100% sure.  Use the -v flag (verbose) to see what they produce for you on your system.
> 
> Careful use of gcc can make it behave identical to g++.  But why bother?  :-)
> 
> HTH,
> --Eljay
> 
>

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

* Re: gcc 3.3 cmath undefined errors
  2005-05-19  4:01       ` Wesley Smith
@ 2005-05-20  9:32         ` Nix
  2005-05-21 16:50           ` Wesley Smith
  0 siblings, 1 reply; 7+ messages in thread
From: Nix @ 2005-05-20  9:32 UTC (permalink / raw)
  To: Wesley Smith; +Cc: gcc-help

On 19 May 2005, Wesley Smith prattled cheerily:
> Apparently, on OSX, gcc dynamically calls g++ or gcc depending on the
> source file extension names.  In any case, I tried calling g++ from
> the command line and got the same errors.  I'm using a library called
> Imagemagick (thus the magick++).  Here's my code:
> 
> #include <Magick++.h> 
> #include <iostream>
> 
> using namespace std;
> 
> int main(int argc, char **argv)
> {
> 	Magick::Image image;
> 	image.read("/Users/na/Documents/IGERT/vcsel.gif" );
> 	
> 	return 0;
> }

This works flawlessly with ImageMagick-6.2.1 on Linux.

What version of ImageMagick do you have? Some (distinctly aged) versions
of Magick++ had problems with namespace std :(

-- 
`End users are just test loads for verifying that the system works, kind of
 like resistors in an electrical circuit.' - Kaz Kylheku in c.o.l.d.s

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

* Re: gcc 3.3 cmath undefined errors
  2005-05-20  9:32         ` Nix
@ 2005-05-21 16:50           ` Wesley Smith
  0 siblings, 0 replies; 7+ messages in thread
From: Wesley Smith @ 2005-05-21 16:50 UTC (permalink / raw)
  To: gcc-help

I have the most recent stable release of Imagemagick.  I managed to
get it to compile finally with some help from one of the authors.  I
unsitalled Imagemagick and installed Graphicsmagick (basically the
same thing).  Instead of using xcode which does some ridiculous things
with compiler options and wouldn't let me do what I need to do, I
compiled from the terminal with:

c++ -o main main.cpp `GraphicsMagick++-config --cppflags --cxxflags
--ldflags --libs`

the last part is a script installed with Graphicsmagick that sets the
proper flags settings from easy compilation.  This worked.  I stil
haven't figured out a way to get Xcode to do this, and I think I'm
going to give up and just do a makefile.  Fie on thee Apple!  Now to
get it to work with FLTK.

wes

On 5/20/05, Nix <nix@esperi.org.uk> wrote:
> On 19 May 2005, Wesley Smith prattled cheerily:
> > Apparently, on OSX, gcc dynamically calls g++ or gcc depending on the
> > source file extension names.  In any case, I tried calling g++ from
> > the command line and got the same errors.  I'm using a library called
> > Imagemagick (thus the magick++).  Here's my code:
> >
> > #include <Magick++.h>
> > #include <iostream>
> >
> > using namespace std;
> >
> > int main(int argc, char **argv)
> > {
> >       Magick::Image image;
> >       image.read("/Users/na/Documents/IGERT/vcsel.gif" );
> >
> >       return 0;
> > }
> 
> This works flawlessly with ImageMagick-6.2.1 on Linux.
> 
> What version of ImageMagick do you have? Some (distinctly aged) versions
> of Magick++ had problems with namespace std :(
> 
> --
> `End users are just test loads for verifying that the system works, kind of
>  like resistors in an electrical circuit.' - Kaz Kylheku in c.o.l.d.s
>

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

end of thread, other threads:[~2005-05-21 16:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-18 20:39 gcc 3.3 cmath undefined errors Wesley Smith
2005-05-18 23:39 ` Eljay Love-Jensen
2005-05-18 23:45   ` Wesley Smith
2005-05-18 23:53     ` Eljay Love-Jensen
2005-05-19  4:01       ` Wesley Smith
2005-05-20  9:32         ` Nix
2005-05-21 16:50           ` Wesley Smith

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).