Page 2 of 3
Posted: Tue Jul 06, 2004 9:16 am
by Fred
True, I will update the web site today

Posted: Tue Jul 06, 2004 10:32 am
by Rings
jack wrote:for writing libs:
what version of PellesC is recommended ?
will lcc still work ? (i seem to recolect a mention to use Ansi-C)?
any other compilers that are known to produce libs that work with PB 3.91 ?
the latest version (2.80) of PellesC wont allow stdcall, and i get a lot
of polink errors when trying to use a lib compiled with it.
how about any Pascal compilers?
any help is much appreciated.

thats not true, see option in Pelles 2.8
for the PoLink errors i have also to investigate more time,
PoLink 2.74 compiles fine....

Posted: Tue Jul 06, 2004 11:32 am
by jack
@Rings
i know there's an option for _stdcall, but even when i have it selected
and my procedures start with "extern int _stdcall" the compiler
warns that said function can not be compiled as _stdcall and that
it will automatically compile as _cdecl.
btw, it worked with ver. 2.74.
but whereas the lib compiled with ver. 2.74 worked just fine with PB 3.91 Alpha 1,
it gives polink errors in PB 3.91 final, that's why i was asking about what
version of PellesC to use.
thanks for the response though.

Posted: Tue Jul 06, 2004 12:58 pm
by freak
Lcc can still be used to create PureLibraries. You only have to make sure
that all Lcc specific optimisations are disabled. You can simply put this
at the start of your file (before including any headers!!)
Otherwise you might encounter some Linker errors or crashes with PoLink.
Timo
Posted: Tue Jul 06, 2004 4:16 pm
by venom
What about MSVC?
Posted: Tue Jul 06, 2004 7:19 pm
by KarLKoX
venom wrote:What about MSVC?
You can create purelibraries with MSVC for a long time now, just create the appropriate .desc file.
Posted: Wed Jul 07, 2004 2:37 am
by jack
i have tried MSVC 6 but get
POLINK: error: Uresolved external symbol '__fltused'
any tips on making it work?
thanks for the tip freak.

Posted: Wed Jul 07, 2004 3:29 am
by freak
Try also to disable any optimasations by the compiler, maybe this helps.
If that's not it, then i don't know.
Timo
Posted: Wed Jul 07, 2004 12:10 pm
by jack
i found out that if you check "Enable Microsoft Extentions" then the compiler will compile 'stdcall' functions just fine.
am still geting Polink errors though

Posted: Wed Jul 07, 2004 6:33 pm
by KarLKoX
Here is the workaround i use :
Code: Select all
#define PUREBASIC_3_91
#if defined PUREBASIC_3_91
#ifdef __cplusplus
extern "C" {
#endif
int __mb_cur_max;
unsigned short* _pctype;
int errno;
char _fltused;
#ifdef __cplusplus
}
#endif
#endif
Posted: Thu Jul 08, 2004 11:56 am
by jack
thanks very much KarLKoX, that does indeed work, (after commenting the line: int errno)
would you or anyone be so kind and explain what your workaround does?
what is "_fltused" ?
why did Polink (while compiling a PB program) complain about it ?
thanks in advance.

Posted: Thu Jul 08, 2004 3:21 pm
by KarLKoX
fltused is a crappy hack from m$ to let the compiler to use the FPU or not.
It was usefull for 386/486 when you can have a FPU (dx) or not (SX) but it is useless now, not for M$.
Polink complain because he found an unresolved symbol, msvc compiler add the fltused object when linking.
Posted: Thu Jul 08, 2004 7:02 pm
by jack
thanks KarLKoX.
compiling a lib with PellesC 2.80 and then trying to compile a PB program i get the following errors:
POLINK: error: Unresolved external symbol '___stod'
POLINK: error: Unresolved external symbol '___ftoll'
POLINK: error: Unresolved external symbol '___sinh'
POLINK: error: Unresolved external symbol '___cosh'
POLINK: error: Unresolved external symbol '___log'
POLINK: error: Unresolved external symbol '___sin'
POLINK: error: Unresolved external symbol '_lgamma'
POLINK: error: Unresolved external symbol '_round'
POLINK: error: Unresolved external symbol '___fpclass'
the PellesC documentation states that math functions are inlined for speed,
could that be a problem? i mean, are symbols like the above somehow eliminated and are therefore causing Polink to choke?

Posted: Fri Jul 09, 2004 4:05 am
by KarLKoX
I can't help you here as i never compiled a lib from PellesC (until now).
Perhaps you didn't include <stdlib.h>, it is where they are declared.
Posted: Sat Jul 10, 2004 11:30 am
by Psychophanta
Even i bring up a little late, thanks you a lot for all to you Fred, and to all other people in this forum.
