Sign in Join

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

Mailing lists / lazarus / 2010-06

Clean Up and Build / Fatal Error: Can't Create object file: units/i386-linux/hello.o

17 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

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

Peter E Williams

Hi All,

I am wondering if the default installation paths for 0.9.28.2 on Ubuntu 10.04 LTS require tweaking.

I know that the HTML Help is NOT installed and this is really pissing me off.

Error:
/usr/lib/lazarus/0.9.28.2/examples/hello.pp(31,1) Error: Can't create object file: units/i386-linux/hello.o
/usr/lib/lazarus/0.9.28.2/examples/hello.pp(31,1) Fatal: Can't create object units/i386-linux/hello.o

Lazaurus Tools / Configure "Build Lazarus" Quick Build Options

Clean Up + Build

LCL interface
Target gkt 2 (beta) IDE gtk 2 (beta)

File: hello.pp [Read-Only] (/usr/lib/lazarus/0.9.28.2/examples) {

*************************************************************************** *
*
* This source is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version.
*
*
*
* This code is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details.
*
*
*
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
*
*

*************************************************************************** }
program Hello_world;

{$mode objfpc}{$H+}
uses Interfaces, Forms, HelloForm;
begin
   Application.Initialize; { calls InitProcedure which starts up GTK }
   Application.CreateForm(THello, Hello);
   Application.Run;
end.
Proudly developing Quality Cross Platform Open Source Games Since 1970 with a Commodore PET 4016 with 16 KRAM http://pews-freeware-gaems.org (<--- brand new)

Reply by email

shoKwave
to Peter E Williams
Peter E Williams wrote
File: hello.pp [Read-Only] (/usr/lib/lazarus/0.9.28.2/examples)

Hello,

if you have installed Lazarus by packagemanager you have no permission to write by default. It's because the package manager uses superuser-rights to install it.
You'll have to start Lazarus with superuser-rights to rebuild it or change permission of Lazarus-path.

You could also checkout Lazarus from svn to your $HOME and build it there.

Regards,
Ingo

Reply by email

Peter E Williams

Hi Ingo & All,

Show quoted text 13 lines
Am 04.06.2010 02:21, schrieb Peter E Williams: > File: hello.pp [Read-Only] (/usr/lib/lazarus/0.9.28.2/examples) > Hello, if you have installed Lazarus by packagemanager you have no permission Hi Ingo & All, I tried to add a menu item "Superuser Lazarus" -- "sudo lazarus" with a parameter I forget. I am using Ubuntu 9.04 karmic koala and I did it on Ubuntu 10.04 LTS.

I tried too add a menu item "Superuser Lazarus" -- "sudo lazarus" with a parameter I forget. I am using Ubuntu 9.04 karmic koala and I did it on Ubuntu 10.04 LTS.

I am obviously not running Lazarus as a superuser in the correct manner. What is the command to run lazarus in superuser mode??? I want 2 menu items - one for regular use and one for superuser. Please tell me the command to use.

Note: the guys at the computer shop advised me to run Lazarus with it's default config and NOT move the examples to the Home folder. My code is in:

Home/Public/lazarus_source_code

with folders for each project.

Show quoted text 38 lines
> Am 04.06.2010 02:21, schrieb Peter E Williams: > > File: hello.pp [Read-Only] (/usr/lib/lazarus/0.9.28.2/examples) > > > Hello, > > if you have installed Lazarus by packagemanager you have no permission > to write by default. It's because the package manager uses > superuser-rights to install it. > You'll have to start Lazarus with superuser-rights to rebuild it or > change permission of Lazarus-path. > > You could also checkout Lazarus from svn to your $HOME and build it there. > > Regards, > Ingo > > -- Love and Friendship, Peter Eric Williams +61 3 6236-9675 (home or leave a message) Mobile 044-99-256-50 Proudly created in Australia. Quality Cross-Platform Games since 1970 with a Commodore PET 4016 with 16 Kilobytes of RAM (not Megabytes). to write by default. It's because the package manager uses superuser-rights to install it. You'll have to start Lazarus with superuser-rights to rebuild it or change permission of Lazarus-path. You could also checkout Lazarus from svn to your $HOME and build it there. Regards, Ingo
Love and Friendship, Peter Eric Williams +61 3 6236-9675 (home or leave a message) Mobile 044-99-256-50 Proudly created in Australia. Quality Cross-Platform Games since 1970 with a Commodore PET 4016 with 16 Kilobytes of RAM (not Megabytes).

Reply by email

shoKwave
to Peter E Williams
Peter E Williams wrote 5 lines
I am obviously not running Lazarus as a superuser in the correct manner. What is the command to run lazarus in superuser mode??? I want 2 menu items - one for regular use and one for superuser. Please tell me the command to use.

Hi,

"sudo" is a command to be used on a console. For a menu-item or desktop-icon you can use "gksu".

gksu /usr/lib/lazarus/0.9.28.2/startlazarus

You'll have to set the paths in options again, because options are stored in user-directory.

Reply by email

Mattias Gärtner
to Peter E Williams: I tried too add a menu item "Superuser Lazarus" -- "sudo lazarus" with a parameter I…

Zitat von Peter E Williams :

Show quoted text 23 lines
Hi Ingo & All, > > Am 04.06.2010 02:21, schrieb Peter E Williams: > > File: hello.pp [Read-Only] (/usr/lib/lazarus/0.9.28.2/examples) > > > Hello, > > if you have installed Lazarus by packagemanager you have no permission > Hi Ingo & All, > > I tried to add a menu item "Superuser Lazarus" -- "sudo lazarus" with > a parameter I forget. I am using Ubuntu 9.04 karmic koala and I did it > on Ubuntu 10.04 LTS. > I tried too add a menu item "Superuser Lazarus" -- "sudo lazarus" with a parameter I forget. I am using Ubuntu 9.04 karmic koala and I did it on Ubuntu 10.04 LTS. I am obviously not running Lazarus as a superuser in the correct manner. What is the command to run lazarus in superuser mode??? I want 2 menu items - one for regular use and one for superuser. Please tell me the command to use.

The super user should only be used to administration and to install programs that can not be changed by anyone else (to protect yourself).

Note: the guys at the computer shop advised me to run Lazarus with it's default config and NOT move the examples to the Home folder.

In general this correct.

But the lazarus examples are not shipped precompiled. They are only sources, so if you want to run them you must compile them first. They use as output directories a sub directory, which is write protected if you installed the examples as super user.
Eventually the IDE will check this and allow to redirect the output to a writable directory.
At the moment the easiest way is to simply copy the examples to anywhere in your home directory. For example copy the whole examples directory to your desktop directory. Then use lazarus to open the lpi file of one of the examples in your desktop directory and run it.

Show quoted text 6 lines
My code is in: Home/Public/lazarus_source_code with folders for each project.

ok

Mattias

Reply by email

Mattias Gärtner
to shoKwave: "sudo" is a command to be used on a console. For a menu-item or desktop-icon you can use…

Zitat von shoKwave :

Show quoted text 12 lines
Am 07.06.2010 12:15, schrieb Peter E Williams: > I am obviously not running Lazarus as a superuser in the correct manner. > What is the command to run lazarus in superuser mode??? I want 2 menu > items - one for regular use and one for superuser. Please tell me the > command to use. > Hi, "sudo" is a command to be used on a console. For a menu-item or desktop-icon you can use "gksu". gksu /usr/lib/lazarus/0.9.28.2/startlazarus

That's a terrible advice.

You'll have to set the paths in options again, because options are stored in user-directory.

Do not start Lazarus as super user!
In general: do not tell Linux newbies to start user programs as super user. They can damage their systems. Especially with programs like Lazarus that allows to write and run arbitrary programs.

Mattias

Reply by email

Henry Vermaak
to Mattias Gärtner: Zitat von Peter E Williams : The super user should only be used to administration and to…

2010/6/7 Mattias G?rtner :

But the lazarus examples are not shipped precompiled. They are only sources, so if you want to run them you must compile them first. They use as output directories a sub directory, which is write protected if you installed the examples as super user.

Shouldn't the examples (or indeed all of the source) be installed in /usr/local/src?

Henry

Reply by email

Graeme Geldenhuys
to Henry Vermaak
Henry Vermaak wrote
Shouldn't the examples (or indeed all of the source) be installed in /usr/local/src?

That will not make any difference. A standard user still doesn't have write access to that location.

As far as I know, even with other products like Qt, GTK, Delphi which includes demos and the system is installed in a multi-user environment. Then if you want to compile and run a demo, you first have to copy the demo source directory to a location you have read/write access, then compile and run it from that new location.

Maybe Lazarus IDE should clearly notify the user that on opening such a read-only project, that the location is indeed read-only, and the demo needs to be copied to a new location first. Maybe Lazarus IDE could do the copying as well, but personally I think that is too much spoon feeding. Copying a directory is something simple which any developer should know how to do.

This should apply for all multi-user systems: Windows, Linux, FreeBSD etc.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote
environment. Then if you want to compile and run a demo, you first have to copy the demo source directory to a location you have read/write access, then compile and run it from that new location.

Alternatively (though I don't really recommend this) is to default the demos output path to something like:

$(UserTempDir)/$(ProjName)/units/$(TargetCPU)-$(TargetOS)/

I prefer the copy method...

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gärtner
to Graeme Geldenhuys

Zitat von Graeme Geldenhuys :

Show quoted text 11 lines
On 07/06/2010, Graeme Geldenhuys wrote: > environment. Then if you want to compile and run a demo, you first > have to copy the demo source directory to a location you have > read/write access, then compile and run it from that new location. Alternatively (though I don't really recommend this) is to default the demos output path to something like: $(UserTempDir)/$(ProjName)/units/$(TargetCPU)-$(TargetOS)/ I prefer the copy method...

Keep in mind, that application bundle, manifest and other resource files must be generated there too. And some examples use externals files.

Mattias

Reply by email

Henry Vermaak
to Henry Vermaak: 2010/6/7 Mattias G?rtner : Shouldn't the examples (or indeed all of the source) be…
Henry Vermaak wrote 8 lines
2010/6/7 Mattias G?rtner : > But the lazarus examples are not shipped precompiled. They are only sources, > so if you want to run them you must compile them first. They use as output > directories a sub directory, which is write protected if you installed the > examples as super user. Shouldn't the examples (or indeed all of the source) be installed in /usr/local/src?

Sorry, I mean /usr/src. Just makes more sense to go looking for it there.

Henry

Reply by email

Henry Vermaak
to Graeme Geldenhuys: That will not make any difference. A standard user still doesn't have write access to…
Graeme Geldenhuys wrote 7 lines
On 07/06/2010, Henry Vermaak wrote: > > Shouldn't the examples (or indeed all of the source) be installed in > /usr/local/src? That will not make any difference. A standard user still doesn't have write access to that location.

Yes, I know that, that's not what I suggested it for. It's just the traditional place to put source, where people would go and look first. Putting examples in a directory writeable by everyone doesn't make any sense.

Show quoted text 5 lines
As far as I know, even with other products like Qt, GTK, Delphi which includes demos and the system is installed in a multi-user environment. Then if you want to compile and run a demo, you first have to copy the demo source directory to a location you have read/write access, then compile and run it from that new location.

Windows have the shared documents directory, which I believe is the correct place to put examples.

Henry

Reply by email

Graeme Geldenhuys
to Henry Vermaak: Sorry, I mean /usr/src. Just makes more sense to go looking for it there. Henry
Henry Vermaak wrote 5 lines
> > Shouldn't the examples (or indeed all of the source) be installed in > /usr/local/src? Sorry, I mean /usr/src. Just makes more sense to go looking for it there.

Isn't that meant for kernel source only? I only have kernel source in that directory, using Ubuntu 10.04.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Henry Vermaak
to Graeme Geldenhuys
Graeme Geldenhuys wrote 9 lines
On 07/06/2010, Henry Vermaak wrote: >> >> Shouldn't the examples (or indeed all of the source) be installed in >> /usr/local/src? > > Sorry, I mean /usr/src. ?Just makes more sense to go looking for it there. Isn't that meant for kernel source only? ?I only have kernel source in that directory, using Ubuntu 10.04.

No, I believe that *-source packages will usually install to /usr/src. See, for example, binutils:

http://packages.debian.org/lenny/all/binutils-source/filelist

Henry

Reply by email

waldo kitty
to Graeme Geldenhuys: Alternatively (though I don't really recommend this) is to default the demos output path…
Graeme Geldenhuys wrote 12 lines
On 07/06/2010, Graeme Geldenhuys wrote: > environment. Then if you want to compile and run a demo, you first > have to copy the demo source directory to a location you have > read/write access, then compile and run it from that new location. Alternatively (though I don't really recommend this) is to default the demos output path to something like: $(UserTempDir)/$(ProjName)/units/$(TargetCPU)-$(TargetOS)/ I prefer the copy method...

+1 on the copy method... because if the user has to copy it, they will then know where the output binary ends up without having to go hunt it down... maybe later they might define an output directory like you show but leave that to them for later...

Reply by email

waldo kitty
to Henry Vermaak: Yes, I know that, that's not what I suggested it for. It's just the traditional place to…
Henry Vermaak wrote 9 lines
On 7 June 2010 14:45, Graeme Geldenhuys wrote: > As far as I know, even with other products like Qt, GTK, Delphi which > includes demos and the system is installed in a multi-user > environment. Then if you want to compile and run a demo, you first > have to copy the demo source directory to a location you have > read/write access, then compile and run it from that new location. Windows have the shared documents directory, which I believe is the correct place to put examples.

how would you keep them from crashing into each other if more than one is working with the same demo at the same time?

Reply by email

Hans-Peter Diettrich
to Henry Vermaak: Yes, I know that, that's not what I suggested it for. It's just the traditional place to…
Show quoted text 9 lines
>> Shouldn't the examples (or indeed all of the source) be installed in >> /usr/local/src? > That will not make any difference. A standard user still doesn't have > write access to that location. Yes, I know that, that's not what I suggested it for. It's just the traditional place to put source, where people would go and look first. Putting examples in a directory writeable by everyone doesn't make any sense.

IMO we should assume single-user environments in the first place, because such users have the most problems with installation and access rights. In a multi-user environment the admin should be able to manage everything.

DoDi

Reply by email