Thread View: comp.sys.mac.programmer.codewarrior
6 messages
6 total messages
Started by News Reader
Thu, 10 Oct 2002 00:11
MACOSX CODEWARRIOR8 and cosf, sinf, tanf, sqrtf, etc
Author: News Reader
Date: Thu, 10 Oct 2002 00:11
Date: Thu, 10 Oct 2002 00:11
18 lines
1428 bytes
1428 bytes
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...
Re: MACOSX CODEWARRIOR8 and cosf, sinf, tanf, sqrtf, etc
Author: Derek Ledbetter
Date: Thu, 10 Oct 2002 01:00
Date: Thu, 10 Oct 2002 01:00
29 lines
2025 bytes
2025 bytes
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.
--
Derek Ledbetter
derekledbetter@mindspring.com
"Life's short and hard like a body-building elf."
Re: MACOSX CODEWARRIOR8 and cosf, sinf, tanf, sqrtf, etc
Author: News Reader
Date: Thu, 10 Oct 2002 18:53
Date: Thu, 10 Oct 2002 18:53
34 lines
2012 bytes
2012 bytes
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.
It doesn't work. I put std::cosf and it says it doesn't recognize
std.
I even put using namespace std;
Same problem...
Re: MACOSX CODEWARRIOR8 and cosf, sinf, tanf, sqrtf, etc
Author: News Reader
Date: Thu, 10 Oct 2002 18:57
Date: Thu, 10 Oct 2002 18:57
32 lines
2000 bytes
2000 bytes
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'.
Am I missing a define somewhere?
Re: MACOSX CODEWARRIOR8 and cosf, sinf, tanf, sqrtf, etc
Author: 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
Re: MACOSX CODEWARRIOR8 and cosf, sinf, tanf, sqrtf, etc
Author: Howard Hinnant
Date: Thu, 10 Oct 2002 20:08
Date: Thu, 10 Oct 2002 20:08
44 lines
2916 bytes
2916 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'.
|
| Am I missing a define somewhere?
There are two possible C libs you can use: BSD C or MSL C. Only MSL C
has std::cosf and neither have ::cosf. The easiest way to use MSL C is
to start with the Pro 8 stationary. It sets MSLCarbonPrefix.h as your
prefix file, arranges the paths just so, and links to the correct libs.
--
Howard Hinnant
Metrowerks
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads