PB backend-C no more compatible with Tailbite?

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

morosh
Enthusiast
Enthusiast
Posts: 245
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

PB backend-C no more compatible with Tailbite?

Post by morosh »

Hello:
I made a personal lib, and compiled it with TailBite, everything was OK until recently, when I choose backend-C as compiler, I got error on every line including a procedure of my lib: error: Unresolved external symbol...., POLINK error: Unresolved external symbol....etc

is this normal? is there any trick to resolve it?

Thank you
PureBasic: Surprisingly simple, diabolically powerful
User avatar
fsw
Addict
Addict
Posts: 1551
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Re: PB backend-C no more compatible with Tailbite?

Post by fsw »

Tailbite is not an official tool, and cannot be used to create a static lib for a C compiler.

I didn't use Tailbite for the last decade or so, but (as far as I remember) Tailbite creates a file that has ASM style symbols which are not compatible with C style symbols.

What would need to be done is to intercept gcc calls and implement the creation of static libs for later use.
You can take a look at Idle's code: include c headers and modify compiler flags with inline c
Idle's intention differs from yours, but the approach would be the same.

Of course it would be even better if Fred & Co. would implement the creation of static libs right into the PB compiler functionality... :P

I am to provide the public with beneficial shocks.
Alfred Hitshock
User avatar
idle
Addict
Addict
Posts: 3880
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: PB backend-C no more compatible with Tailbite?

Post by idle »

Rather than making a static lib we could do the same as a precompiled object there's really no difference
https://www.purebasic.fr/english/viewto ... 40#p581840
morosh
Enthusiast
Enthusiast
Posts: 245
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

Re: PB backend-C no more compatible with Tailbite?

Post by morosh »

Thank you both
yes I'll try idle method
PureBasic: Surprisingly simple, diabolically powerful
User avatar
idle
Addict
Addict
Posts: 3880
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: PB backend-C no more compatible with Tailbite?

Post by idle »

I haven't automated the making the objects yet but you can experiment, I only did it on the PI so far, windows is more tricky than linux..
I will try and get the tool working but like I said it needs some discussion as it's not cut and dry there will be linking issues to resolve with the precompiled object stategy.
Post Reply