Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-03

Building multiple projects

12 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tony Maro
to Tony Maro: On that note, I've built several programs that made extensive usage of BPL 's but I have…
Show quoted text 8 lines
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.

Nevermind. If I'd bother to read the FPC docs...
hehe

-Tony

Reply by email

Tony Maro

Oh, you mean something like the Linux counter?

Earlier message 31 lines
-----Original Message----- From: "SteveG" Sent: 3/26/03 4:00:42 AM To: "" Subject: Re: [lazarus] Lazarus Interest indications 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 >> 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 > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

SteveG

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 ?

Reply by email

SteveG
to Tony Maro: 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

Tony Maro wrote 33 lines
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 -----Original Message----- From: "SteveG" Sent: 3/26/03 3:18:17 AM To: "Lazarus Mailing List" Subject: [lazarus] Building multiple projects 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 ? _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
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;

Reply by email

SteveG
to SteveG: 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

Show quoted text 15 lines
> 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 _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Mattias Gaertner
to SteveG: 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

Reply by email

Tony Maro

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

Earlier message 22 lines
-----Original Message----- From: "SteveG" Sent: 3/26/03 3:18:17 AM To: "Lazarus Mailing List" Subject: [lazarus] Building multiple projects 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 ? _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Michael Van Canneyt
to Tony Maro
Tony Maro wrote
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.

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.

Reply by email

Tony Maro
to Tony Maro: On that note, I've built several programs that made extensive usage of BPL 's but I have…
Mattias Gaertner wrote 8 lines
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

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

Reply by email

Tony Maro

A forum in addition to the list would be nice.

Tony

Earlier message 21 lines
-----Original Message----- From: "SteveG" Sent: 3/26/03 3:18:17 AM To: "Lazarus Mailing List" Subject: [lazarus] Building multiple projects 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 ? _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Mattias Gaertner
to Tony Maro: On that note, I've built several programs that made extensive usage of BPL 's but I have…
Show quoted text 18 lines
On Wed, 26 Mar 2003, Tony Maro wrote: > 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. 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.

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

Show quoted text 10 lines
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. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

SteveG
to Tony Maro: 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

Tony Maro wrote 40 lines
Oh, you mean something like the Linux counter? -----Original Message----- From: "SteveG" Sent: 3/26/03 4:00:42 AM To: "" Subject: Re: [lazarus] Lazarus Interest indications 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 >> 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 > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email