Page 1 of 1

PB backend-C no more compatible with Tailbite?

Posted: Tue Mar 01, 2022 5:29 pm
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

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

Posted: Tue Mar 08, 2022 4:38 pm
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

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

Posted: Thu Mar 10, 2022 3:12 am
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

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

Posted: Thu Mar 10, 2022 10:01 pm
by morosh
Thank you both
yes I'll try idle method

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

Posted: Fri Mar 11, 2022 12:51 am
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.

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

Posted: Tue Jun 07, 2022 2:17 pm
by Justin
For anyone interested this might be a solution:
https://www.purebasic.fr/english/viewtopic.php?t=79286

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

Posted: Mon Jun 20, 2022 1:34 am
by idle
Automated tool to create static lib for windows, note static lib produced is only valid for use with PB as it relies on you main program to initialize the the PB objects and link in the runtime.
https://www.purebasic.fr/english/viewtopic.php?t=79332