RE: ARM static lib

2005-01-07 Thread Chris Apers
Oops forgot to write that with the extern stuff it works 

-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] De la part de Chris Apers
Envoyé : vendredi 7 janvier 2005 10:02
À : Palm Developer Forum
Objet : RE: ARM static lib

No, I'm compiling the lib as C to use with C code

-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] De la part de Ben Combee
Envoyé : jeudi 6 janvier 2005 00:38
À : Palm Developer Forum
Objet : Re: ARM static lib

At 02:19 PM 1/5/2005, you wrote:
>Hi,
>
>I'm trying to compile an ARM static library (fdlibm), but if i don't check
>the force C++ compilation box
>the function within are not found when i try to use this lib in a project.
>
>Is this normal ? any config i missed ?

ARM name mangling... if you compiled the library as C code, not C++ code, 
then the prototypes for calling the library from your C++ code need to be 
surrounded by an

extern "C" {
}

block to tell the compiler that these are C functions.


-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


RE: ARM static lib

2005-01-07 Thread Chris Apers
No, I'm compiling the lib as C to use with C code

-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] De la part de Ben Combee
Envoyé : jeudi 6 janvier 2005 00:38
À : Palm Developer Forum
Objet : Re: ARM static lib

At 02:19 PM 1/5/2005, you wrote:
>Hi,
>
>I'm trying to compile an ARM static library (fdlibm), but if i don't check
>the force C++ compilation box
>the function within are not found when i try to use this lib in a project.
>
>Is this normal ? any config i missed ?

ARM name mangling... if you compiled the library as C code, not C++ code, 
then the prototypes for calling the library from your C++ code need to be 
surrounded by an

extern "C" {
}

block to tell the compiler that these are C functions.


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


Re: ARM static lib

2005-01-05 Thread Logan Shaw
Ben Combee wrote:
> At 02:19 PM 1/5/2005, you wrote:

>> I'm trying to compile an ARM static library (fdlibm), but if i don't
>> check
>> the force C++ compilation box
>> the function within are not found when i try to use this lib in a
>> project.
>>
>> Is this normal ? any config i missed ?
> 
> 
> ARM name mangling... if you compiled the library as C code, not C++
> code, then the prototypes for calling the library from your C++ code
> need to be surrounded by an
> 
>extern "C" {
>}
> 
> block to tell the compiler that these are C functions.

... and a common way to do this is to have one .h file that contains
all your C-style stuff in it, and #include that .h file from both
C (library implementation) and C++ code (client) code.  The way
you accomplish this is to put

#ifdef __cplusplus
extern "C" {
#endif

before all your function prototypes, and put

#ifdef __cplusplus
}  // extern "C"
#endif

after the prototypes.

Then, when building your library as C source, the compiler sees
no "extern" or anything, but when using the .h file from C++, the
prototypes are surrounded with the appropriate stuff.

  - Logan

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


Re: ARM static lib

2005-01-05 Thread Ben Combee
At 02:19 PM 1/5/2005, you wrote:
Hi,
I'm trying to compile an ARM static library (fdlibm), but if i don't check
the force C++ compilation box
the function within are not found when i try to use this lib in a project.
Is this normal ? any config i missed ?
ARM name mangling... if you compiled the library as C code, not C++ code, 
then the prototypes for calling the library from your C++ code need to be 
surrounded by an

   extern "C" {
   }
block to tell the compiler that these are C functions.
-- Ben Combee, Technical Lead, Developer Services, PalmSource, Inc.
   "Combee on Palm OS" weblog: http://palmos.combee.net/
   Developer Forum Archives:   http://news.palmos.com/read/all_forums/

--
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


Re: ARM static lib

2005-01-05 Thread Henk Jonas
I guess the naming of the functions inside the object files and the 
library are different between of C++ and C. There must be soem tools 
which show you the exported names in the object and the library.

Regards
Henk
Chris Apers wrote:
Hi,
I'm trying to compile an ARM static library (fdlibm), but if i don't check
the force C++ compilation box
the function within are not found when i try to use this lib in a project.
Is this normal ? any config i missed ?
thanks alot
Chris

--
-
  Henk Jonas
  Palm OS ® certified developer
  [EMAIL PROTECTED]   www.metaviewsoft.de
-
--
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/