Sign in Join

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

Mailing lists / lazarus / 1999-05

objpas and linux

14 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

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

Michael Van Canneyt
to Peter Vreman: Please don't use the objpas unit directly in the uses clause. Please put a {$mode objfpc}…
Peter Vreman wrote 13 lines
Please don't use the objpas unit directly in the uses clause. Please put a {$mode objfpc} in top of the file. New compiler snapshots (starting tomorrow) will issue a warning. Also use the common pascal way to read a file instead of fdopen/fdread, so it can also be compiled for win32. If the linux unit is really need place it atleast between a {$ifdef linux}

Better yet:

FOR ALL LOW-LEVEL FILE/DISK/DATE STUFF, use the sysutils unit. It is 100% Delphi compatible, and exists on all platforms.

The reason FCL compiles on all platforms is because it uses the sysutils unit only !

In concreto:

fdOPen -> FileOpen/FileCreate
fdRead -> FileRead
fdWrite -> FileWrite
fdSeek -> FileSeek
fdTruncate -> FileTruncate

It also has many file-name handling functions:
ExtractFileName
ExtractFileExt
ExtractFilePath
ExtractFileDir
ExtractRelativePath (NOt in Delphi)
Which autmatically take care of / or \ issues and the like.

Using the sysutils unit for low-level stuff makes porting more easier.

Michael.

Reply by email

Michael A. Hess
to Cliff Baeseman: That is ok I will try that as for the objpas thing I tried that last night and TObject…
Cliff Baeseman wrote
That is ok I will try that as for the objpas thing I tried that last night and TObject could not be found. I had classes in the uses clause and fpcobj specified?

I assume you mean objfpc as in {$mode objfpc}.

Anyway I also added it to all the files last night and it did work. The only file I had problems with was the editor.pp file. When it tried to compile it it gave the TOBJECT undefined error. I solved this by moving the editor file to the very end of the uses clauses in the main.pp file. Why it made a difference being last I don't know but it would compile correctly when it was the very last file compiled. :-\

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Cliff Baeseman
to Michael A. Hess

Hmmmmmmmmmmm.....

I will try again this evening...

Cliff

Earlier message 32 lines
-----Original Message----- From: Michael A. Hess Sent: Friday, May 14, 1999 9:05 AM To: Subject: Re: [lazarus] objpas and linux Cliff Baeseman wrote: > > That is ok I will try that as for the objpas thing I tried that last > night and TObject could not be found. > I had classes in the uses clause and fpcobj specified? I assume you mean objfpc as in {$mode objfpc}. Anyway I also added it to all the files last night and it did work. The only file I had problems with was the editor.pp file. When it tried to compile it it gave the TOBJECT undefined error. I solved this by moving the editor file to the very end of the uses clauses in the main.pp file. Why it made a difference being last I don't know but it would compile correctly when it was the very last file compiled. :-\ -- ==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Cliff Baeseman
to Peter Vreman: Please don't use the objpas unit directly in the uses clause. Please put a {$mode objfpc}…

Ok but I absolutly have to use the linux unit for now to write out project files. I throw out of memory errors I
I use any of the FPC SaveToFile methods...

I think we should also ifdef the writeln stuff now with a debug directive...

Cliff

Earlier message 29 lines
-----Original Message----- From: Peter Vreman Sent: Thursday, May 13, 1999 4:20 PM To: Subject: [lazarus] objpas and linux Please don't use the objpas unit directly in the uses clause. Please put a {$mode objfpc} in top of the file. New compiler snapshots (starting tomorrow) will issue a warning. Also use the common pascal way to read a file instead of fdopen/fdread, so it can also be compiled for win32. If the linux unit is really need place it atleast between a {$ifdef linux} Peter _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Peter Vreman

Please don't use the objpas unit directly in the uses clause. Please put a

{$mode objfpc}

in top of the file.

New compiler snapshots (starting tomorrow) will issue a warning.

Also use the common pascal way to read a file instead of fdopen/fdread, so it can also be compiled for win32. If the linux unit is really need place it atleast between a {$ifdef linux}

Peter

Reply by email

Cliff Baeseman
to Michael Van Canneyt: Better yet: FOR ALL LOW-LEVEL FILE/DISK/DATE STUFF, use the sysutils unit. It is 100%…

That is ok I will try that as for the objpas thing I tried that last night and TObject could not be found.
I had classes in the uses clause and fpcobj specified?

Cliff

Earlier message 59 lines
-----Original Message----- From: Behalf Of Michael Van Canneyt Sent: Friday, May 14, 1999 4:23 AM To: Subject: Re: [lazarus] objpas and linux On Thu, 13 May 1999, Peter Vreman wrote: > > Please don't use the objpas unit directly in the uses clause. Please put a > > {$mode objfpc} > > in top of the file. > > New compiler snapshots (starting tomorrow) will issue a warning. > > > Also use the common pascal way to read a file instead of fdopen/fdread, so > it can also be compiled for win32. If the linux unit is really need place > it atleast between a {$ifdef linux} Better yet: FOR ALL LOW-LEVEL FILE/DISK/DATE STUFF, use the sysutils unit. It is 100% Delphi compatible, and exists on all platforms. The reason FCL compiles on all platforms is because it uses the sysutils unit only ! In concreto: fdOPen -> FileOpen/FileCreate fdRead -> FileRead fdWrite -> FileWrite fdSeek -> FileSeek fdTruncate -> FileTruncate It also has many file-name handling functions: ExtractFileName ExtractFileExt ExtractFilePath ExtractFileDir ExtractRelativePath (NOt in Delphi) Which autmatically take care of / or \ issues and the like. Using the sysutils unit for low-level stuff makes porting more easier. Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Michael Van Canneyt
to Cliff Baeseman
Cliff Baeseman wrote
That is ok I will try that as for the objpas thing I tried that last night and TObject could not be found. I had classes in the uses clause and fpcobj specified?

If it doesn't work, try giving -S2 as a command-line switch.

I commited changes to the CVS : The program now COMPILES on windows NT. I can't link, because I don't have gtk 1.2 here, but that should not form a problem.

So PLEASE do a cvs update before committing any changes, so you'll have my changes. The app can now in principle be run on win32 too !!

Michael.

Reply by email

Michael Van Canneyt
to Cliff Baeseman: This is cool maybe I will try to load fpc on my ntbox here at work... Cliff -----Original…
Cliff Baeseman wrote
This is cool maybe I will try to load fpc on my ntbox here at work...

I Installed the GTK dll's. This is the result:

---------------------------------------------------------- E:/pp/src/lazarus >lazarus
Created FMMain.....now what? GTk_Main?
Creating main form from TApplication
in the resize
An unhandled exception occurred at 00419076 :
Invalid pointer operation
----------------------------------------------------------

And that's it :-)

But it's a start. Anyway, enough playing for today. The FPC docs are waiting :-)

Michael.

Reply by email

Cliff Baeseman
to Michael Van Canneyt

I know why I will handle it if I load it here..

Cliff

Earlier message 36 lines
-----Original Message----- From: Behalf Of Michael Van Canneyt Sent: Friday, May 14, 1999 10:16 AM To: Subject: RE: [lazarus] On Fri, 14 May 1999, Cliff Baeseman wrote: > This is cool maybe I will try to load fpc on my ntbox here at work... I Installed the GTK dll's. This is the result: ---------------------------------------------------------- E:/pp/src/lazarus >lazarus Created FMMain.....now what? GTk_Main? Creating main form from TApplication in the resize An unhandled exception occurred at 00419076 : Invalid pointer operation ---------------------------------------------------------- And that's it :-) But it's a start. Anyway, enough playing for today. The FPC docs are waiting :-) Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Cliff Baeseman
to Michael Van Canneyt: If it doesn't work, try giving -S2 as a command-line switch. I commited changes to the…

You mean lazarus compiles win32?

I will do a co before adding any changes tonight..

Cliff

Earlier message 31 lines
-----Original Message----- From: Behalf Of Michael Van Canneyt Sent: Friday, May 14, 1999 9:08 AM To: Subject: RE: [lazarus] objpas and linux On Fri, 14 May 1999, Cliff Baeseman wrote: > That is ok I will try that as for the objpas thing I tried that last night > and TObject could not be found. > I had classes in the uses clause and fpcobj specified? If it doesn't work, try giving -S2 as a command-line switch. I commited changes to the CVS : The program now COMPILES on windows NT. I can't link, because I don't have gtk 1.2 here, but that should not form a problem. So PLEASE do a cvs update before committing any changes, so you'll have my changes. The app can now in principle be run on win32 too !! Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Mike Z.
to Michael Van Canneyt: I Installed the GTK dll's. This is the result:…

Have the linux unit file i/o calls been modified in project.pp or how are you getting this to compile under NT?

How frequently is the lazarus zip file updated on your web site?

mz.

you wrote 47 lines
I know why I will handle it if I load it here.. Cliff -----Original Message----- From: Behalf Of Michael Van Canneyt Sent: Friday, May 14, 1999 10:16 AM To: Subject: RE: [lazarus] On Fri, 14 May 1999, Cliff Baeseman wrote: > This is cool maybe I will try to load fpc on my ntbox here at work... I Installed the GTK dll's. This is the result: ---------------------------------------------------------- E:/pp/src/lazarus >lazarus Created FMMain.....now what? GTk_Main? Creating main form from TApplication in the resize An unhandled exception occurred at 00419076 : Invalid pointer operation ---------------------------------------------------------- And that's it :-) But it's a start. Anyway, enough playing for today. The FPC docs are waiting :-) Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Cliff Baeseman
to Michael Van Canneyt: No, I can compile lazarus on my windows NT box as a native WIN32 application. So we're…

This is cool maybe I will try to load fpc on my ntbox here at work...

Cliff

Earlier message 29 lines
-----Original Message----- From: Behalf Of Michael Van Canneyt Sent: Friday, May 14, 1999 9:52 AM To: Subject: RE: [lazarus] On Fri, 14 May 1999, Cliff Baeseman wrote: > You mean lazarus compiles win32? No, I can compile lazarus on my windows NT box as a native WIN32 application. So we're already cross-platform :-) > > I will do a co before adding any changes tonight.. Please do :-) Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Cliff Baeseman
to Mike Z.: Have the linux unit file i/o calls been modified in project.pp or how are you getting…

It is out of date right now the win 32 stuff is in the CVS.. I will sort these changes tonight and post a new copy.

cliff

Earlier message 67 lines
-----Original Message----- From: Mike Z. Sent: Friday, May 14, 1999 11:00 AM To: Subject: win32 was: RE: [lazarus] Have the linux unit file i/o calls been modified in project.pp or how are you getting this to compile under NT? How frequently is the lazarus zip file updated on your web site? mz. At 10:32 5/14/99 -0500, you wrote: >I know why I will handle it if I load it here.. > >Cliff > >-----Original Message----- >From: Behalf Of Michael Van >Canneyt >Sent: Friday, May 14, 1999 10:16 AM >To: >Subject: RE: [lazarus] > > > > >On Fri, 14 May 1999, Cliff Baeseman wrote: > >> This is cool maybe I will try to load fpc on my ntbox here at work... > >I Installed the GTK dll's. This is the result: > >---------------------------------------------------------- >E:/pp/src/lazarus >lazarus >Created FMMain.....now what? GTk_Main? >Creating main form from TApplication >in the resize >An unhandled exception occurred at 00419076 : >Invalid pointer operation >---------------------------------------------------------- > >And that's it :-) > >But it's a start. Anyway, enough playing for today. >The FPC docs are waiting :-) > >Michael. > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus > > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email