CGI and AWS together


I am having difficulty getting CGI and AWS to work together.

Any tips how exactly to do this?

I took an AWS sample project and the tried to copied in the cgi.c file from the CGI sample.

In my root.c project I have the following includes


When I include the cgi.c to be compiled I get the following errors. Any advice?

./sys/http/cgi.o: In function `RpUserExitInit':
cgi.c:(.text+0x0): multiple definition of `RpUserExitInit'
./cgi.o:cgi.c:(.text+0x0): first defined here
./sys/http/cgi.o: In function `RpUserExitDeInit':
cgi.c:(.text+0x20): multiple definition of `RpUserExitDeInit'
./cgi.o:cgi.c:(.text+0x20): first defined here
./sys/http/cgi.o: In function `RpExternalCgi':
cgi.c:(.text+0x38): multiple definition of `RpExternalCgi'
./cgi.o:cgi.c:(.text+0x138): first defined here
/usr/lib/gcc/arm-elf/4.2.0/../../../../arm-elf/bin/ld: Warning: size of symbol `RpExternalCgi' changed from 456 in ./cgi.o to 32 in ./sys/http/cgi.o
collect2: ld returned 1 exit status
make: *** [image.elf] Error 1
make: Target `all' not remade because of errors.

Hi, here is my part of my cgi.c

#include "AsExtern.h"
#include "RpCgi.h"

int RpUserExitInit(void *theTaskDataPtr)

	return 0;

int RpUserExitDeInit()

	return 0;
void RpExternalCgi(void *theDataPtr, rpCgiPtr theCgiPtr)

	char ok = 0;
	char * ptr;

	if (theCgiPtr->fHttpRequest == eRpCgiHttpGet || theCgiPtr->fHttpRequest
			== eRpCgiHttpPost)

		theCgiPtr->fResponseBufferPtr = 0;

		// config/sceneSel.cgi

		if (strncmp(theCgiPtr->fPathPtr, "/config/sceneSet.cgi", 21) == 0) //
			ok = 1;

if (ok)
			theCgiPtr->fHttpResponse = eRpCgiHttpOk;
			theCgiPtr->fResponseState = eRpCgiLastBuffer;

			if (theCgiPtr->fResponseBufferPtr == 0)
				theCgiPtr->fResponseBufferPtr = (char *) CGI_RESPONSE_TEXT;
				theCgiPtr->fResponseBufferLength = sizeof(CGI_RESPONSE_TEXT);

		} else

			int len;
					= sprintf(
							"Page not foundHTTP: 404 Page (%s) not found",
			theCgiPtr->fHttpResponse = eRpCgiHttpOk;
			theCgiPtr->fResponseState = eRpCgiLastBuffer;
			theCgiPtr->fResponseBufferPtr = txt;
			theCgiPtr->fResponseBufferLength = strlen(txt);


"When I include the cgi.c to be compiled I get the following errors. Any advice? "

Since you have a sys directory I will conclude that you created a NET+OS project as opposed to a NET+OS sample application. Further I will infur that in creating the project, you included HTTP as a service. From what I can see when you do this, the sys directory has a subdirectory called http. This http directory alrady contains a cgi.c file. If you also added a cgi.c file to the top level directory of your project, then you would get linker errors of multiple definitions as you describe in the earlier posting.

So either remove the cgi.c from the sys\http directory or better yet, instead of added cgi.c to your upper level directory, use the cgi.c in sys\http as your cgi.c