Can't find unit interface on Ubuntu 9.10 lazarus / 1-Linux ---------------------------------------------------------------------- chronozphere · 2010-01-01 19:52 Hey everyone. I've been using delphi for quite some years now and now I want to try lazarus to make cross-platform apps. I'm new to linux, FPC and Lazarus so installing it was not that easy but I seem to have succeeded. The only problem is that when I try compiling something, the compiler says "cant find unit interface used by *blabla* ". This also happens when building the IDE (because it then tries to build the hello-world example).  Lazarus can find the file because a "Ctrl+Click" on Interfaces in the uses clause, brings up the unit in the source editor. However FPC can not. I've build the IDE again, but now with the "-vut" option. Here is the compiler output: http://pastebin.com/m6de4cd7c First of all I see "Permission denied" a lot. Does that mean the compiler doesn't have the right to remove those files? How can I fix this? Secondly, It cant find any unit it's looking for (after all rm's). Finally, I noticed that the compiler looks for interfac.ppu instead of interfaces.ppu (the one causing my actual problem). The compiler seems to turn the filename into a 8.3 format, thus removing the last "e". Can someone tell me how to fix these issues? Thanks a bunch!  P.S: I Installed lazarus 0.9.28.2 and FPC 2.4.0, both in /usr/lib/. P.P.S: Best wishes for 2010!!! ---------------------------------------------------------------------- bonmario · 2010-01-01 20:04 Quote from: chronozphere on January 01, 2010, 08:52:32 pmThe only problem is that when I try compiling something, the compiler says "cant find unit interface used by *blabla* ". This also happens when building the IDE (because it then tries to build the hello-world example).  Wich version of FPC have you installed? It seems that it searches sources of FPC 2.4.0 but they don't exist. Quote from: chronozphere on January 01, 2010, 08:52:32 pmFirst of all I see "Permission denied" a lot. Does that mean the compiler doesn't have the right to remove those files? How can I fix this? How you build IDE? You build with the command "make" of from the menu in the IDE? ---------------------------------------------------------------------- chronozphere · 2010-01-01 20:23 As I said, I installed FPC 2.4.0 at /usr/lib/fpc/. This fpc directory contains the following directories:  /usr/lib/fpc/2.4.0/  /usr/lib/fpc/2.2.4/  /usr/lib/fpc/lexyacc/  /usr/lib/fpc/source/ (this is where i put the FPC 2.4 source, because Lazarus was asking for it at startup). I've used the option in the IDE to rebuild. ---------------------------------------------------------------------- marcov · 2010-01-01 23:38 What does fpc -i show on the cmdline? ---------------------------------------------------------------------- chronozphere · 2010-01-02 00:05 "fpc -i" shows the following: QuoteFree Pascal Compiler version 2.4.0 Compiler Date      : 2009/12/28 Compiler CPU Target: i386 Supported targets:   GO32 V2 DOS extender   Linux for i386   OS/2   Win32 for i386   FreeBSD/ELF for i386   Solaris for i386 (under development)   Beos for i386 (under development)   NetBSD for i386 (under development)   Netware for i386(clib)   WDOSX DOS extender   OpenBSD for i386 (under development)   OS/2 via EMX   Watcom compatible DOS extenders   Netware for i386(libc)   WinCE for i386   Linux for x64_6432   Darwin for i386   Symbian OS for i386   Haiku for i386 (under development) Supported CPU instruction sets:   386   PENTIUM   PENTIUM2   PENTIUM3   PENTIUM4   PENTIUMM Supported FPU instruction sets:   X87   SSE   SSE2   SSE3 Supported ABI targets:   DEFAULT   SYSV   AIX   EABI   ARMEB Supported Optimizations:   REGVAR   UNCERTAIN   STACKFRAME   PEEPHOLE   ASMCSE   LOOPUNROLL   TAILREC Supported Whole Program Optimizations:   All   DEVIRTCALLS   OPTVMTS   SYMBOLLIVENESS Supported Microcontroller types: This program comes under the GNU General Public Licence For more information read COPYING.FPC Report bugs, suggestions, etc. to:                  http://bugs.freepascal.org or                  bugs@freepascal.org I think I've narrowed the problem down. The compiler output I posted contains: QuoteUnitsearch: /usr/lib/lazarus/0.9.28.2/lcl/units/i386-linux/gtk2/Interfaces.ppu Searching file /usr/lib/lazarus/0.9.28.2/lcl/units/i386-linux/gtk2/Interfaces.ppu... not found Searching file /usr/lib/lazarus/0.9.28.2/lcl/units/i386-linux/gtk2/interfaces.ppu... found PPU Loading /usr/lib/lazarus/0.9.28.2/lcl/units/i386-linux/gtk2/interfaces.ppu (INTERFACES) PPU Name: /usr/lib/lazarus/0.9.28.2/lcl/units/i386-linux/gtk2/interfaces.ppu (INTERFACES) PPU Invalid Version 91 Which means that the compiler doesnt like the PPU because its build using a different FPC version. (correct me if i'm wrong). I found this: QuoteMake sure your compiled LCL fits to the installed compiler. For example if you installed a new compiler, then the LCL must be rebuilt (for example the interfaces.ppu must be rebuilt (You must be loged in as admin to rebuild) ); Source: http://wiki.lazarus.freepascal.org/FPC_message:_Can_not_find_u nit#Can.27t_find_unit_interfaces Which means I have to rebuild the LCL. So I tried: Tools -> Configure "Build lazarus", select LCL and press build in the dialog. The compiler output contains the following: Quote(INTERFACEBASE) PPU Name: /usr/lib/lazarus/0.9.28.2/lcl/units/i386-linux/interfacebase.ppu (INTERFACEBASE) PPU Invalid Version 91 Using "sudo make -C gtk2 all" gives exactly the same result. Can anyone help me out? ---------------------------------------------------------------------- Marc · 2010-01-02 02:55 what does make info show ? ---------------------------------------------------------------------- chronozphere · 2010-01-02 08:51 Quotecd /usr/lib/lazarus/0.9.28.2/ make info == Package info == Package Name..... lazarus Package Version.. 0.9.28.2-0 == Configuration info == FPC.......... /usr/bin/ppc386 FPC Version.. 2.4.0 Source CPU... i386 Target CPU... i386 Source OS.... linux Target OS.... linux Full Source.. i386-linux Full Target.. i386-linux SourceSuffix. i386-linux TargetSuffix. i386-linux == Directory info == Required pkgs... rtl regexpr Basedir......... /usr/lib/lazarus/0.9.28.2 FPCDir.......... /usr/lib/fpc/2.4.0 CrossBinDir..... UnitsDir........ /usr/lib/fpc/2.4.0/units/i386-linux PackagesDir..... /usr/lib/fpc/2.4.0 GCC library..... Other library... == Tools info == As........ as Ld........ ld Ar........ ar Rc........ rc Mv........ /bin/mv Cp........ /bin/cp Rm........ /bin/rm GInstall.. /usr/bin/install Echo...... /bin/echo Shell..... /bin/sh Date...... /bin/date FPCMake... /usr/bin/fpcmake PPUMove... /usr/bin/ppumove Upx....... Zip....... /usr/bin/zip == Object info == Target Loaders........ Target Units.......... Target Implicit Units. Target Programs....... lazarus startlazarus Target Dirs........... lcl packager/registration ideintf packager components ide tools Target Examples....... Target ExampleDirs.... examples Clean Units......... Clean Files......... Install Units....... Install Files....... == Install info == DateStr.............. 20100102 ZipName.............. lazarus ZipPrefix............ ZipCrossPrefix....... ZipSuffix............ .i386-linux FullZipName.......... lazarus.i386-linux Install FPC Package.. n Install base dir..... share/lazarus Install binary dir... /usr/local/bin Install library dir.. /usr/local/lib Install units dir.... share/lazarus/units/i386-linux/lazarus Install source dir... /usr/local/share/src/fpc-2.4.0/lazarus Install doc dir...... /usr/local/share/doc/fpc-2.4.0/lazarus Install example dir.. /usr/local/share/doc/fpc-2.4.0/lazarus/examples Install data dir..... share/lazarus Dist destination dir. /usr/lib/lazarus/0.9.28.2/dist Dist zip name........ ---------------------------------------------------------------------- chronozphere · 2010-01-03 13:09 Ok, I reinstalled everything (via synaptic) and now it works. I'm now using Lazarus 0.9.28.2-0 and FPC 2.2.4-3. I should install software via synaptic from now on, instead of downloading seperate deb's and using shellscripts (as I did before). ---------------------------------------------------------------------- TurboRascal · 2010-01-04 03:49 You're right about using synaptic However, I must also note this, you shouldn't ever install anything manually to the /* or /usr/* directory trees. If you install something manually, it should go under /usr/local/*, e.g. /usr/local/bin, /usr/local/lib etc. However, you should really do it only when there is no apt or deb based install options, which for lazarus we do have ---------------------------------------------------------------------- brian666 · 2010-01-15 08:23 Quote from: Turbo Rascal on January 04, 2010, 04:49:05 amYou're right about using synaptic However, I must also note this, you shouldn't ever install anything manually to the /* or /usr/* directory trees. If you install something manually, it should go under /usr/local/*, e.g. /usr/local/bin, /usr/local/lib etc. However, you should really do it only when there is no apt or deb based install options, which for lazarus we do have Well, I took your adivce about using Synaptic. *And* I've tried downloading from Sourceforge. I'm going round and round in circles here. I'm relatively new to Lazarus and FreePascal, although I had it all working on my 32-bit Mandriva box. Now I'm trying to set things up on an AMD Phenom using 64-bit Kubuntu 9.1, and it's driving me crazy. I get everything installed, but trying to rebuild Lazarus from the IDE gives me a message telling me that link.res has the line -lXtst and either that this cannot be found, or sometimes it tells me that link.res has output sections, and did I forget the -T option? Any time I try to rebuild the IDE, then when I exit the program, I have to copy the executable again, as it's been deleted. Unless there's something seriously wrong with my setup, it's hard to believe that the 64-bit version, at least under Kubuntu, got any significant amount of testing. Like I said, I'm relatively new to Lazarus, and VERY new to this 64-bit box. Can you give me a couple of pointers to help me try to work out what's going wrong? Thanks. Oh, and I've attached link.res, renamed to a text file, as that seems to be at the bottom of the problems. ---------------------------------------------------------------------- Mike J · 2010-01-16 02:23 Do you have ant *-dev packages installed? I think when it is asking for Xtst it may be asking for an xorg dev lookup. ---------------------------------------------------------------------- brian666 · 2010-01-16 07:31 Quote from: Mike J on January 16, 2010, 03:23:08 amDo you have ant *-dev packages installed? I think when it is asking for Xtst it may be asking for an xorg dev lookup. Not to the best of my knowledge, but I'll go through the installed packages later this morning. Thanks for the suggestion. *UPDATE* There are a whole bunch (guesstimate around 50) *-dev packages installed. I have not the slightest idea of what they're doing there. I know *I* haven't gone through and deliberately installed any development versions. Is there anyone else out there who thinks that Mike has hit on the problem? I'm reluctant to rip this much stuff out of the system, I get the distinct feeling I'll end up doing a reinstallation of the whole thing if I do. I'm not doubting that you're trying to give me your best advice, Mike, I'd just like a second opinion... If it makes any difference I originally installed Linux Mint 8 at the suggestion of a friend, but I hate GNOME as a desktop, and when I installed the KDE meta-package, rebooted and selected KDE from the boot menu, up came Kubuntu. I'm totally new to these distros, but want away from Mandriva, which is what I've used up until now. ---------------------------------------------------------------------- Mike J · 2010-01-16 14:09 You got me in reverse, if it can't link to a lib, you are usually missing a *dev. ---------------------------------------------------------------------- brian666 · 2010-01-16 14:55 Quote from: Mike J on January 16, 2010, 03:09:47 pmYou got me in reverse, if it can't link to a lib, you are usually missing a *dev. Aargh. Sorry. I shouldn't try to read replies in the small hours. OK, I'll try seeing whether I can follow a chain the other way. Thanks again. **UPDATE** OK, we're finally getting somewhere. You were spot on with the reason, Mike, obviously some packages which should have been installed weren't. Thanks for the help. I just went through Synaptic and installed a bunch of header meta-packages, and everything seems to build OK now.