linker error on creation x64 Unicode Shared Library

Linux specific forum
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

linker error on creation x64 Unicode Shared Library

Post by ts-soft »

PureBasic - Linker error wrote:/usr/bin/ld: /home/thomas/purebasic/compilers/unicodefunctions.a(wcsdub.o):relocation R_X86_64_PC32 against undefined symbol 'malloc@@GLICC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld gab 1 als Ende-Statur zurück.
The same codes compile fine on x86 linux or on windows (x86 or x64).
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: [4.61] linker error on creation x64 Unicode Shared Libra

Post by ts-soft »

Source can you found in this package: http://www.realsource.de/index.php/down ... packer-sdk
Subdirectory lib, the file: zBin_UnpackDLL.pb
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Grunz
User
User
Posts: 59
Joined: Sat Nov 12, 2011 7:21 pm

Re: [4.61] linker error on creation x64 Unicode Shared Libra

Post by Grunz »

I CAN compile this file with pbcompiler -u zBin_UnpackDLL.pb.
I am using Ubuntu 64 (11.10) .

What is this program supposed to do? Does nothing visible for me...

Are you actually able to make PB use unicode strings?
For me , I can compile programs with -u flag, but that only makes Print() produce garbage and DrawText() still only can do latin1.

edit:
I take that back.. does all work!
BUT only if the file has those control codes as first bytes...
User avatar
idle
Always Here
Always Here
Posts: 5844
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: [4.61] linker error on creation x64 Unicode Shared Libra

Post by idle »

@Grunz
Are you sure you set the compiler option for the zBin_UnpackDLL.pb to that of shared object?
It will compile as an executable no problem but it won't compile as a shared object no matter what you do
The problem is with the wcsdub function in PB's unicode string lib, which hasn't been compiled with the -fPIC flag
without it the object can only be used in an executable or linked statically.
Windows 11, Manjaro, Raspberry Pi OS
Image
Grunz
User
User
Posts: 59
Joined: Sat Nov 12, 2011 7:21 pm

Re: [4.61] linker error on creation x64 Unicode Shared Libra

Post by Grunz »

Yes, you are correct. I get the same error if I try with -so .
And I also have to add: unicode does NOT work properly.
Only short programs do.
For my project I get:

Code: Select all

88723 lines processed.
Creating the executable.
Segmentation fault
Error: Assembler
Possibly the same problem that requires me to compile with debugger on to make it work.
Grunz
User
User
Posts: 59
Joined: Sat Nov 12, 2011 7:21 pm

Re: [4.61] linker error on creation x64 Unicode Shared Libra

Post by Grunz »

Alternatively it may also produce this:

Code: Select all

 Fatal error in __driConfigOptions line 1, column 0: unknown encoding.

[Debugger Error]  Program aborted. (by external library)
[Debugger Error]  File: ulaby.pb (Line: 2713)
line 2713:

Code: Select all

If Not OpenWindowedScreen(WindowID(0), 0, 0, 640, 480, #True, 0, 0, #PB_Screen_WaitSynchronization)
No surprise here..
Still strange, that the same code does work if only program is shorter or something else is different, whatever that is.
Program won't run if not compiled with debugger on either, so might be a correlated problems.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: [4.61] linker error on creation x64 Unicode Shared Libra

Post by ts-soft »

The error is still in PB 5.00 :x
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Post Reply