PDA

View Full Version : Frustrating problems



M109uk
05-09-2007, 11:55 PM
Hi,

I thought i would give lazarus a go since i would like to have a cross platform engine, how ever im hitting nothing except problems with it, and im just woundering if its common problems with simple solutions or if i should'nt bother with lazarus.

the first and biggest problem is i can not build or run my engine in lazarus, i keep getting an error saying:

Unable to find file "".
Check search path in
Project>...........

i have all the search paths i need for my project already in the "other unit Files" field, and no matter which field i put it in nothing changes... am i missing something here?

secondly is a problem that is starting to make me pull my hair out, when i complie my engine it complains that it can not find a unit, the missing unit is in the same directory as all my other unit. then after a few changes to figure out why, now it reports that the missing unit is declared in the missing unit itself... at this point im more than confused...

any help will be great.

WILL
06-09-2007, 03:28 AM
Actually I think that you'll find that Lazarus is great once you get to using it often.

The problems that you describe seem fairly uncommon. At least from my experience and I've been using it for the past couple of years now. It may have something to do with the way you have your program put together.

To actually help you out though, I'll need to know a bit more.

:arrow: What path did you install Lazarus to? -- Common mistake is to install it to where there are spaces in the installation path. ie. "C:\Program Files\Lazarus\" is not possible. Instead make sure that it is installed to "C:\lazarus\". This is not a limitation of Lazarus OR FPC, but in fact that of the GNU tools.

:arrow: What OS are you running? Lazarus can run on a ton of OS combinations. Including Vista, but there may be some issues there that I wouldn't know of.

:arrow: Does the unit names in the code match the filenames themselves? This caps and all?

:arrow: In the Compiler Options window in the 'Paths' tab; Did you type in the full path to your units or relative? And did you make sure that the paths actually exist? If you use the '...' buttons on the side it will take you to a tool where it generates this list for you if you didn't find that yet.

If for some reason these units require .inc include files the input field below it is obviously where they will need to be entered. This is the case for libraries like JEDI-SDL for example.

:arrow: How did you create the project files for your existing Delphi project? This might have played a role in your troubles. I'm not an expert in converting from D-to-L, I just cut and paste my code into a new framework each time, but I'm sure there are others that know more about this that can help if that is what you are trying to do.


TIP: If you are coming from a Delphi background (like me) it would be recommended that you got into Project -> Compiler Options... and go under the 'Parsing' tab. There you will see a checkbox for 'Delphi Compatible (-Sd)'. Go ahead and check it. This will help you get by a lot of Delphi-centric things in your existing code and if you are in the habit of doing things a specific way thats the 'Borland way' then it'll help with that too.


Well based on what you wrote this is as much as I can think of to help you at this point. Feel free to elaborate or just provide some code so we can see whats going on on your end.

M109uk
06-09-2007, 09:28 AM
Thanks for the reply :)

Yeah, i have noticed there are a few things that i still have to get used to, such as not having global environment paths and such :)

I have managed to solve the problem with it not being able to find a unit, it was because i had several inc files which looked like {$i 'Lights\DynamicLights.inc} as soon as i took the inc files out of the Lights directory it seemed to work fine.

I have lazarus installed under D:\lazarus and my OS is vista (i hav'nt tried on ubuntu yet)

Can my project files directories have spaces in them?
my project directory is: "D:\pascal\My Software\Omega-R\src".

At first i tried to convert it from Delphi, but that gave me soooo many headaches because of the extra propertise in delphi forms/components, so in the end i decided to start from a fresh lazarus project, but still using most of the Delphi units.

Thanks i will turn on delphi compatability..

Im also getting a lot of errors concerning duplicate variables...
for example:

dowhat: String;
function DoSomething(const dowhat: String): Boolean;

i get the error on the "dowhat" in the function. is there a way around this as i have soooo many functions like this im hoping not to change them all.

many thanks

WILL
06-09-2007, 10:07 AM
Can my project files directories have spaces in them?
my project directory is: "D:\pascal\My Software\Omega-R\src".

Oh yeah, thats perfectly fine, it's just the core units and RTL that need to be in a space-less path. All of your project paths can have spaces if you so choose.


At first i tried to convert it from Delphi, but that gave me soooo many headaches because of the extra propertise in delphi forms/components, so in the end i decided to start from a fresh lazarus project, but still using most of the Delphi units.

Yeah, thats what I do... it's almost easier than messing around with tools to do what you can just manually do in an hour or less between an open instance of Delphi and Lazarus.

One of the nice things about Lazarus is that you can choose a starting template that gets rid of all the GUI junk you won't need. Just choose 'Program' or 'Custom Program' under 'Project'. ;)


Thanks i will turn on delphi compatability..

Note that this is a FPC setting not a Laz setting. Only the source will be compatible. All VCL components will have to be redone with LCL components instead. Though they do a decent job of making them quite similar if not a tad better in some ways.


Im also getting a lot of errors concerning duplicate variables...
for example:

dowhat: String;
function DoSomething(const dowhat: String): Boolean;

i get the error on the "dowhat" in the function. is there a way around this as i have soooo many functions like this im hoping not to change them all.

Not sure on this one... Doesn't setting Delphi Compatibility mode on clear it up? This would definitely be a FPC question...

M109uk
07-09-2007, 12:19 PM
Great thanks for the help,
everything mostly seems to be working :)

the only problem is the several internal errors.. is there any way to find out exactly what the errors are?

thanks

marcov
28-10-2007, 12:23 PM
Afaik 2.2 solves the 'spaces" problem.

Internal errors are FPC bugs. They are like asserts.

Try to replicate them in a small program and file a bug.