Compiler

Started by
12 comments, last by ao 23 years, 5 months ago
I''m working on some cgi stuff, but do not have access to a telnet account or I would just ftp my .c file up to the server and compile it with gcc... I''m looking for a compiler that will compile out to a unix executable binary on a windows machine. Does anyone know if there is a compiler available that will do that? ao
Play free Java games at: www.infinitepixels.com
Advertisement
In short, yes.

But it may be a huge pain to get the compiler configured.

gcc supports cross-compilation, allowing you to compile binaries for one OS/Processor on another. You could set up a gcc enviornment on your Windows system that generated binaries for the other machine...

It''s been so long since I''ve used gcc that I couldn''t give you easy to digest instructions on how to set this up, but it can be done...

Also, you''ll need to know more about the UNIX platform you are using. Not all UNIXes are created equal...At a minimum you need to know the processor family it runs on (x86, SPARC, Alpha, MIPS, etc...) and the actual UNIX variant (Linux, Solaris, IRIX, etc.).

If you have an old 486 lying around there it would probably be easiest just to install Linux on that and use it for dev/testing
Convert your script to Perl. I know it doesn''t answer your question, but CGI scripts were MEANT to be written in Perl, not C!
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Muzzafarath: as far as I know, there are no set languages for
CGI scripting.


Cyberdrek
Headhunter Soft
DLC Multimedia
[Cyberdrek | ]
quote:
Muzzafarath: as far as I know, there are no set languages for CGI scripting.


I know that, I was just saying that it's much better to write CGI scripts in Perl. Who wants to worry about buffer overflows when writing CGI scripts anyway? Perl was designed to handle text in an efficient manner (I believe Perl stands for "Practical Extraction and Report Language"), C was _not_ designed to handle large masses of text, and basically everything you do in CGI scripts is lots of text, and Perl is really good at this.

Edited by - Muzzafarath on October 30, 2000 11:26:13 AM
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
quote:Original post by Muzzafarath

Convert your script to Perl. I know it doesn't answer your question, but CGI scripts were MEANT to be written in Perl, not C!


I have written CGI scripts in C. The key is to find a host that will give you a shell account. If some serious computations are going to be done each time a CGI is called, then I would definitely opt for C.

If you are not going to do serious number crunching in your CGI, then a better alternative to both C and Perl is PHP. It is free, and has built in support for connecting to a MySQL server, on the fly image generation, and the code is placed within the HTML page and processed on the server before sent out to the client.

So, I suggest you find a server that offers PHP and MySQL and a shell account for that matter. Cost just isn't an issue anymore. I'm sure you can find a host that will give you these features for less than $10 a month.

More info on PHP: www.php.net

Also, PHP is compiled right into the Apache server, so little overhead is incurred when a PHP script is processed. In addition, PHP offers full 'regular expression' support for text processing.



Edited by - bishop_pass on October 30, 2000 11:56:02 AM

Edited by - bishop_pass on October 30, 2000 11:56:36 AM
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
I''m not sure about this but don''t you have to chmod the cgi script and allow it to be executed? Anyways, I know you usually can not just put it in your personal directory on the server...

"Paranoia is the belief in a hidden order behind the visible." - Anonymous
quote:Original post by Staffan

I''m not sure about this but don''t you have to chmod the cgi script and allow it to be executed? Anyways, I know you usually can not just put it in your personal directory on the server...


That is true, it must be executable and in the cgi-bin.

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
Ok, thanks for the help guys. I''ll dig a little deeper into gcc. I was thinking about looking at perl as well, but I really want to do it in c since I have done all my previous scripts in c.

I do have an old pc lying around that I could setup linux on, hmmm....

Well if anyone has any other idears be sure to post em.

ao
Play free Java games at: www.infinitepixels.com

This topic is closed to new replies.

Advertisement