Sign in Join

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

Mailing lists / fpc-pascal / 2012-05

Handling with sources and exebutables with different names

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

luciano de souza

hello all,

I am compiling CGI modules with Freepascal in commandline mode. if I do:

fpc test.pas

the result is "test.exe". But the source name needs to be different from the executable name. For this reason:

fpc test.pas -oindex.cgi

This command should result in index.cgi, placed on the current folder. However, this command is ignore and I obtain "test.exe" again.

My question is: how to produce a executable, compiling from the commandline in FPC 2.6.0, with a different name of its source?

Regards,

Luciano

Reply by email

Sven Barth
to luciano de souza
luciano de souza wrote 16 lines
hello all, I am compiling CGI modules with Freepascal in commandline mode. if I do: fpc test.pas the result is "test.exe". But the source name needs to be different from the executable name. For this reason: fpc test.pas -oindex.cgi This command should result in index.cgi, placed on the current folder. However, this command is ignore and I obtain "test.exe" again. My question is: how to produce a executable, compiling from the commandline in FPC 2.6.0, with a different name of its source?

The above DOES work. Maybe your shell bites you and you need to qoute the option ( => "-oindex.cgi"). Did the compiler write something like the following?

Warning: Only one source file supported, changing source file to compile from ".cgi" into "test.pas"

Regards,
Sven

Reply by email

Michael Van Canneyt
to luciano de souza: I am compiling CGI modules with Freepascal in commandline mode. if I do: fpc test.pas the…
luciano de souza wrote 13 lines
hello all, I am compiling CGI modules with Freepascal in commandline mode. if I do: fpc test.pas the result is "test.exe". But the source name needs to be different from the executable name. For this reason: fpc test.pas -oindex.cgi This command should result in index.cgi, placed on the current folder. However, this command is ignore and I obtain "test.exe" again.

Hm. This should work correctly.

On linux, it gives the correct output.

I use it on windows too, and it has always worked correctly. I use it for fcgi binaries every day.

Try more verbose output, maybe you'll learn something from it.

Michael.

Reply by email

luciano de souza
to luciano de souza: I am compiling CGI modules with Freepascal in commandline mode. if I do: fpc test.pas the…

Actually, there are no errors.

Using cmd.exe on Windows 7 and FPC 2.6.0, I did:

fpc test.pas -oindex.cgi

I got test.exe and no errors are raised.

We can do -d in the commandline or {$ifdef ..} in the source code. Several other options are available from the two modes. Is there a directive, placeable in code, allowing me to define a name for the executable?

I am asking to myself: "Did I become crazy? Have I done the test wrongly?" Yes, it can be. However, I did it several times with the same result. I don't know what, but something misleading is wrong.

2012/5/17, luciano de souza :

Show quoted text 21 lines
hello all, I am compiling CGI modules with Freepascal in commandline mode. if I do: fpc test.pas the result is "test.exe". But the source name needs to be different from the executable name. For this reason: fpc test.pas -oindex.cgi This command should result in index.cgi, placed on the current folder. However, this command is ignore and I obtain "test.exe" again. My question is: how to produce a executable, compiling from the commandline in FPC 2.6.0, with a different name of its source? Regards, Luciano

Reply by email

Sven Barth
to luciano de souza
luciano de souza wrote 8 lines
Actually, there are no errors. Using cmd.exe on Windows 7 and FPC 2.6.0, I did: fpc test.pas -oindex.cgi I got test.exe and no errors are raised.

But did the compiler write something else? A warning maybe (maybe you need to pass "-vw" to see it)? What if you place the "-oindex.cgi" before the "test.pas"? What if you put the "-oindex.cgi" into quotes?

I tested it. It DOES work. On Windows as well as Linux.

We can do -d in the commandline or {$ifdef ..} in the source code. Several other options are available from the two modes. Is there a directive, placeable in code, allowing me to define a name for the executable?
No. You can only change the extension from within code by using
{$EXTENSION 'cgi'}.

Regards,
Sven

Reply by email