Re: [fpc-pascal] fpc 2.6.0-rc1 for arm-embedded
On 09-12-11 00:09, Den Jean wrote: On Thursday 08 December 2011 13:49:16 Koenraad Lelong wrote: > /usr/lib/fpc/2.6.0/units/arm-embedded/rtl/system.o does not support > interworking, whereas test-1.elf does does this thread help ? http://lists.freepascal.org/lists/fpc-devel/2011-August/025615.html Hi, Thanks, I tried the commands of John Clymer after downloading and installing Codesourcery. The compiler and my test-application compiled fine. I flashed my device but there I don't see anything. At the moment I can't debug with JTAG, so I'll have to fix that first before I can say more. Regards, Koenraad Lelong. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] News from MSEide+MSEgui
Hi, MSEide+MSEgui 2.8rc1 for FPC 2.6 has been released: http://sourceforge.net/projects/mseide-msegui/files/mseide-msegui/2.8rc1/ There is also a new beta for MSEgit: http://gitorious.org/mseuniverse/mseuniverse/trees/msegit_release_0_8_2/tools/msegit A screenshot is here: http://mseide-msegui.sourceforge.net/pics/msegit.png Havwe a lot of fun! Martin ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
> On 2011-12-12 00:48, nore...@z505.com wrote: >> >>> Ok, thanks for clearifying that. I guess it's going to be a lot of >>> include files instead... :) >>> >>> -Torsten. >> >> >> Why do you need include files in your case? >> You can put the units in the uses clause of your library. > Because it is still going to give me a very long list of exports - > considering I have approx. 200 methods to export. > > Instead I would do something like this: > > library something; > > {$DEFINE InterfaceSection} > {$I unit1} > [snip...] > {$I unit20} > {$UNDEFINE InterfaceSection} > > exports > {$DEFINE ExportSection} > {$I unit1}, > [snip...] > {$I unit20} > {$UNDEFINE ExportSection} > ; > > end. > > unit 1; > > {$IFDEF InterfaceSection} > function Foo(a: integer): integer; > begin >result := a * a; > end; > {$ENDIF} > > {$IFDEF ExportSection} >Foo name 'Bar' > {$ENDIF} Well maybe ExportAll compiler feature should be suggested? But please try this unit Unit1; {$mode objfpc}{$H+} interface procedure proc1; stdcall; procedure proc2; stdcall; implementation procedure proc1; stdcall; begin writeln('hello'); end; exports proc1; procedure proc2; stdcall; begin writeln('hello 2'); end; exports proc2; end. Notice how I put exports in several places... It works on win32.. Try linux? Now for your executable, load it like so: program p; {$mode objfpc}{$H+} procedure proc1; stdcall; external 'd2.dll'; procedure proc2; stdcall; external 'd2.dll'; begin writeln('First proc from lib..'); readln; proc1; readln; writeln('Second proc from lib..'); proc2; readln; end. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
On 12 Dec 2011, at 19:56, nore...@z505.com wrote: > procedure proc1; stdcall; > begin > writeln('hello'); > end; exports proc1; > > procedure proc2; stdcall; > begin > writeln('hello 2'); > end; exports proc2; > > > end. > > > Notice how I put exports in several places... > > It works on win32.. It only partially works. Please see the bug report I mentioned earlier: http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=16070 Jonas___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
On 2011-12-12 20:04, Jonas Maebe wrote: On 12 Dec 2011, at 19:56, nore...@z505.com wrote: procedure proc1; stdcall; begin writeln('hello'); end; exports proc1; procedure proc2; stdcall; begin writeln('hello 2'); end; exports proc2; end. Notice how I put exports in several places... It works on win32.. It only partially works. Please see the bug report I mentioned earlier: http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=16070 Does this just mean I have to compile my library with -B every time? If that is the case, then I don't mind. I prefer to have a more manageable unit structure at the cost of an extra compiler option, than dealing with lots of includes or a very large exports section. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
On 12 Dec 2011, at 20:17, Torsten Bonde Christiansen wrote: > On 2011-12-12 20:04, Jonas Maebe wrote: >> It only partially works. Please see the bug report I mentioned earlier: >> http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=16070 > > Does this just mean I have to compile my library with -B every time? If that > is the case, then I don't mind. Yes, that should work. Jonas___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
Well maybe ExportAll compiler feature should be suggested? But please try this unit Unit1; {$mode objfpc}{$H+} interface procedure proc1; stdcall; procedure proc2; stdcall; implementation procedure proc1; stdcall; begin writeln('hello'); end; exports proc1; procedure proc2; stdcall; begin writeln('hello 2'); end; exports proc2; end. I tried and it didn't seem to work, however perhaps it could be related to that I'm trying to create a library for arm-linux on android. I've been following the guides from http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android which i know probably is trying to do something that's not possible. Anyway, thanks to both of you for the help so far. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
> >> >> >> Well maybe ExportAll compiler feature should be suggested? >> >> But please try this >> >> unit Unit1; >> >> {$mode objfpc}{$H+} >> >> interface >> >> procedure proc1; stdcall; >> procedure proc2; stdcall; >> >> implementation >> >> >> procedure proc1; stdcall; >> begin >>writeln('hello'); >> end; exports proc1; >> >> procedure proc2; stdcall; >> begin >>writeln('hello 2'); >> end; exports proc2; >> >> >> end. > I tried and it didn't seem to work, however perhaps it could be related > to that I'm trying to create a library for arm-linux on android. Try adding EXPORT keyword after the stdcall. I forgot to put that in there, that's what i used, but I figured it was not needed so I deleted it before I sent my message. I thought export keyword was not used for exports.. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
> > On 12 Dec 2011, at 19:56, nore...@z505.com wrote: > >> procedure proc1; stdcall; >> begin >> writeln('hello'); >> end; exports proc1; >> >> procedure proc2; stdcall; >> begin >> writeln('hello 2'); >> end; exports proc2; >> >> >> end. >> >> >> Notice how I put exports in several places... >> >> It works on win32.. > > It only partially works. Please see the bug report I mentioned earlier: > http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=16070 > > interesting, I tried BUILD ALL in lazarus ide and it works, but I also tried not building all and using the EXPORT keyword along with EXPORTS section, and that requires no build all. Whereas without the EXPORT keyword it only works if you build all. This is on win32. So the export keyword does something on win32? You said that EXPORT keyword is for emx and os/2 ... But maybe I should look into the compiler sources to see if it does something else.. it seems to cause the dll to work without a build all.. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
On 12 Dec 11, at 17:17, nore...@z505.com wrote: > > On 12 Dec 2011, at 19:56, nore...@z505.com wrote: > > > >> procedure proc1; stdcall; > >> begin > >> writeln('hello'); > >> end; exports proc1; > >> > >> procedure proc2; stdcall; > >> begin > >> writeln('hello 2'); > >> end; exports proc2; > >> > >> > >> end. > >> > >> > >> Notice how I put exports in several places... > >> > >> It works on win32.. > > > > It only partially works. Please see the bug report I mentioned earlier: > > http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=16070 > > > > > > interesting, I tried BUILD ALL in lazarus ide and it works, but I also > tried not building all and using the EXPORT keyword along with EXPORTS > section, and that requires no build all. Whereas without the EXPORT > keyword it only works if you build all. This is on win32. > > So the export keyword does something on win32? > > You said that EXPORT keyword is for emx and os/2 ... . . It's intended to be supported under OS/2 and EMX indeed. However, the compiler probably won't do much with EXPORT under EMX and OS/2 either as of now (it doesn't work due to issues with the GNU linker available for OS/2). Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal