PureBasic 3.91 for Windows released

Developed or developing a new product in PureBasic? Tell the world about it.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

True, I will update the web site today :)
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post 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. :mrgreen:
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....

Image
SPAMINATOR NR.1
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post 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. :)
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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!!)

Code: Select all

#pragma optimize(0)
Otherwise you might encounter some Linker errors or crashes with PoLink.

Timo
quidquid Latine dictum sit altum videtur
venom
User
User
Posts: 56
Joined: Fri Jul 25, 2003 1:54 pm
Location: Australia

Post by venom »

What about MSVC?
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

venom wrote:What about MSVC?
You can create purelibraries with MSVC for a long time now, just create the appropriate .desc file.
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

i have tried MSVC 6 but get
POLINK: error: Uresolved external symbol '__fltused' :x
any tips on making it work?

thanks for the tip freak. :)
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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
quidquid Latine dictum sit altum videtur
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post 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 :?
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post 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
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post 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. :D
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post 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.
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post 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?
:?
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post 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.
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post 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. :D
Post Reply