FreePascal Error: Illegal parameter: -Opentium3

Published 5 January 9 11:44 AM | Phil Gilmore

FreePascalPhil Gilmore

I was trying to build an existing Delphi DLL as a 64-bit DLL using FreePascal 2.2.2.  I opened the .dpr file which is as simple as a DLL project can get.  I clicked Compile, then Build.  The build failed on line 0 with the error "Illegal parameter: -Opentium3".  This is frustrating to see on a fresh installation with a simple project (simple on the level of Hello-World).  I dug just a bit and found a bug tracker entry for it which provides some insight, but didn't really provide a resolution.  I have gleaned the resolution from the bug entry and provide a walk-through here.

Incidentally, if you try to build twice, the second and subsequent times will return a different error: "Unable to open file C:\...\fp.cfg".  This is because the first error interrupted the program and left the cfg file open.  You will have to close the IDE to release it.  Do not edit the cfg file as it states.  It is generated every time you build from the IDE.

Here is the bug entry:

http://bugs.freepascal.org/view.php?id=11865

As Marco van de Voort pointed out on that page, changing the -Opentium3 option to contain a double "p" will fix this issue.  It also shows that the problem has been resolved in the next version, 2.2.3 (which is not the current stable release as of this writing).  It also indicates that the problem was fixed in the previous version, but the fix did not proliferate to version 2.2.2 (I have not double-checked this).  Lastly, it indicates that this problem exists when Win32 (Windows XP). 

 

Steps to reproduce:

1) Open your FPC IDE.  Load a project to build.

2) From the menu, click Compile, then Build.

FPC Build Menu

3) You should see the failure in the build status dialog.

FPC Build status

4) Clear the build status dialog and you can see the error in the messages frame:

FPC Compiler Message

 

If you run this more than once, you will instead see the message:

"Unable to open file C:\...\fp.cfg"

See notes above.

 

Steps to resolution:

1) Open your FPC IDE.  Load a project to build.

2) From the menu, click Options, then Compiler....

FPC Compiler Options Menu

3) In the compiler options dialog, Find the additional compiler args field at the bottom.

FPC Pentium3 setting

Change the -Opentium3 to -Oppentium3 (with two "p"s). 

3) Click the OK button to close the dialog.

4) Close the IDE.

5) Repeat the "steps to reproduce" steps 1 and 2. 

6) You should now see a successful build dialog.

FPC Build succeeded

 

Happy coding.

Phil Gilmore (www.interactiveasp.net)

Comments

# Phil Gilmore said on February 18, 2009 3:46 PM:

The link that pointed me to this solution is the FPC bug tracker entry mentioned in the blog post.

bugs.freepascal.org/view.php

# RnzF said on June 7, 2009 11:24 PM:

Hi. I followed the steps but it didn't work on my computer. I tried it with a program, not a project. Is that the reason?