Solved

32bit compiler / Header Problem

Posted on 1997-08-04
8
187 Views
Last Modified: 2013-12-25
I'm trying to do a compiled C CGI script on an NT web server.  I've used GNU/GCC on Linux before on Unix servers with no problem. I'm using the Cygnus 32bit compiler and getting a good executable but when I transfer it to the NT server and execute it I get a
"CGI Error ....did not return a complete set of HTTP headers.  The headers it did return are:   "

Help Please!
0
Comment
Question by:welcome080397
  • 4
  • 3
8 Comments
 
LVL 7

Expert Comment

by:faster
ID: 1829537
Linux and NT is totally different platform, so you can not use the complier on linux and then expect it to work on NT.  You will need win32 compiler such MSVC or Borland C++.
0
 

Author Comment

by:welcome080397
ID: 1829538
Cygnus is a Win 32-bit compiler and the programs execute fine under Windows 95.
0
 
LVL 7

Expert Comment

by:faster
ID: 1829539
Then what APIs you have been using?  What is the output if you run it directly on the command line? (you can set necessary env and use a file to simulate the POST entity body).

Maybe you can show us your code.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 4

Expert Comment

by:feenix
ID: 1829540
You have forgotten to include the HTTP-headers in your CGI-BIN.
Make sure you have at least this in the beginning of your code:

printf("Content-type: text/html\n\n");

Make sure there are _two_ linefeeds in the end. After that you can output whatever you want and it'll work fine.

0
 

Author Comment

by:welcome080397
ID: 1829541
Sorry,
I will put more info on future questions.
I have
printf("Content-type: text/html\n\n");
as my first line.

0
 

Author Comment

by:welcome080397
ID: 1829542
More Info:
Cygnus (to the best of my knowledge) is a 32bit compiler.
The code is basically as follows:

printf("Content-type: text/html\n\n");
printf("<html><head><title>Test</title></head>");
printf("<body>This is a test</body></html>");

Is executes fine in Windows 95 and that output is produced.
Is is possibly a permission problem?
0
 
LVL 7

Accepted Solution

by:
faster earned 100 total points
ID: 1829543
So your program can be successfully executed from command line.  If what you show is your real program and it does not work, it must be the misconfiguration of web server.  What server are you using?  If Information server from microsoft, then you must put it in the CGI category (WIN CGI and SHELL CGI will not do.)  Try to make some logging and see whether your program is ever called by the server.
0
 

Author Comment

by:welcome080397
ID: 1829544
It seems that after many confirmations that I had executeable status - I DID NOT. Seems that the provider had trouble in the past and no longer gives execution privleges.  My only hope is that they go down in flames just like all other businesses that that don't work with their customers.
They made me waste a lot of time.

Thanks faster.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question