I can't even get a simple test program working with CGI. Here's my code. It works when I run it in the console, but gives the error when I try to run from Apache:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
int main() {
printf("Content-type: text/html\n\n");
printf("TEST");
return 0;
}
MakeFile:
build: source/main.cpp
C:/MinGW/bin/g++.exe -o build/e2.exe source/main.cpp
Error:
[Thu Mar 22 19:14:23 2012] [error] [client 127.0.0.1] Premature end of script headers: e2.exe
Run in command prompt:
C:\Users\Stephen>C:\wamp\www\e2.exe
Content-type: text/html
TEST
Any help would be greatly appreciated! Thanks!
Solved: Makefile:
build: source/main.cpp
C:/MinGW/bin/gcc.exe -o build/e2.exe source/main.cpp