Compile a *.pas

Posted on 2006-05-13
Last Modified: 2008-02-01
Hi. I've got several problems made in Turbo Pascal. I need to compile them from *.pas to *.exe
My project it's like this:
got the source in a memo  -> export the source in to a .pas file where ever i want and after then compile it to make an exe.
I tryed using dcc32 from \..\delphi\bin, but it exports me an 2 kb exe wich handle's a runtime error 2. and it closes.

Thanks for help ;)
Question by:A. Cristian Csiki
    LVL 4

    Expert Comment

    Hi nodramas,

    Are you using TurboPascal or are you coding in Delphi?
    LVL 11

    Author Comment

    by:A. Cristian Csiki
    i'm using delphi 7. And i need to compile a .pas file exported from a memo from a delphi application.
    LVL 28

    Accepted Solution

    so the pas files are fomr turbo pascal and your application is written in delphi 7. si that so?
    if yes, then you will need the turbo pascal compiler available: tpc.exe for turbo pascal or bpc.exe for borland pascal
    depending on your needs, you might want to check out the command line compiler options (just run tpc or bpc withoiut any parameters and they will output the command switches)
    you could also compile using dcc32. but you will have to specify to the compiler to compile in console mode: the -CC command line switch
    LVL 11

    Author Comment

    by:A. Cristian Csiki
    yes ciuly..both mothods works grate, but compiling using dcc32 it's better...because i use only dcc32.exe , SysInit.pas(and dcu one) and System.pas(and dcu one) and compiles very good.
    But why it didn't worked with this:  dcc32 test -txexe   from delphi's help???

    Thanks very much. I appreciate. ;)
    LVL 28

    Expert Comment

    because by default it tries to compile a win application, but the pascal sources are for console applications and have no dupport for win application (you must inlude forms.pas so that the application can receive windows messages ;) )

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
    Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now