How to compile an existing dll ? lazarus / 13-General ---------------------------------------------------------------------- 440bx · 2019-02-16 09:06 Hello, If I needed proof that I am a Lazarus noobie, I just got it... . Here is the situation: I have a program named "MyProg.lpr", everything works as expected when I open that lpr file in Lazarus. I also have a dll named "MyProgDll.lpr" in the same directory.  When I open it with Lazarus, Lazarus shows the entire file as if every line is a comment.   If I try to compile "MyProgDll.lpr", Lazarus compiles "MyProg.lpr" instead. The obvious question is: how do I get Lazarus to compile my DLL ?  (note, this is existing code I'm porting from Delphi 2 - I've been tempted to tell Lazarus to start a new "Library" and cut and paste from the current file to the file created by Lazarus but, there must be a less pedestrian way of getting Lazarus to compile an existing dll.) Thank you for your help. ETA: I figured out what was happening.  Ignore this post.  I tried to delete it but I wasn't allowed to. ---------------------------------------------------------------------- lucamar · 2019-02-16 12:05 Do you mind telling us in which pit did you fall, just in case it happens to someone else? ---------------------------------------------------------------------- 440bx · 2019-02-16 13:17 Quote from: lucamar on February 16, 2019, 01:05:24 pmDo you mind telling us in which pit did you fall, just in case it happens to someone else? No problem.  I was compiling a Delphi 2 program and dll I wrote many years ago.  First thing I did was recompile both with Delphi.  Delphi compiled both without any problems.  This is just to establish that it had just been compiled successfully. I customarily put a description of the program at the very top (or very close to the top) and there was an unmatched "{" in there.  It didn't bother Delphi but, Lazarus and FPC didn't like it at all. My guess is that Delphi ignores "superfluous" braces while, obviously, Lazarus and FPC do not.  The problem was a bit disconcerting because I had just successfully compiled both.  The fact that Lazarus would see the entire file as a comment (it did not give any error or warning about an unmatched brace) made me have another look and attempt to find out why.  That's when I noticed there was an unmatched brace inside the description at the top.  Removing it solved the problem.  That brace had been there for over ten years before causing a problem.  Amazing. ---------------------------------------------------------------------- Thaddy · 2019-02-16 13:52 freepascal will also ignore superfluous braces in both delphi modes. But in mode objfpc {$modeswitch nestedcomments} is active....