Unable to open under Linux a project built on Windows lazarus / 8-Other ---------------------------------------------------------------------- jyl · 2009-05-29 19:14 Hi All, I've an application that I started long time ago under Windows. An old version of this application is fully compatible with Linux and, as claimed, I can write once, compile anywhere...! But... lately, the Windows version got lots of enhancement (more tabsheets in the main page control (I was formely using several forms), many plotpanels, etc...) and when I try to open the project under Linux (Ubuntu 9.04 freshly installed in a virtual box running Lazarus 0.9.26.4 but also under Ubuntu 8.10 running Lazarus 0.9.26.2 on a dedicated computer) I get aRead Error message: in file ... .lfm Access violation while loading the project. I've tried removing each component after each other, but even with an almost empty form I get the error message, and once the message disappeared, I was no more able to run the application (RTE at startup) Thanks for your ideas/comments/suggestions. JYL ---------------------------------------------------------------------- Vincent Snijders · 2009-05-29 19:19 Maybe the LFM is encoded in ansi and not in UTF8. UTF8 is now used for all platforms. ---------------------------------------------------------------------- jyl · 2009-05-29 20:05 Thanks Snijders! Is there a way to select which encoding is used? (I tried to find it but unsuccessful) What is also suprising is that an older version of the application (from where the current one is derived) is perfectly loadable, compilable and working under Linux...(?) jyl ---------------------------------------------------------------------- Vincent Snijders · 2009-05-29 20:17 You could try to load the lfm (as text file) in the Lazarus IDE. Then you change the encoding (and save as UTF8) through the context menu of the source editor -> File Settings -> Encodings. ---------------------------------------------------------------------- jyl · 2009-05-30 08:25 Didn't really find a way to do it. BTW, I'm still wondering about the version numbers.... The latest one on SourceForge is 0.9.26.2. The one embedded in Debian pachages with Ubuntu 9.04 is 0.9.26.4...? I've tried to install manually the version from source forge but not successfully. There is also another difference, which main explain the problem, a tshape component build under Windows as a pen.cosmetic property that Linux version is not able to read. These properties have to be removed from the LFM file before being allowed to open it. This may hide something wrong with some libraries that I do not master... Any advice would be welcome as well. Thanks jyl ---------------------------------------------------------------------- Vincent Snijders · 2009-05-31 20:20 In Ubuntu is version 0.9.26-4, that is the 4th deb build from the 0.9.26 release. The next Lazarus release after 0.9.26 is Lazarus 0.9.26.2, so you find 0.9.26.2-1 in some debian unstable repository. TPen.Cosmetic is a property introduced after 0.9.26, but before 0.9.26.2. ---------------------------------------------------------------------- jyl · 2009-06-02 14:22 Hi, I fixed my problem of versioning and, in the same way, the issue with the cosmetic property, by simply applying the procedure indicated in the wiki documentation to get Lazarus (§1.2.1). However, the problem of loading the lfm still occurs! Here is what is displayed in a terminal (attached txt file). I'm not skilled enough in Lazarus under Linux to know what could be the reason of the fail... Thanks jyl ---------------------------------------------------------------------- clauslack · 2009-06-02 23:05 Hi From terminal.txt * The Gtk-WARNING **: Failed to load module "libcanberra-gtk-module.so": * This library is in the package libcanberra-gtk-module (translates Gtk+ widgets signals to event sounds) try to install this Regars ---------------------------------------------------------------------- jyl · 2009-06-03 06:10 Thanks Clauslack! I was also suspecting something like that, but libcanberra-gtk-module was already installed. I re-installed all debs related to libcanberra, but th ehmessage still occurs at startup; and the lfm still fails to load. Actually, the libanberra message also occurs when I open the old version of my application, but it doesn't fail. I think there sgould be something wrong inside the lfm itself, but I wasn't able to figure out what. After trying to remove the component (under windows) one by one up to see when it pass, I was also surprized to discover that it passed once and then failed again. This is really weird... BR jyl