compile in a character format to use in cgi-bin on winnt web server

does anyone know how to set the compiler(borland, watcom, or
cc, gcc) to compile in character format?(example gcc compiles in unix format by default)

the problem i have is i have a project to write a program in c code and use the web to execute it threw cgi. My teacher is running a winnt web server and i need to switch out of the compiling format to the character format so the web server likes the program and does not crash.  
Who is Participating?
nils pipenbrinckConnect With a Mentor Commented:
you're looking for the compiler switch that makes your windows program a console application, right?

that's pretty easy with watcom c++

If you use the ide you have to choose the "character mode executable" target.

If you use makefiles you have to tell the linker that you want a command line executable.. to do this add the line "system=nt" into your link-script..

for a short test you can write a hello world program like this:

#include <stdio.h>

void main (void)
  printf ("hello world\n");

compile it with: wcl386 /l"system nt" test.c and you'll get a win32 application that runs in a text window.

hope that helps,
Are you referring to a text file (or .c file) on a DOS/Win platform being different than on a UNIX platform?

If so, just FTP the file over in ASCII mode.

Or, if you want, write a small program that does the conversion from "\r\n" to "\n" and vice-versa.

If that's not what you meant than...never mind ;)
Many unix server supports :
dos2unix utility
dos2unix one.c one.c

will convert from Dos file to Unix file
The Firewall Audit Checklist

Preparing for a firewall audit today is almost impossible.
AlgoSec, together with some of the largest global organizations and auditors, has created a checklist to follow when preparing for your firewall audit. Simplify risk mitigation while staying compliant all of the time!

This question is very unclear.  My belief here is that you are not referring to your source code, but it's executable output.  You cannot compile the program under unix and expect it to run under a windows environment - unless you are using a cross-platform compiler.

Obviously, if you haven't compiled your code into and executable, then the web server won't run it.  Under borland, you do a

bcc source.c /o source.exe ...[other compiler arguments]...

to generate the executable (or if you are using the IDE, then compile within the IDE).  Your CGI program is the executable output (eg source.exe).
May be i wrong, but seems me that
you talk about JAVA: C++ code for
working in WEB. See Java /Javascript area.
jimkelleyAuthor Commented:
hay that was what i was looking for i found it out just before you answered the question. but thanks if you could tell how to do the same in borland i would be grateful
nils pipenbrinckCommented:
sorry jimkelly.. I haven't worked with borland for ages...


All Courses

From novice to tech pro — start learning today.