Article View: comp.sys.mac.programmer.codewarrior
Article #935Re: MACOSX CODEWARRIOR8 and cosf, sinf, tanf, sqrtf, etc
From: MW Ron
Date: Thu, 10 Oct 2002 19:44
Date: Thu, 10 Oct 2002 19:44
50 lines
2645 bytes
2645 bytes
In article <r6jbquknfi7ictbckllvqk0itsub5dum84@4ax.com>,
News Reader <nntp@r.us> wrote:
>On Wed, 9 Oct 2002 18:00:13 -0700, Derek Ledbetter
><derekledbetter@mindspring.com> wrote:
>
>>On Wed, 9 Oct 2002 17:11:20 -0700, News Reader wrote
>>(in message <s7h9qusl2tjo42e3egbblef5c8flaqjo28@4ax.com>):
>>
>>> What must I do to be able to use cosf, sinf, tanf, etc in Codewarrior8
>>> on MacOSX for a MacOSX target? Am I missing a define somewhere?
>>>
>>> I tried this:
>>>
>>> test.cpp:
>>> #include <cmath>
>>> void test()
>>> {
>>> cosf(0.32342f);
>>> }
>>>
>>>
>>> In the project settings, I have the standard /usr/include path, the
>>> MSL dir, and the MacOSX support dir.
>>>
>>> It says it can't find cosf, but doing a search in MSL's cmath header
>>> file, I see it there...
>>
>>Since you included <cmath> instead of <math.h>, cosf is in the std
>>namespace.
>
>As well, I tried just including <math.h> and it still says can't find
>'cosf'.
BSD C doesn't have the cosf() function, you probably will have to
cos() instead.
However I tried this with MSL recrusive last in the access paths using
#include <cmath> and std::cosf and that compiled and linked without any
errors.
Ron
--
Do what you do best and let Metrowerks do the rest !!
http://www.metrowerks.com/MW/Services/SSG/default.htm
Metrowerks, maker of CodeWarrior - "Software Starts Here"
Ron Liechty - MWRon@metrowerks.com - http://www.metrowerks.com
Technical Details
Message-ID:
<mwron-D72615.15440510102002@enews.newsguy.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!pln-e!spln!dex!extra.newsguy.com!newsp.newsguy.com!mwronReferences:
<s7h9qusl2tjo42e3egbblef5c8flaqjo28@4ax.com> <0001HW.B9CA1F2D02E8A14AF0284600@news.mindspring.com> <r6jbquknfi7ictbckllvqk0itsub5dum84@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bcce,42d92dc96528dba3
X-Google-Attributes: gid10bcce,public
X-Google-Thread: f635e,42d92dc96528dba3
X-Google-Attributes: gidf635e,public
X-Google-ArrivalTime: 2002-10-10 13:05:29 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!pln-e!spln!dex!extra.newsguy.com!newsp.newsguy.com!mwron
From: MW Ron <mwron@metrowerks.com>
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac
Subject: Re: MACOSX CODEWARRIOR8 and cosf, sinf, tanf, sqrtf, etc
Date: Thu, 10 Oct 2002 15:44:05 -0400
Organization: Metrowerks
Lines: 50
Message-ID: <mwron-D72615.15440510102002@enews.newsguy.com>
References: <s7h9qusl2tjo42e3egbblef5c8flaqjo28@4ax.com> <0001HW.B9CA1F2D02E8A14AF0284600@news.mindspring.com> <r6jbquknfi7ictbckllvqk0itsub5dum84@4ax.com>
NNTP-Posting-Host: p-409.newsdawg.com
User-Agent: MT-NewsWatcher/3.2 (PPC Mac OS X)
X-Face: )mY~XFHLw)UOW!W#[Ljvxq6Ja7(g'#F0-g*&puNxR8hEJkd@Oue/70^.)I78\
(%a%&Id211u"l/t.llWo/M|?15XUlx9!IGkdWiEmcasiyg"k;Q9[~XuE+`t2"*n(>nmm
@L/q,TjMd5+H{gASEPDR^$