• C

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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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).
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

May be i wrong, but seems me that
you talk about JAVA: C++ code for
working in WEB. See Java /Javascript area.
nils pipenbrinckCommented:
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,

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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...


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.