[DONE] /SUBS: not working

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

[DONE] /SUBS: not working

Post by Mistrel »

I get this error when attempting to compile this to a Tailbite library with threadsafe enabled using the PureGDKThreadSafe subsystem:

Code: Select all

---------------------------
TailBite Error
---------------------------
PBCompiler:  /COMMENTED /DEBUGGER
******************************************
PureBasic 4.10 (Windows - x86)
******************************************
Warning: can't load the '' subsystem
Compiling D:\ \Projects\Pure Basic\PureGDK\Plugins\Compile Plugins\Lib-P_2DPluginKit.pb
Loading external libraries...
Starting compilation...
Error: Line 2 - Invalid name: same As an external command.

The pipe has been ended.

---------------------------
OK   
---------------------------
Here is the code:

Code: Select all

PrototypeC Protop2dStart2DPlugKit(Username, UserCode)
ProcedureDLL p2dStart2DPlugKit(Username.s, UserCode.s)
	Static Ptr
	If Not GDKLoadPtr(@Ptr,"2DPluginKIT.dll","Init2DPlugKIT")
		ProcedureReturn 0
	EndIf
	If Not GDKDebuggerPresent()
		Function.Protop2dStart2DPlugKit=Ptr
		Result=Function(@Username.s, @UserCode.s)
		GDKCheckRuntimeError()
		ProcedureReturn Result
	EndIf
	ProcedureReturn GDKMsgLong(Ptr, #Long, 2, 6, @Username.s, @UserCode.s)
EndProcedure
The subsystem's folder structure is PureBasic\Subsystems\PureGDKThreadSafe\PureLibraries

Tailbite also erroneously creates a "PureGDKThreadSafe" folder in my PureBasic installation directory for some reason.

I am compiling from the command line using /SUBS:PureGDKThreadSafe. This problem only occurs when compiling with the /SUBS: command line option.

You'll need the PureGDK framework library to compile. I've included the threadsafe and non-threadsafe compiled Tailbite libraries:
http://puregdk.com/files/Lib_GDKPlugin.zip
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

You have to supply the complete subsystem path beginning from Subsystems (like the help says) :

Code: Select all

C:\Programme\TailBite>tailbite "D:\Backup\test\Mistrel_Test2.pb" /KEEPSRCFILES /WRITEBATCH /THRD /SUBS:Subsystems\UserLibThreadSafe\PureLibraries\UserLibraries\
or in your case :

Code: Select all

C:\Programme\TailBite>tailbite "D:\Backup\test\Mistrel_Test2.pb" /KEEPSRCFILES /WRITEBATCH /THRD /SUBS:Subsystems\PureGDKThreadSafe\PureLibraries\UserLibraries\
Edit : A check is added (for the next version)
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Thank you for clarifying.

What is /WRITEBATCH? I only see /WRIT in the documentation.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

Mistrel wrote:What is /WRITEBATCH? I only see /WRIT in the documentation.
/WRITE is the short form of /WRITEBATCH (less typing needed)
/WRITebatch

Generate build batch file: TailBite will generate a batch file in the library source folder to allow fast rebuilding which, anyway, you can do more easyly with TailBite itself (processing the .Desc file).
in case of your example, the batch file would look like this :

Code: Select all

@echo OFF

"C:\Programme\PureBasic420\Compilers\FAsm.exe" "Functions\p2dStart2DPlugKit.asm" "Functions\p2dStart2DPlugKit.obj"
"C:\Programme\PureBasic420\Compilers\FAsm.exe" "Functions\Mistrel_Test2_Init.asm" "Functions\Mistrel_Test2_Init.obj"
"C:\Programme\PureBasic420\Compilers\FAsm.exe" "Functions\Mistrel_Test2Shared.asm" "Functions\Mistrel_Test2Shared.obj"
"C:\Programme\PureBasic420\Compilers\FAsm.exe" "Functions\Shared\Mistrel_Test2_End.asm" "Functions\Shared\Mistrel_Test2_End.obj"

"C:\Programme\PureBasic420\Compilers\polib.exe" /out:"Mistrel_Test2.lib" @"Mistrel_Test2ObjFiles.txt"
Del "Functions\*.obj"
Del "Functions\Shared\*.obj"
"C:\Programme\PureBasic420\Library SDK\LibraryMaker.exe" "Mistrel_Test2.Desc" /TO "C:\Programme\PureBasic420\Subsystems\UserLibThreadSafe\PureLibraries\UserLibraries" /COMPRESSED /NOUNICODEWARNING
REM Del "Mistrel_Test2.lib"
ECHO Done
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Actually, the problem is something else entirely.

I have source files prefixed with "Lib-P_" to identify that they are to be compiled as libraries and that they are plugin libraries.

I also have files prefixed with just "Lib-".

When Tailbite compiles these files it converts the " - " character to a " _ ". I compile the plugin using /OUTP to compile one in "PureBasic\PureLibraries\UserLibraries" and the other in "PureBasic\SubSystems\PureGDKThreadSafe\PureLibraries".

When I specify /SUBS: and output to a subsystem for the filename "Lib-P_Test.pb" Tailbite does not understand that "Lib_P_Test" already exists in "PureBasic\PureLibraries\UserLibraries" because it erroneously compares it with "Lib-P_Test".
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

fixed for next version.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

This problem still exists. Files will compile fine prefixed with "Lib_" but will error "Invalid name: same as an external command" when using "Lib-" instead.
Last edited by Mistrel on Tue May 06, 2008 8:22 pm, edited 1 time in total.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Libnames have the same limitations as functions.
You can't use a filename with - for a lib!
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
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

ts-soft wrote:Libnames have the same limitations as functions.
You can't use a filename with - for a lib!
The problem here is that Tailbite is not correcting the ' - ' to ' _ ' when compiling with a subsystem.

I should be able to name my source files whatever I like so long as the final library name does not have any ' - ' in it.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

in this case, IMHO tailbite should give a errorbox but not correct automatic.
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