Re: [Lazarus] Libc functions and types
On Tue, Jan 17, 2012 at 10:10:23PM -0800, Udav wrote: better alternative than just making everyone redeclare everything in their own units. Absolutely! And if one just try searching through FPC RTL files for tm record he'll find it is declared about 8 times in various units. That's perfectly logical because every *nix version has its own version. (and they might even differ between architectures. Linux specially has that tendency due to x86 legacy) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Libc functions and types
On Tue, Jan 17, 2012 at 03:38:32PM -0600, Craig Peterson wrote: On 1/17/2012 2:49 PM, Marco van de Voort wrote: There is no Embarcadero Radstudio that supports Linux. In ancient times there was Kylix, but it was buried. A part of it escaped, called unit libc, but we finally caught up with it, and now it is dead and buried too. And now they have the Posix.* units which provide the same functionality in a more cross-platform manner. Not supported by FPC atm. The original poster gave localtime_r as a specific example. It's part of the OpenGroup's Unix specification (in time.h), but FreePascal only exposes it in libc.pas. FPC doesn't expose it in any portable manner. If you don't want people using that header you really should provide a better alternative than just making everyone redeclare everything in their own units. Patches and submissions of such units are welcome. Note that this is the first time that this has come up. For calls for which it has come up more frequently, this has already happened (password and network resolving among others) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Libc functions and types
Am 17.01.2012 08:28, schrieb Udav: Well, I guess one option is to rebuild RTL with FPC_USE_LIBC defined. Another one is to define needed structures myself and implement function calls via syscall - what, I believe, is recommended way. But how can I determine the number of the function I want to call? Unit libc is deprecated, yes, but its functionality is not. Most functionality is available via different units like BaseUnix and so on. A grep -ri TheStructureYouSearch $fpcdir/rtl should often help you in finding your structure (it should often work with functions as well). Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Libc functions and types
Sven, I tried searching inside RTL and localtime_r() is only declared in the libc/newlibc units. I think I'd have to use it because I'm trying to make my units RAD/FPC compatible and RAD uses libc for POSIX code and doesn't worry about it. -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Libc-functions-and-types-tp3665361p3665688.html Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Libc functions and types
On Tuesday, January 17, 2012, at 11:20 Udav wrote: Sven, I tried searching inside RTL and localtime_r() is only declared in the libc/newlibc units. I think I'd have to use it because I'm trying to make my units RAD/FPC compatible and RAD uses libc for POSIX code and doesn't worry about it. With RAD do you mean Delphi? Because RAD stands for Rapid Application Development and does not really fit into the context of the rest of your message. -- Best Regards, Andreas -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Libc functions and types
On Tue, Jan 17, 2012 at 03:16:40AM -0800, Udav wrote: With RAD do you mean Delphi? Because RAD stands for Rapid Application Development and does not really fit into the context of the rest of your message. Yeah, I mean Emb-ro RAD Studio (namely XE2 as they introduced multi-platform support in this version) There is no Embarcadero Radstudio that supports Linux. In ancient times there was Kylix, but it was buried. A part of it escaped, called unit libc, but we finally caught up with it, and now it is dead and buried too. Just in case, I'm sitting on the grave with a shotgun. Read all about here: http://wiki.freepascal.org/libc_unit -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Libc functions and types
On 1/17/2012 2:49 PM, Marco van de Voort wrote: There is no Embarcadero Radstudio that supports Linux. In ancient times there was Kylix, but it was buried. A part of it escaped, called unit libc, but we finally caught up with it, and now it is dead and buried too. And now they have the Posix.* units which provide the same functionality in a more cross-platform manner. The original poster gave localtime_r as a specific example. It's part of the OpenGroup's Unix specification (in time.h), but FreePascal only exposes it in libc.pas. If you don't want people using that header you really should provide a better alternative than just making everyone redeclare everything in their own units. -- Craig Peterson Scooter Software -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Libc functions and types
Marco van de Voort wrote There is no Embarcadero Radstudio that supports Linux. In ancient times there was Kylix, but it was buried. A part of it escaped, called unit libc, but we finally caught up with it, and now it is dead and buried too. They have MacOSX support in XE2 and surely will do Linux in the next version. Craig Peterson wrote If you don't want people using that header you really should provide a better alternative than just making everyone redeclare everything in their own units. Absolutely! And if one just try searching through FPC RTL files for tm record he'll find it is declared about 8 times in various units. -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Libc-functions-and-types-tp3665361p3668419.html Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Libc functions and types
I need to use some libc functions and types (localtime_r, tm, ...) but there's very confusing situation with libc (they say it is deprecated) and it even couldn't be found by Lazarus when I write uses libc. But there are no things I heed in the RTL. So what should I do? -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Libc-functions-and-types-tp3665361p3665361.html Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LibC
On Mon, 7 Sep 2009 10:01:03 -0400 matt shaffer dazappa.m...@gmail.com wrote: On a somewhat related note, I'm done trying to develop anything interesting on Linux. After installing ~10 extra random dependencies to build OGL apps, everything's still being a pain. There's basically no libraries to make things 3D, so I was trying out GLScene. I don't know anything about GLScene, but I am doing 3D stuff on Linux for years and don't have any problems. I don't know what your random packages are but I only need Lazarus and a working 3D driver and that's it. Lazarus comes with a cross platform OpenGL component in $LazarusDir/components/opengl. Drop it on a form and you are good to go. If you tell me what you are trying to achieve I may be able to assist. R. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LibC
Well I'm basically looking for a 3D library that has Model loading (Blender does a good job of exporting almost anything, so long as the library does not have its own format I should be good) Texturing (Cannot get this to work with GLScene) Real time model transforming (For simple animated waves + models) Lighting effects (Shadows, colored lights) Particles OpenGL for hardware acceleration Demo programs, because I cannot learn anything without exploring first. I just cannot find many resources regarding cross platform 3D graphics with FPC; Only thing I found was GLScene and it was a big let down.. The cast II engine looked good but it does not yet support openGL so no cross platform compatibility is really there yet. Also I'm unsure of whether or not dropping an openGL component on the form would have solved my problems (I imagine it might have, but I forgot Lazarus had one), but the wiki article I read on ld -l seemed to imply that installing various (development) libraries was necessary, and after poking around the internet to find out which libraries I should install I got the error messages to go away. I'm not one of those people who needs a visible component, so long as the library contains demo apps compiles easily and happily I should be good. On Tue, Sep 8, 2009 at 3:48 PM, Reimar Grabowski reimg...@web.de wrote: On Mon, 7 Sep 2009 10:01:03 -0400 matt shaffer dazappa.m...@gmail.com wrote: On a somewhat related note, I'm done trying to develop anything interesting on Linux. After installing ~10 extra random dependencies to build OGL apps, everything's still being a pain. There's basically no libraries to make things 3D, so I was trying out GLScene. I don't know anything about GLScene, but I am doing 3D stuff on Linux for years and don't have any problems. I don't know what your random packages are but I only need Lazarus and a working 3D driver and that's it. Lazarus comes with a cross platform OpenGL component in $LazarusDir/components/opengl. Drop it on a form and you are good to go. If you tell me what you are trying to achieve I may be able to assist. R. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LibC
On Tue, 8 Sep 2009 16:21:35 -0400 matt shaffer dazappa.m...@gmail.com wrote: Well I'm basically looking for a 3D library that has Model loading (Blender does a good job of exporting almost anything, so long as the library does not have its own format I should be good) Texturing (Cannot get this to work with GLScene) Real time model transforming (For simple animated waves + models) Lighting effects (Shadows, colored lights) Particles OpenGL for hardware acceleration Sounds like a game engine to me. I am not aware of any cross platform pascal game engine. My own (non-game-)engine does some of the stuff you need but particles, shadows and mesh transformation (I think this is what you meant) are not implemented yet and will not be for the foreseeable future due to various reasons. There are some good C++ cross platform engines out there like Ogre and Irrlicht. If you are willing to create bindings you should be able to use these. I know that Ogre has Python bindings so it should be possible. I just cannot find many resources regarding cross platform 3D graphics with FPC That's because there aren't any. 3D graphics coding is in the firm grip of C++ although lately Java made some steps into this territory. Low level 3D graphics coding is no walk in the park so there are not many developers doing this kind of stuff and less doing it with FPC and much less on Linux. Also I'm unsure of whether or not dropping an openGL component on the form would have solved my problems If you are not into low level graphics coding (OpenGL) then it would not have helped. The component just offers an context where OpenGL can render to. But you sound like you want to do high level graphics coding so you need an engine. Nevertheless you can try the OpenGL example in examples/openglcontrol to see that cross platform 3D graphics are possible with Lazarus/FPC. I wrote it back in the day when I started to learn OpenGL and Lazarus was still young (not even the form designer was working correctly) and it was not updated since so it is no good tutorial for the API. R. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LibC
Reimar Grabowski wrote: On Tue, 8 Sep 2009 16:21:35 -0400 matt shaffer dazappa.m...@gmail.com wrote: Well I'm basically looking for a 3D library that has ... ... R. You may study the new ones for you among the following sites : http://vrmlengine.sourceforge.net/ http://sourceforge.net/projects/gradlib/ http://sourceforge.net/projects/s3dpros/ http://www.ndrw.co.uk/ http://allegro-pas.sourceforge.net/ http://www.delphigamer.com/main.php http://www.pascalgamedevelopment.com/forum/ http://www.noeska.com/en.aspx http://andorra.sourceforge.net/ http://glscene.sourceforge.net/wikka/HomePage http://www.delphigl.com/index2.php http://www.graphics32.org/wiki/ http://www.sulaco.co.za/ http://www.libsdl.org/ http://www.dummzeuch.de/delphi/rxlibsf/english.html Thank you very much . Mehmet Erol Sanliturk -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LibC
Am Dienstag, 8. September 2009 22:21 schrieb matt shaffer: Well I'm basically looking for a 3D library that has Model loading (Blender does a good job of exporting almost anything, so long as the library does not have its own format I should be good) Texturing (Cannot get this to work with GLScene) Real time model transforming (For simple animated waves + models) Lighting effects (Shadows, colored lights) Particles OpenGL for hardware acceleration Demo programs, because I cannot learn anything without exploring first. I just cannot find many resources regarding cross platform 3D graphics with FPC; Only thing I found was GLScene and it was a big let down.. The cast II engine looked good but it does not yet support openGL so no cross platform compatibility is really there yet. Also I'm unsure of whether or not dropping an openGL component on the form would have solved my problems (I imagine it might have, but I forgot Lazarus had one), but the wiki article I read on ld -l seemed to imply that installing various (development) libraries was necessary, and after poking around the internet to find out which libraries I should install I got the error messages to go away. I'm not one of those people who needs a visible component, so long as the library contains demo apps compiles easily and happily I should be good. IIRC glscene supports most (if not all) of this. It works pretty well for me on 32-bit linux with gtk1 even thou there are still some glitches regarding bitmap manipulation. It should also work with gtk2, but I'm not using gtk2 yet, so I don't know about the related problems. It also compiles and runs on 64-bit, however, there are more problems to expect. Some demos work, some need a little tweaking. Patches are welcome. Just be sure to use the svn version of glscene and report problems/send patches in mantis (project Lazarus-CCR, category glscene). Also consider joining the #glscene channel on frenode.net irc. regards Burkhard -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LibC
On Sun, Sep 06, 2009 at 10:48:13PM -0400, matt shaffer wrote: I've come across a few projects now that require libc on Linux. I'm using the latest Ubuntu (9.04) + Lazarus (9.26-4), and it says it can't find libc. Library libc or unit libc? Is Ubuntu one of those distributions that fragment FPC over umpteen packages? If so, see if there is a separate one for the libc unit. (which is a Kylix legacy package) Note that it would be wisest to get rid of libc alltogether, because it is linux/x86 only. If you are using 64-bit Ubuntu, that might even be the cause of your problem. More info: http://wiki.freepascal.org/libc_unit After doing some basic research, it looks like this would be dependent upon the compiler? How can I download and setup libc so Lazarus will compile apps that use it happily? I cannot find a lot of information on this Install the deb, if Lazarus uses a wildcard in its FPC searchpath, the rest will go automatically. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LibC
Marco van de Voort het geskryf: Note that it would be wisest to get rid of libc alltogether, because it is linux/x86 only. Remember to mention that that is only the case for the 'libc' unit! The libc library is available on just about any unix-type OS (linux, *bsd, etc.). There is a wiki pages explaining the difference of libc as well. http://wiki.lazarus.freepascal.org/libc_unit Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LibC
Unit libc. AFAIK no, Ubuntu doesn't distribute FPC over tons of packages, but I just installed everything (FPC/Laz + sources) from one package). On a somewhat related note, I'm done trying to develop anything interesting on Linux. After installing ~10 extra random dependencies to build OGL apps, everything's still being a pain. There's basically no libraries to make things 3D, so I was trying out GLScene. First, the actual package itself + demos have sources that are nearly compatible with Linux, but require just a tiny bit of editing (GLLCLViewer to GLViewer, for instance in the uses claus). Found out the hard way that unless the app is built as GTK1, double buffering seems to fail. And after installing the GLScene package, every app that uses glscene wants to rebuild all of glscene before it compiles the stupid demos! And there are a lot of demos that are broken even though they're supposed to work... *Throws in towel*. If anything, I'll stick to 2d on Linux using my favorite little buddy, Andorra 2D. On Mon, Sep 7, 2009 at 2:25 AM, Marco van de Voort mar...@stack.nl wrote: On Sun, Sep 06, 2009 at 10:48:13PM -0400, matt shaffer wrote: I've come across a few projects now that require libc on Linux. I'm using the latest Ubuntu (9.04) + Lazarus (9.26-4), and it says it can't find libc. Library libc or unit libc? Is Ubuntu one of those distributions that fragment FPC over umpteen packages? If so, see if there is a separate one for the libc unit. (which is a Kylix legacy package) Note that it would be wisest to get rid of libc alltogether, because it is linux/x86 only. If you are using 64-bit Ubuntu, that might even be the cause of your problem. More info: http://wiki.freepascal.org/libc_unit After doing some basic research, it looks like this would be dependent upon the compiler? How can I download and setup libc so Lazarus will compile apps that use it happily? I cannot find a lot of information on this Install the deb, if Lazarus uses a wildcard in its FPC searchpath, the rest will go automatically. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LibC
matt shaffer het geskryf: BAH! I completely forgot in the last email (due to my large rant), but if you couldn't tell I did find and install unit libc happily. I know nothing about 3D stuff so can't comment on any of those. As for dependencies. Linux ships software packages in sets of 3. - runtime package (xxx) - source code package (xxx-src) - development package (xxx-dev) By default you normally have the runtime packages installed. If you do any software development on a Linux system, you need to install the development packages so you can link to them at compile time. If you do C/C++ programming or want to modify application available in Linux, then you might need to install the source code packages (most software under Linux is written in C/C++). So once you understand how Linux is different to say Windows, it's not really that hard. But you have to remember that Linux is NOT Windows, so it is allowed to be different. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LibC
matt shaffer schrieb: I've come across a few projects now that require libc on Linux. I'm using the latest Ubuntu (9.04) + Lazarus (9.26-4), and it says it can't find libc. Did you install the development package for libc? DoDi -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus