On that note, I've built several programs that made extensive usage of BPL 's but I have…
Show quoted text 8 lines
Nevermind. If I'd bother to read the FPC docs...
hehe
-Tony

Mailing lists / lazarus / 2003-03
12 messages · 4 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
On that note, I've built several programs that made extensive usage of BPL 's but I have…
Nevermind. If I'd bother to read the FPC docs...
hehe
-Tony
Oh, you mean something like the Linux counter?
I am working on a program with 1 executable and many librarys (all from Lazarus) - all need rebuilding if any changes made Is it possible within Lazarus to re-build multiple projects with one command as yet?
Thanks
PS
It would be a good idea for the Lazarus website to have somewhere for users/developers as myself to be able to indicate our interest and support. Would show number of people actually using Lazarus ?
On that note, I've built several programs that made extensive usage of BPL 's but I have…
Tony - have attached an extract of code I use for dynamic library loading/usage - should work ok - let me know if questions on use
interface
{$LinkLib dl} // Link with "libdl.so"
function dlopen( SOFileName :PChar; Flag :Integer ) :Pointer; cdecl; external; // open library routine
function dlsym( SOAddress :Pointer; IdentifierName :PChar) :Pointer; cdecl; external; // rtn routine addr within library
function dlclose( SOAddress :Pointer ) :Integer; cdecl; external; // unload library
var
LibAddr :pointer; // Address of the loaded shared object
LibCmd :function ( FUNCTION DEF ) :FUNCTION DEF; // same as definition in library
procedure LoadLibrary;
begin
LibAddr := dlopen( 'full path to library/libLIBRARYNAME.so', 1 );
if LibAddr = Nil then begin WriteLn('Unable to Load Library'); Halt; end;
// set routine pointer to Library Function
pointer( CmdOut ) := dlsym( LibAddr, 'FUNCTION NAME' ); // lib function (with quotes)
if pointer( CmdOut ) = Nil then begin
WriteLn('Function not found');
dlclose( LibAddr ); // unload library
Halt;
end;
end;
procedure UnLoadLibrary;
begin
if LibAddr Nil then dlclose( LibAddr ); // unload library
end;I am working on a program with 1 executable and many librarys (all from Lazarus) - all…
Perhaps a multiple choice 'Interested / Tried but waiting for more / Actively developing with' ?? for the basic entry, possibly small area for name/ comments / areas of interest
I am working on a program with 1 executable and many librarys (all from Lazarus) - all…
I am working on a program with 1 executable and many librarys (all from Lazarus) - all need rebuilding if any changes made Is it possible within Lazarus to re-build multiple projects with one command as yet?
Not yet.
But lazarus supports compilation via Makefiles. Lazarus itself is building itself this way.
Write a Makefile, create a new custom tool with Tools -> configure custom tools -> Add and both options activated.
PS It would be a good idea for the Lazarus website to have somewhere for users/developers as myself to be able to indicate our interest and support. Would show number of people actually using Lazarus ?
How to you want to indicate it?
Mattias
On that note, I've built several programs that made extensive usage of BPL 's but I have not built anything that used normal libraries. I've been thinking about Using a library to handle the reports for CBT. Unfortunately I am not sure of how to write a library, and there is no wizard in Lazarus. I also am concerned with the fact that I don't want to install the library on the end-user's computer in the libs directory, but leave it right with the executable. I've had problems figuring out the exe path before, especially when launched from a shortcut.
Does anyone have any example code I could look at?
-Tony
Tony Maro wroteOn that note, I've built several programs that made extensive usage of BPL 's but I have not built anything that used normal libraries. I've been thinking about Using a library to handle the reports for CBT. Unfortunately I am not sure of how to write a library, and there is no wizard in Lazarus. I also am concerned with the fact that I don't want to install the library on the end-user's computer in the libs directory, but leave it right with the executable. I've had problems figuring out the exe path before, especially when launched from a shortcut.
Paramstr(0) should return the correct binary executable. You can check whether it is a symbolic link with stat() and S_ISLNK(), and then follow the link with readlink(), this should produce the correct binary name and hence directory.
Loading a library depends on whether it is statically (you must set the LD_LIBRARY_PATH environment variable) or dynamically (use dlopen() with complete path).
Michael.
On that note, I've built several programs that made extensive usage of BPL 's but I have…
Looks good. Now all I lack is how to write the library itself. Any sample code out there? When I did this years ago in Delphi, there was a wizard to get me started...
I tried some old DLL code I did in Delphi 4 but the exports keyword isn't recognized where it is. I'm kinda lost here.
Thanks,
Tony
A forum in addition to the list would be nice.
Tony
On that note, I've built several programs that made extensive usage of BPL 's but I have…
You also need to search with the PATH environment variable. The IDE has a function for all this. I think, it is useful for other programs as well, so I moved it to filectrl.pp. Search for function ProgramDirectory.
Mattias
Oh, you mean something like the Linux counter? -----Original Message----- From: "SteveG"…
You right Tony - when I tried the Survey on the main page, I kept selecting 'Poll' and going in a circle - just tried 'Results' -duh