Sign in Join

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

Mailing lists / fpc-devel / 2008-07

Compilation of {$I \dir1\...\dirn\x.pas } statements by FPC is NOT consistent .

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Mehmet Erol Sanliturk

Dear Sirs ,

Compilation of sources having {$I \dir1\dir2\x.pas } kind statements are not giving the same compilation results by the FPC.EXE 2.2.2rc2 and FPC 2.2.0 .

Assume that there are the following directory structures :

Directory of C:\a

07/19/2008 01:17 PM <DIR> .
07/19/2008 01:17 PM <DIR> ..
07/19/2008 01:36 PM <DIR> B
07/19/2008 01:19 PM <DIR> C
07/19/2008 01:21 PM <DIR> D
0 File(s) 0 bytes

Directory of C:\a\B

07/19/2008 01:36 PM <DIR> .
07/19/2008 01:36 PM <DIR> ..
07/19/2008 01:18 PM 129 CHEERS.PAS
07/19/2008 01:18 PM 161 HELLO-WORLD.PAS 2 File(s) 290 bytes

Directory of C:\a\C

07/19/2008 01:19 PM <DIR> .
07/19/2008 01:19 PM <DIR> ..
07/19/2008 01:10 PM 95 CHEERS-WELCOME.PAS 07/19/2008 01:13 PM 238 HELLOS.PAS
2 File(s) 333 bytes

Directory of C:\a\D

07/19/2008 01:21 PM <DIR> .
07/19/2008 01:21 PM <DIR> ..
07/19/2008 01:18 PM 161 HELLO-WORLD.PAS 1 File(s) 161 bytes

Directory of C:\b

07/19/2008 01:46 PM <DIR> .
07/19/2008 01:46 PM <DIR> ..
07/19/2008 01:18 PM 161 HELLO-WORLD.PAS 1 File(s) 161 bytes

Directory of C:\e

07/19/2008 01:34 PM <DIR> .
07/19/2008 01:34 PM <DIR> ..
07/19/2008 01:18 PM 161 HELLO-WORLD.PAS 1 File(s) 161 bytes

-------------------------------------------------------------------

The source "HELLO-WORLD.PAS" is the same in all of the directories :

Program Hello ;
Uses
    Cheers ;
{$I \A\C\Hellos.PAS }
Begin

Say_Hello
(
3

              ) ;

End .

-------------------------------------------------------------------

The source "\A\B\Cheers.PAS" is as follows :

Unit Cheers ;
Interface
Procedure Is_it_Problem ;
Implementation
{$I \A\C\Cheers-Welcome.PAS }

End .

-------------------------------------------------------------------

The source "\A\C\Cheers-Welcome.PAS" is as follows :

Procedure Is_it_Problem ;
Begin
Writeln ( 'Is there a problem ?' ) ;
End ;

-------------------------------------------------------------------

The source "\A\C\Hellos.PAS" is as follows :

Procedure Say_Hello
(
n : Integer

              ) ;
Var i : Integer ;
Begin
For i := 1 to N
Do
  Begin
  Writeln ( i , ' : ' , 'Hello , world .' ) ;
  Is_it_Problem ;
  End ;
End ;

-------------------------------------------------------------------

The compilation of "\a\b\HELLO-WORLD.PAS" is giving the following results :

c:\a\b > fpc -Fu\a\b hello-world.pas
c:\a\b > fpc hello-world.pas
:

Free Pascal Compiler version 2.2.2rc2 [2008/07/12] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling hello-world.pas
Compiling CHEERS.PAS
Linking hello-world.exe
57 lines compiled, 0.1 sec , 24112 bytes code, 1308 bytes data

The above compilation generated following parts :

\A\B\Cheers.PPU
\A\B\Cheers.O

-------------------------------------------------------------------

The compilation of "\a\d\HELLO-WORLD.PAS" is giving the following results :

c:\a\d > fpc -Fu\a\b hello-world.pas
:

Free Pascal Compiler version 2.2.2rc2 [2008/07/12] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling hello-world.pas
Linking hello-world.exe
35 lines compiled, 0.1 sec , 24112 bytes code, 1308 bytes data

-------------------------------------------------------------------

The compilation of "\b\HELLO-WORLD.PAS" is giving the following results :

c:\b > fpc -Fu\a\b hello-world.pas
:

Free Pascal Compiler version 2.2.2rc2 [2008/07/12] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling hello-world.pas
Linking hello-world.exe
35 lines compiled, 0.1 sec , 24112 bytes code, 1308 bytes data

-------------------------------------------------------------------

The compilation of "\e\HELLO-WORLD.PAS" is giving the following results :

c:\e > fpc -Fu\a\b hello-world.pas
:

Free Pascal Compiler version 2.2.2rc2 [2008/07/12] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling hello-world.pas
Linking hello-world.exe
35 lines compiled, 0.1 sec , 24112 bytes code, 1308 bytes data

-------------------------------------------------------------------

Now let's delete the following parts :

\A\B\Cheers.PPU
\A\B\Cheers.O

Let's re-compile "Hello-World.PAS" after this deletion in the directories : c:\a\d , c:\b , and c:\e
WITHOUT first compilation in c:\a\b where unit CHEERS.PAS stays :

-------------------------------------------------------------------

The compilation of "\a\d\HELLO-WORLD.PAS" is giving the following results :

c:\a\d > fpc -Fu\a\b hello-world.pas
:

Free Pascal Compiler version 2.2.2rc2 [2008/07/12] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling hello-world.pas
Compiling C:\a\b\CHEERS.PAS
CHEERS.PAS(10,2) Fatal: Can't open include file "\A\C\Cheers-Welcome.PAS" Fatal: Compilation aborted
Error: C:\fpc\2.2.2rc2\bin\i386-win32\ppc386.exe returned an error exitcode (normal if you did not specify a source file to be compiled)

-------------------------------------------------------------------

The compilation of "\b\HELLO-WORLD.PAS" is giving the following results :

c:\b > fpc -Fu\a\b hello-world.pas
:

Free Pascal Compiler version 2.2.2rc2 [2008/07/12] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling hello-world.pas
Compiling C:\a\b\CHEERS.PAS
CHEERS.PAS(10,2) Fatal: Can't open include file "\A\C\Cheers-Welcome.PAS" Fatal: Compilation aborted
Error: c:\fpc\2.2.2rc2\bin\i386-win32\ppc386.exe returned an error exitcode (normal if you did not specify a source file to be compiled)

-------------------------------------------------------------------

The compilation of "\e\HELLO-WORLD.PAS" is giving the following results :

c:\e > fpc -Fu\a\b hello-world.pas
:

Free Pascal Compiler version 2.2.2rc2 [2008/07/12] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling hello-world.pas
Compiling C:\a\b\CHEERS.PAS
CHEERS.PAS(10,2) Fatal: Can't open include file "\A\C\Cheers-Welcome.PAS" Fatal: Compilation aborted
Error: c:\fpc\2.2.2rc2\bin\i386-win32\ppc386.exe returned an error exitcode (normal if you did not specify a source file to be compiled)

-------------------------------------------------------------------

CONCLUSION : Compilation of {$I \dir1\dir2\...\dirn\x.pas } statements are NOT
consistent with respect to changing order of compilation or presence of
compiled parts in the sense that when FPC starts to compile a unit which is NOT
in the current directory , it is NOT able to find
completely specified paths
of included files when they are NOT showing the current directory
( when *.ppu and/or *.o does NOT exist ) .

Thank you very much ,

Mehmet Erol Sanliturk

Reply by email

Roozbeh GHolizadeh
to Mehmet Erol Sanliturk

Hi,
i have a dll compiled with fpc which i load it from my another dll compiled with vc++ using loadlibrary function. So far there was no problem,but with winmo 6.1 using loadlibrary will cause crashes and return NULL.so it doesnt load it at all!

I was wondering how can i pinpoint the problem.
my dll,uses units with initialization sections,could if any crash happen there causes library not to load?

because i guess loading library doesnt do anything but just moving it into memory space?(or does those initialization sectiors end up in dllmain,attach_process?)

So?

Regards,
Roozbeh GHolizadeh

Reply by email

Carolos
to Roozbeh GHolizadeh

Out of interest, what switches are you using to compile dll?

Roozbeh GHolizadeh wrote 25 lines
Hi, i have a dll compiled with fpc which i load it from my another dll compiled with vc++ using loadlibrary function. So far there was no problem,but with winmo 6.1 using loadlibrary will cause crashes and return NULL.so it doesnt load it at all! I was wondering how can i pinpoint the problem. my dll,uses units with initialization sections,could if any crash happen there causes library not to load? because i guess loading library doesnt do anything but just moving it into memory space?(or does those initialization sectiors end up in dllmain,attach_process?) So? Regards, Roozbeh GHolizadeh _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Roozbeh GHolizadeh
to Carolos

nothing special just default options,but i guess i have built all my libraris with -g option.

--- On Sun, 7/20/08, Carolos wrote:

Earlier message 29 lines
From: Carolos Subject: Re: [fpc-devel] winmobile 6.1 problem? To: "FPC developers' list" Date: Sunday, July 20, 2008, 7:50 PM Out of interest, what switches are you using to compile dll? On Sun, Jul 20, 2008 at 12:23 PM, Roozbeh GHolizadeh wrote: Hi, i have a dll compiled with fpc which i load it from my another dll compiled with vc++ using loadlibrary function. So far there was no problem,but with winmo 6.1 using loadlibrary will cause crashes and return NULL.so it doesnt load it at all! I was wondering how can i pinpoint the problem. my dll,uses units with initialization sections,could if any crash happen there causes library not to load? because i guess loading library doesnt do anything but just moving it into memory space?(or does those initialization sectiors end up in dllmain,attach_process?) So? Regards, Roozbeh GHolizadeh

Reply by email

Roozbeh GHolizadeh
to Carolos: Out of interest, what switches are you using to compile dll? On Sun, Jul 20, 2008 at…

Well,i come to this.
dlls built with fpc does not work under wm6.1.
i am using ppcrossarm 2.3.1 from todays svn
building simple dll with one export function and linking to it all with fpc,makes program not to run under wm6.1,but works fine under older oses!

so?

--- On Sun, 7/20/08, Carolos wrote:

Earlier message 29 lines
From: Carolos Subject: Re: [fpc-devel] winmobile 6.1 problem? To: "FPC developers' list" Date: Sunday, July 20, 2008, 7:50 PM Out of interest, what switches are you using to compile dll? On Sun, Jul 20, 2008 at 12:23 PM, Roozbeh GHolizadeh wrote: Hi, i have a dll compiled with fpc which i load it from my another dll compiled with vc++ using loadlibrary function. So far there was no problem,but with winmo 6.1 using loadlibrary will cause crashes and return NULL.so it doesnt load it at all! I was wondering how can i pinpoint the problem. my dll,uses units with initialization sections,could if any crash happen there causes library not to load? because i guess loading library doesnt do anything but just moving it into memory space?(or does those initialization sectiors end up in dllmain,attach_process?) So? Regards, Roozbeh GHolizadeh

Reply by email

Roozbeh GHolizadeh
to Carolos: Out of interest, what switches are you using to compile dll? On Sun, Jul 20, 2008 at…

i have downloaded fpc 2.2.0 from site,and used it to build the simple dll and program. first it complains about no "as" tool found.
dont know hwy i get this,but anyway i renamed arm-wince-as to as and again winmo 6.1 does not run the result files!

--- On Sun, 7/20/08, Carolos wrote:

Earlier message 29 lines
From: Carolos Subject: Re: [fpc-devel] winmobile 6.1 problem? To: "FPC developers' list" Date: Sunday, July 20, 2008, 7:50 PM Out of interest, what switches are you using to compile dll? On Sun, Jul 20, 2008 at 12:23 PM, Roozbeh GHolizadeh wrote: Hi, i have a dll compiled with fpc which i load it from my another dll compiled with vc++ using loadlibrary function. So far there was no problem,but with winmo 6.1 using loadlibrary will cause crashes and return NULL.so it doesnt load it at all! I was wondering how can i pinpoint the problem. my dll,uses units with initialization sections,could if any crash happen there causes library not to load? because i guess loading library doesnt do anything but just moving it into memory space?(or does those initialization sectiors end up in dllmain,attach_process?) So? Regards, Roozbeh GHolizadeh

Reply by email

Yury Sidorov
to Roozbeh GHolizadeh: Well,i come to this. dlls built with fpc does not work under wm6.1. i am using ppcrossarm…

Hi,

I fixed the problem in rev. 11421.

Funny thing that I started to investigate this problem in morning today before your e-mails :)

Not funny thing is that took whole day to find out what caused the problem :(

Damn WM6.1!!!

Yury.

Earlier message 51 lines
----- Original Message ----- From: Roozbeh GHolizadeh To: FPC developers' list Sent: Sunday, July 20, 2008 9:37 PM Subject: Re: [fpc-devel] winmobile 6.1 problem? Well,i come to this. dlls built with fpc does not work under wm6.1. i am using ppcrossarm 2.3.1 from todays svn building simple dll with one export function and linking to it all with fpc,makes program not to run under wm6.1,but works fine under older oses! so? --- On Sun, 7/20/08, Carolos wrote: From: Carolos Subject: Re: [fpc-devel] winmobile 6.1 problem? To: "FPC developers' list" Date: Sunday, July 20, 2008, 7:50 PM Out of interest, what switches are you using to compile dll? On Sun, Jul 20, 2008 at 12:23 PM, Roozbeh GHolizadeh wrote: Hi, i have a dll compiled with fpc which i load it from my another dll compiled with vc++ using loadlibrary function. So far there was no problem,but with winmo 6.1 using loadlibrary will cause crashes and return NULL.so it doesnt load it at all! I was wondering how can i pinpoint the problem. my dll,uses units with initialization sections,could if any crash happen there causes library not to load? because i guess loading library doesnt do anything but just moving it into memory space?(or does those initialization sectiors end up in dllmain,attach_process?) So? Regards, Roozbeh GHolizadeh

Reply by email

Roozbeh GHolizadeh
to Yury Sidorov

Thanks,
by the way why i need to define VER2_2 to compile successfully compiler? it gives me error in base.inc file,i have to define that,although my compiler version is 2.3.1

--- On Mon, 7/21/08, Yury Sidorov wrote:

Earlier message 70 lines
From: Yury Sidorov Subject: Re: [fpc-devel] winmobile 6.1 problem? To: "FPC developers' list" Date: Monday, July 21, 2008, 1:23 AM Hi, I fixed the problem in rev. 11421. Funny thing that I started to investigate this problem in morning today before your e-mails :) Not funny thing is that took whole day to find out what caused the problem :( Damn WM6.1!!! Yury. ----- Original Message ----- From: Roozbeh GHolizadeh To: FPC developers' list Sent: Sunday, July 20, 2008 9:37 PM Subject: Re: [fpc-devel] winmobile 6.1 problem? Well,i come to this. dlls built with fpc does not work under wm6.1. i am using ppcrossarm 2.3.1 from todays svn building simple dll with one export function and linking to it all with fpc,makes program not to run under wm6.1,but works fine under older oses! so? --- On Sun, 7/20/08, Carolos wrote: From: Carolos Subject: Re: [fpc-devel] winmobile 6.1 problem? To: "FPC developers' list" Date: Sunday, July 20, 2008, 7:50 PM Out of interest, what switches are you using to compile dll? On Sun, Jul 20, 2008 at 12:23 PM, Roozbeh GHolizadeh wrote: Hi, i have a dll compiled with fpc which i load it from my another dll compiled with vc++ using loadlibrary function. So far there was no problem,but with winmo 6.1 using loadlibrary will cause crashes and return NULL.so it doesnt load it at all! I was wondering how can i pinpoint the problem. my dll,uses units with initialization sections,could if any crash happen there causes library not to load? because i guess loading library doesnt do anything but just moving it into memory space?(or does those initialization sectiors end up in dllmain,attach_process?) So? Regards, Roozbeh GHolizadeh

Reply by email

Yury Sidorov
to Roozbeh GHolizadeh

No idea.
I use FPC 2.2.0 as starting compiler for 'make cycle' and it works.

Yury.

Earlier message 32 lines
----- Original Message ----- From: Roozbeh GHolizadeh To: FPC developers' list Sent: Monday, July 21, 2008 10:20 AM Subject: Re: [fpc-devel] winmobile 6.1 problem? Thanks, by the way why i need to define VER2_2 to compile successfully compiler? it gives me error in base.inc file,i have to define that,although my compiler version is 2.3.1 --- On Mon, 7/21/08, Yury Sidorov wrote: From: Yury Sidorov Subject: Re: [fpc-devel] winmobile 6.1 problem? To: "FPC developers' list" Date: Monday, July 21, 2008, 1:23 AM Hi,I fixed the problem in rev. 11421.Funny thing that I started to investigate this problem in morning today before your e-mails :)Not funny thing is that took whole day to find out what caused the problem :(Damn WM6.1!!!Yury.----- Original Message ----- From: Roozbeh GHolizadehTo: FPC developers' listSent: Sunday, July 20, 2008 9:37 PMSubject: Re: [fpc-devel] winmobile 6.1 problem?Well,i come to this.dlls built with fpc does not work under wm6.1.i am using ppcrossarm 2.3.1 from todays svnbuilding simple dll with one export function and linking to it all with fpc,makes program not to run under wm6.1,but works fine under older oses!so?--- On Sun, 7/20/08, Carolos wrote:From: Carolos Subject: Re: [fpc-devel] winmobile 6.1 problem?To: "FPC developers' list" Date: Sunday, July 20, 2008, 7:50 PMOut of interest, what switches are you using to compile dll?On Sun, Jul 20, 2008 at 12:23 PM, Roozbeh GHolizadeh wrote:Hi,i have a dll compiled with fpc which i load it from my another dll compiled with vc++ using loadlibrary function.So far there was no problem,but with winmo 6.1 using loadlibrary will cause crashes and return NULL.so it doesnt load it at all!I was wondering how can i pinpoint the problem.my dll,uses units with initialization sections,could if any crash happen there causes library not to load?because i guess loading library doesnt do anything but just moving it into memory space?(or does those initialization sectiors end up in dllmain,attach_process?)So?Regards,Roozbeh GHolizadeh_______________________________________________fpc-devel maillist - maillist - maillist - _______________________________________________fpc-devel maillist - --------------------------------------------------------------------------------

Reply by email