Link error - undefined standard functions using CW7.2 under OS 9.2

Link error - undefined standard functions using CW7.2 under OS 9.2

Post by Jimmy Isaacso » Thu, 21 Mar 2002 23:59:33



Can somebody help?

  I'm running CW7.2 under OS 9.2 on my G4. When I use the precompiled
headers, MacHeadersPPC, the program compiles; but I get link errors saying
that my standard math routines (log10(), atan(),...) and i/o routines
(sscanf(), atol(), atof(),...) and string functions ( strcmp(),
strstr(),...) are undefined.

  If I skip the precompiled headers and use MacHeaders.h instead, the
program compiles and links with no errors.

  Why can't I use the precompiled headers? In both cases the library,
MSL_All_PPC.Lib, is at the end of the link order. And the problem occurs no
matter where I put the library in the link order.

  Thanks,
  Jimmy

 
 
 

Link error - undefined standard functions using CW7.2 under OS 9.2

Post by MW Ro » Fri, 22 Mar 2002 00:21:19




Quote:>Can somebody help?

>  I'm running CW7.2 under OS 9.2 on my G4. When I use the precompiled
>headers, MacHeadersPPC, the program compiles; but I get link errors saying
>that my standard math routines (log10(), atan(),...) and i/o routines
>(sscanf(), atol(), atof(),...) and string functions ( strcmp(),
>strstr(),...) are undefined.

>  If I skip the precompiled headers and use MacHeaders.h instead, the
>program compiles and links with no errors.

You are probably using the wrong precompiled header.  The one with the
++ in it is for C++.  If you are mixing them using the C++ precompiled
header for C or using the C precompiled header for C++ it could mess
things up.  

Are you mixing C and C++ source files?

Other than that I'd have to know more information.  

Quote:>  Why can't I use the precompiled headers? In both cases the library,
>MSL_All_PPC.Lib, is at the end of the link order. And the problem occurs no
>matter where I put the library in the link order.

It is name mangling, if you precompile something as C++ it mangles the
names then if you link it it searches for these.

Ron

--
       TOP PICK   HandHeld Computing - issue 4.5
   "The best overall development tool for the Palm OS"

 Metrowerks, maker of CodeWarrior  -  "Software Starts Here"  


 
 
 

Link error - undefined standard functions using CW7.2 under OS 9.2

Post by Jimmy Isaacso » Fri, 22 Mar 2002 01:47:19






>> Can somebody help?

>> I'm running CW7.2 under OS 9.2 on my G4. When I use the precompiled
>> headers, MacHeadersPPC, the program compiles; but I get link errors saying
>> that my standard math routines (log10(), atan(),...) and i/o routines
>> (sscanf(), atol(), atof(),...) and string functions ( strcmp(),
>> strstr(),...) are undefined.

>> If I skip the precompiled headers and use MacHeaders.h instead, the
>> program compiles and links with no errors.

> You are probably using the wrong precompiled header.  The one with the
> ++ in it is for C++.  If you are mixing them using the C++ precompiled
> header for C or using the C precompiled header for C++ it could mess
> things up.  

> Are you mixing C and C++ source files?

> Other than that I'd have to know more information.

>> Why can't I use the precompiled headers? In both cases the library,
>> MSL_All_PPC.Lib, is at the end of the link order. And the problem occurs no
>> matter where I put the library in the link order.

> It is name mangling, if you precompile something as C++ it mangles the
> names then if you link it it searches for these.

> Ron

 Thanks! Using MacHeadersPPC++ works.

  Jimmy

 
 
 

1. Link error: undefined 'function name (code)' referenced from...

Hi,

    I'm haveing a problem w/ a link err.  first off i'm only a 2nd year
programmer mostly familiar w/ vi and gcc so codewarrior is kinda
daunting.

    my friend wrote a memory tester from the dos command line and its
100% ansi compliant.  well after learning the hard way to increas heap
size to 32000k to make it test 32MB's or ram i got the command line
ported (easily aside the heap problem).

    so now i'm writing the mac gui version and renamed it from  "int
main( arg...)" to "void test_mem( int amoun_to_test )" and took out the
printf's.  but when i compile i get the err

Link error: undefined test_mem( code )
referenced from 'HandleFileChoice in MemMenu.c

the functions are obviously in two diff files in the project.  not much
else i can think of.  i've changed the link order but other than this
i'm pretty lost on the problem.

thanks for any help!

--
Take Care and Later
-Andrew CJ Krakowski

Enjoy the Filth
http://members.nbci.com/lsdforest/index.html

If you're to be
The roaming eye, then
Pry it open and let me tell you why it sees
The harsh realities
       -ween

2. realtime speech on TI C6701

3. CW7.2 and MacOSX 10.1.3: undefined symbol errors

4. Win2k Nbf Binding Problem, Help please

5. HP 5370c Mac OS 9.2 Driver?

6. load balancing in MPI

7. Nikon 3.1 Scanning Software and Mac OS 9.2

8. Neutrino on Compaq Proliant ML570

9. SprintScan 4000 os 9.2 probs

10. OS 9.1/9.2

11. How can I use MSN Mensenger with MAC OS 9.2

12. link error on new and delete in CW7

13. CW7 - MSL <locale> link error