Recent

Author Topic: manipulate lazarus with cmd  (Read 991 times)

JunPham

  • Newbie
  • Posts: 3
manipulate lazarus with cmd
« on: February 09, 2019, 01:21:05 pm »
Hello guys
My English is not good so there will be some confusing places.Actually, I just started working with lazarus, before I worked with FreePascal.I want to ask if anyone knows how to create a project from cmd?Thank guys.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6918
Re: manipulate lazarus with cmd
« Reply #1 on: February 09, 2019, 01:30:13 pm »
Rename the source file to .lpr, choose "open project" in the menu, and when the IDE asks if you want to create a project, say yes and choose "simple project".

The review {$mode fpc/delphi/objfpc} directives to force the source in the correct mode. The default mode of fpc is {$mode fpc} but Lazarus new source is usually {$mode objfpc}

JunPham

  • Newbie
  • Posts: 3
Re: manipulate lazarus with cmd
« Reply #2 on: February 09, 2019, 03:00:55 pm »
Must open IDE? I do not want to open the IDE but can still create the project

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6918
Re: manipulate lazarus with cmd
« Reply #3 on: February 09, 2019, 03:12:15 pm »
If you don't use the IDE, you don't need a project.

Just execute the compiler on your main module and set search and includepath parameters (-Fi and -Fu).

JunPham

  • Newbie
  • Posts: 3
Re: manipulate lazarus with cmd
« Reply #4 on: February 10, 2019, 07:06:14 am »
In fact, after creating the lazarus project, I write code on the vscode. I don't want to have to open the IDE to create the project and then turn it off and open the vscode, very time consuming.

Handoko

  • Hero Member
  • *****
  • Posts: 2983
  • My goal: build my own game engine using Lazarus
Re: manipulate lazarus with cmd
« Reply #5 on: February 10, 2019, 09:53:07 am »
You can use the Lazarus IDE, it is good for developing GUI projects. Lazarus IDE can also be used for developing console applications.

You can also use Free Pascal IDE, which is text-based IDE. As far as I know the Free Pascal IDE is bundled on the default Free Pascal installation, you just need to type FP [enter] (in your command prompt).

Both Lazarus and Free Pascal IDE are great IDE. Is there any reason why you avoid them but use 'pure' command prompt only?

Bart

  • Hero Member
  • *****
  • Posts: 3378
    • Bart en Mariska's Webstek
Re: manipulate lazarus with cmd
« Reply #6 on: February 10, 2019, 01:22:40 pm »
Apparently TS uses Visual Studio Code as editor.
Maybe there are extions for fpc for that, I don't know.
Why you would be OK to use vscode for programming pascal, but refuse to use either FP or Lazarus IDE is beyond me though.

Bart

Thaddy

  • Hero Member
  • *****
  • Posts: 7798
Re: manipulate lazarus with cmd
« Reply #7 on: February 10, 2019, 01:36:47 pm »
http://omnipascal.com/ is one example, Bart.
I personally do not like it and abandoned it.

You need to setup the compiler as Marco indicated, but I had varying success with it.
Using it with Lazarus created projects is cumbersome. It is imo only suited for Freepascal sec.
« Last Edit: February 10, 2019, 01:38:51 pm by Thaddy »
Ad Brexinitum (can't help it)