No Command(0) for dynamic lib ?

General FreeBASIC programming questions.
Post Reply
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

No Command(0) for dynamic lib ?

Post by D.J.Peters »

Since Command(0) does not return the dynamic lib name "libMyPlugin.so" or "MyPlugin.dll" ?

I'm sure years ago (V ~0.15)
fbc -dll MyPlugin.bas
command(0) returned the name of the library.
(or it was only a dream)

Joshy
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: No Command(0) for dynamic lib ?

Post by MrSwiss »

@Joshy

I, personally, don't go back longer than Ver. 0.24.0 but:
D.J.Peters wrote:fbc -dll MyPlugin.bas
command(0) = "fbc(.exe)", command(1) = "-dll", command(2) = "MyPlugin.bas" ... etc. ???
Since 'blanks' are used as 'separators', on command line, AFAIK.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: No Command(0) for dynamic lib ?

Post by D.J.Peters »

If stuff was build as dynamic lib *.dll or *.so not static *.a
command(0) returned inside the library "thename.dll" or "libthename.so"

but again may be it was only in my world :-)

Joshy
fxm
Moderator
Posts: 12110
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: No Command(0) for dynamic lib ?

Post by fxm »

With fbc version 0.15, Command(0) from a dll returns an empty string.

Code: Select all

' mylib.bas

Function Command0 () As String Export
  Return "'" & Command(0) & "'"
End Function

Code: Select all

' mytest.bas

#inclib "mylib"
Declare Function Command0() As String

Print Command0()

Sleep
Compiled with fbc 0.15:

Code: Select all

''
adele
Posts: 47
Joined: Jun 13, 2015 19:33

Re: No Command(0) for dynamic lib ?

Post by adele »

Hi Joshy,
D.J.Peters wrote:If [...] command(0) returned "thename.dll" or "libthename.so"
if you just want the DLL to tell you her name, I would try somewhere in the code

Code: Select all

  VAR myName=__FILE__
and provide a function for the answer.

Adi
Post Reply