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
- Date: Mon, 23 Jun 2008 13:54:36 +0800
- From: JonY <10walls@xxxxxxxxx>
- Subject: ***BOGO*** Re: [Mingw-users] Trying to port a C Linux library to windows
Mariano Martinez Peck wrote:
> 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
>
Hi,
this is because Cygwin is designed from the ground up to be more
"unixy", functioning as an emulation layer of sorts, translating
traditional Unix calls to win32. Its also the reason Cygwin apps depend
on the Cygwin Runtime dll, cywin1.dll.
MinGW on the other hand provides a minimalist interface to MS's C
runtime, msvcrt.dll. It does not provide additional Unix calls other
than what is already supported by msvcrt.
Next time, please avoid top posting, thanks.
-------------------------------------------------------------------------
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