Page 1 of 1

[DONE] /SUBS: not working

Posted: Wed Apr 23, 2008 1:57 am
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

Posted: Wed Apr 23, 2008 5:57 pm
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)

Posted: Wed Apr 23, 2008 6:59 pm
by Mistrel
Thank you for clarifying.

What is /WRITEBATCH? I only see /WRIT in the documentation.

Posted: Wed Apr 23, 2008 7:31 pm
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

Posted: Wed Apr 23, 2008 9:43 pm
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".

Posted: Wed Apr 23, 2008 11:01 pm
by ABBKlaus
fixed for next version.

Posted: Tue May 06, 2008 7:42 pm
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.

Posted: Tue May 06, 2008 7:51 pm
by ts-soft
Libnames have the same limitations as functions.
You can't use a filename with - for a lib!

Posted: Tue May 06, 2008 7:53 pm
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.

Posted: Tue May 06, 2008 8:00 pm
by ts-soft
in this case, IMHO tailbite should give a errorbox but not correct automatic.