Solved

32bit compiler / Header Problem

Posted on 1997-08-04
8
180 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
 
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
DevOps Toolchain Recommendations

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

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Python - ImportError: No module named 'urllib2' 2 152
Powershell variable with -SearchBase cmdlet 2 86
Convert MSI to MSM 1 49
Need to Modify a Script I found 5 92
The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now