Sign in Join

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

Mailing lists / lazarus / 2015-07

Global Include search path?

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

tiOPF uses a tiDefines.inc include file in all its units. If I'm busy with another project and want to look something up in the tiOPF code, I can't jump from Interface to Implementation, because the IDE complains that the include file can't be found. I can to comment out the include line, then the code jumping works.

Is there a way to tell Lazarus IDE to ignore such errors, or to specify a global (IDE wide) Include search path. I tried adding a -Fi/path/to/tiopf/Core in my ~/.fpc.cfg but that didn't help.

=====================
unit tiThread_TST;
{$I tiDefines.inc}

interface
uses

   tiTestFrameWork;

...
...
=====================

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 11 lines
Hi, tiOPF uses a tiDefines.inc include file in all its units. If I'm busy with another project and want to look something up in the tiOPF code, I can't jump from Interface to Implementation, because the IDE complains that the include file can't be found. I can to comment out the include line, then the code jumping works. Is there a way to tell Lazarus IDE to ignore such errors, or to specify a global (IDE wide) Include search path. I tried adding a -Fi/path/to/tiopf/Core in my ~/.fpc.cfg but that didn't help.

Did you try adding {$INCLUDEPATH } to the unit ?

Also: if you change something to ~/.fpc.cfg, you should restart Lazarus. I have several defines in my ~/.fpc.cfg, and lazarus picks it up nicely after a restart.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt
Michael Van Canneyt wrote
Did you try adding {$INCLUDEPATH } to the unit ?

I don't fully understand. I added the the following to my ~/.fpc.cfg file:

# global Include search path
-Fi/data/devel/tiopf/Core

It is easy to reproduce (as I know you have the tiOPF source code). Open a new project (that doesn't depend on tiOPF), then go to File -> Open and open for example the tiObject.pas unit. Go to any class and see if the jump from Interface to Implementation works (Ctrl+Shift+Down). You should get an error on the {$I tiDefines.inc} line of the tiObject.pas unit.

Lazarus Messages window shows this:

Codetools, Errors: 1
tiThread_TST.pas(3,5) Error: include file not found "tiDefines.inc"
Also: if you change something to ~/.fpc.cfg, you should restart Lazarus. I have several defines in my ~/.fpc.cfg, and lazarus picks it up nicely after a restart.

Yes, I did restart Lazarus, but had no affect. From what you say it seems Lazarus detects compiler defines, but not Include search paths. :-/

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email