Welcome! Log In Create A New Profile

Advanced

Configuring nginx with g++

Decimus Phostle
November 10, 2010 07:26PM
Hello,

Q1) I have been trying to compile nginx using the C++ compiler as follows:

$ ./configure --with-cc=g++ --add-module=/path/to/module --prefix=/some/prefix

(Also, tried "CC=g++ ./configure ...").

Both these commands result in this error:

....
creating objs/Makefile
checking for int size ...
../configure: error: can not detect int size
$

On tail'ing the objs/autoconf.err, the error is obvious(details
below). How do I go about fixing this? And/or is this fixed in a later
release? (I am using 0.8.52). Please let me know.

Q2) The above issue was encountered while trying to write a
handler/module in C++. Is there another way I should be approaching
this?

Please let me know. Any help would be much appreciated.

Thanks,
DP


-------------------------------------------------------------------------------------------------------------
PS:

Details of int size error:


$ tail -23 objs/autoconf.err
----------------------------------------
checking for int size

objs/autotest.c: In function 'int main()':
objs/autotest.c:11: error: 'printf' was not declared in this scope
----------

#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <signal.h>
#include <sys/resource.h>
#include <inttypes.h>


int main() {
printf("%d", sizeof(int));
return 0;
}

----------
g++ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
$


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Configuring nginx with g++

Decimus Phostle November 10, 2010 07:26PM

Re: Configuring nginx with g++

Maxim Dounin November 10, 2010 08:48PM

Re: Configuring nginx with g++

Decimus Phostle November 10, 2010 09:40PM

Re: Configuring nginx with g++

Piotr Sikora November 10, 2010 11:18PM

Re: Configuring nginx with g++

Maxim Dounin November 10, 2010 11:24PM

Re: Configuring nginx with g++

Decimus Phostle November 11, 2010 06:08PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 238
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready