Solved

32bit compiler / Header Problem

Posted on 1997-08-04
8
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
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

DevOps Toolchain Recommendations

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need to combine two scripts 2 41
Renaming with batch file 9 81
Powershell Split 18 29
Modifying Powershell: Recipients returns System.Collections.ArrayList ? 4 38
If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to count occurrences of each item in an array.

726 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