lists.zerezo.com



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

***BOGO*** Re: [Mingw-users] Trying to port a C Linux library to windows



Vicents: Thanks a lot. I have been searching and it obviously seems an error with sockets.

If you see in config.log, you can see thees things:

    c:/MySQL/include/mysql_com.h:183: error: syntax error before "SOCKET"
    c:/MySQL/include/mysql_com.h:183: warning: no semicolon at end of struct or union
    c:/MySQL/include/mysql_com.h:222: error: syntax error before '}' token



configure:26052: checking for select
configure:26108: gcc -std=gnu99 -o conftest.exe -g -O2 -Ic:/MySQL/include -Lc:/MySQL/lib/opt conftest.c  >&5
C:/DOCUME~1/JuanjoE/CONFIG~1/Temp/ccgXlikM.o: In function `main':
c:/mariano/opendbx-1.3.10/conftest.c:75: undefined reference to `select'


configure:25820: checking sys/socket.h usability
configure:25837: gcc -std=gnu99 -c -g -O2 -Ic:/MySQL/include conftest.c >&5
conftest.c:68:24: sys/socket.h: No such file or directory


| #include <sys/socket.h>
configure:25857: result: no
configure:25861: checking sys/socket.h presence
configure:25876: gcc -std=gnu99 -E -Ic:/MySQL/include conftest.c
conftest.c:35:24: sys/socket.h: No such file or directory


| #include <sys/socket.h>
configure:25896: result: no
configure:25929: checking for sys/socket.h
configure:25937: result: no

configure:25988: gcc -std=gnu99 -c -g -O2 -Ic:/MySQL/include conftest.c >&5
conftest.c: In function `main':
conftest.c:79: error: syntax error before "fd_set"


and lots more.

Now, the question is, how openDBX code should be done so that to be able to be compiled with gcc under linux and MinGW under windows?

I have been these links:

- http://www.mingw.org/MinGWiki/index.php/sockets
- http://bytes.com/forum/thread745513.html
 Here it does something like this:

#ifdef MINGW32
#include <winsock2.h>


int main() {
#ifdef MINGW32
WSADATA wsadata;


And the last question, just to understand not to criticize. Why this do compiles under cygwin but doesn't under MinGW?

very thanks,

Mariano


On Mon, Jun 23, 2008 at 1:11 AM, Vincent Torri <vtorri@xxxxxxxxxxxx> wrote:


On Mon, 23 Jun 2008, Mariano Martinez Peck wrote:
> .libs/libpgsqlbac
> kend_la-pgsql_basic.o
> pgsql_basic.c:17:24: sys/select.h: No such file or directory
> pgsql_basic.c: In function `pgsql_odbx_result':
> pgsql_basic.c:318: error: `fd_set' undeclared (first use in this function)
> pgsql_basic.c:318: error: (Each undeclared identifier is reported only once
> pgsql_basic.c:318: error: for each function it appears in.)
> pgsql_basic.c:318: error: syntax error before "fds"
> pgsql_basic.c:326: warning: implicit declaration of function `FD_ZERO'
> pgsql_basic.c:326: error: `fds' undeclared (first use in this function)
> pgsql_basic.c:327: warning: implicit declaration of function `FD_SET'
> pgsql_basic.c:329: warning: implicit declaration of function `select'
> make[3]: *** [libpgsqlbackend_la-pgsql_basic.lo] Error 1
> make[3]: Leaving directory `/c/mariano/opendbx-1.3.10/backends/pgsql'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/c/mariano/opendbx-1.3.10/backends'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/c/mariano/opendbx-1.3.10'
> make: *** [all] Error 2
>
> If I see pgsql_basic.c (part of openDBX library), function pgsql_odbx_result
> I see:
>
> int fd;
>        fd_set fds;
>
>        if( ( fd = PQsocket( (PGconn*) handle->generic ) ) == -1 )
>        {
>            conn->errtype = -1;
>            return -ODBX_ERR_BACKEND;
>        }
>
>        FD_ZERO( &fds );
>        FD_SET( fd, &fds );
>
> Any ideas?

include winsock2.h

about select.h, i don't know. try to comment it for now.

Vincent Torri

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users