Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Problem with includes in Socket.cpp and Web.h
Problem with includes in Socket.cpp and Web.h [message #35947] Sun, 08 April 2012 16:36 Go to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello all

There are some problems when compiling U++ in Windows.

Socket.cpp includes #include <Ws2ipdef.h> and #include <Ws2tcpip.h> that apparently are not in MinGW.

Web.h in class IpAddrInfo declaration includes addrinfo that apparently is not included before.


Best regards
Iñaki
Re: Problem with includes in Socket.cpp and Web.h [message #35948 is a reply to message #35947] Sun, 08 April 2012 16:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Sun, 08 April 2012 10:36

Hello all

There are some problems when compiling U++ in Windows.

Socket.cpp includes #include <Ws2ipdef.h> and #include <Ws2tcpip.h> that apparently are not in MinGW.



Could not we just say that mingw is not supported anymore?

Alternatively, please propose a patch.

Mirek
Re: Problem with includes in Socket.cpp and Web.h [message #35949 is a reply to message #35948] Sun, 08 April 2012 16:52 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Mirek

You know that in a next future it could happen in Windows the same that happened with PocketPC few years ago... Microsoft just decided that MSC compiler was not going to be free ("gratis").

So to support MinGW is not an effort but and advantage. And it has been very little effort.

Anyway we will propose a solution very soon Smile.


Best regards
Iñaki
Re: Problem with includes in Socket.cpp and Web.h [message #35951 is a reply to message #35949] Sun, 08 April 2012 16:57 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Anyway the problem in Web.h remains: it happens using MSC too.

Best regards
Iñaki
Re: Problem with includes in Socket.cpp and Web.h [message #35952 is a reply to message #35951] Sun, 08 April 2012 17:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Sun, 08 April 2012 10:57

Anyway the problem in Web.h remains: it happens using MSC too.


I am now commiting changes to Core like 5 times a day. Last one was 20 minutes ago, at that time MSC compiled. Do you have the latest? Smile

Mirek
Re: Problem with includes in Socket.cpp and Web.h [message #35956 is a reply to message #35952] Sun, 08 April 2012 19:17 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Mirek

I have deleted uppsrc folder and downloaded it again now but I get compiling errors in Web.h.

core\Web.h(19) : error C2143: syntax error : missing ';' before '*'

because the compiler do not have "addrinfo" declared.


Best regards
Iñaki
Re: Problem with includes in Socket.cpp and Web.h [message #35967 is a reply to message #35956] Mon, 09 April 2012 22:41 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi there..

i have the same problem, using MSC9 and TDM GCC 4.51..

what is, btw. considered supported and what unsupported?
maybe we should maintain a list of supported/unsupported dependencies..

any idea where to get the dependencies resolved?
Re: Problem with includes in Socket.cpp and Web.h [message #35968 is a reply to message #35967] Tue, 10 April 2012 08:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kohait00 wrote on Mon, 09 April 2012 16:41

hi there..

i have the same problem, using MSC9 and TDM GCC 4.51..

what is, btw. considered supported and what unsupported?
maybe we should maintain a list of supported/unsupported dependencies..

any idea where to get the dependencies resolved?


That is weird, addrinfo should be in the same header as sockets...

In any case, we cannot have ipv6 support without addrinfo.

Mirek
Re: Problem with includes in Socket.cpp and Web.h [message #35969 is a reply to message #35968] Tue, 10 April 2012 08:47 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Mirek and Kohait

In my PC it works now. The changes included for sure are not perfect but they serve:

In Socket.cpp, for MinGW
#ifdef PLATFORM_WIN32
#include <winsock2.h>
#ifdef COMPILER_MSC
	#include <Ws2ipdef.h>
#endif
#include <Ws2tcpip.h>
#endif


In Core.h
- Include this before windows.h, for MinGW
#ifdef COMPILER_MINGW
	#define WINVER 0xFFFF	
#endif


- To add:
#ifdef PLATFORM_WIN32
	#include <ws2tcpip.h>



Best regards
Iñaki
Re: Problem with includes in Socket.cpp and Web.h [message #35970 is a reply to message #35969] Tue, 10 April 2012 09:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Tue, 10 April 2012 02:47

Hello Mirek and Kohait

In my PC it works now. The changes included for sure are not perfect but they serve:

In Socket.cpp, for MinGW
#ifdef PLATFORM_WIN32
#include <winsock2.h>
#ifdef COMPILER_MSC
	#include <Ws2ipdef.h>
#endif
#include <Ws2tcpip.h>
#endif


In Core.h
- Include this before windows.h, for MinGW
#ifdef COMPILER_MINGW
	#define WINVER 0xFFFF	
#endif


- To add:
#ifdef PLATFORM_WIN32
	#include <ws2tcpip.h>




Not quite sure about "To add".

Could you attach both files to be sure?

Mirek
Re: Problem with includes in Socket.cpp and Web.h [message #35971 is a reply to message #35970] Tue, 10 April 2012 10:04 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Mirek

Here are the files. Changes are very easy.

- Ws2ipdef.h is not in MinGW and it is not necessary
- Some files require ws2tcpip.h. It can be included in Core.h or in other file
- For some reason MinGW requires a high WINVER to consider addrinfo infrastructure
  • Attachment: Files.7z
    (Size: 7.16KB, Downloaded 239 times)


Best regards
Iñaki
Re: Problem with includes in Socket.cpp and Web.h [message #35972 is a reply to message #35971] Tue, 10 April 2012 11:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Hopefully applied, please check.
Re: Problem with includes in Socket.cpp and Web.h [message #35974 is a reply to message #35972] Tue, 10 April 2012 19:03 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
MSC9 compiles again...

TDMGCC 451 doesn't link..

D:/uppsvn/out/dfm-git-cl_svn/Core/TDM451.Debug.Debug_Full.Gui.Mt.Shared.So\Socket.o: In function `ZNK3Upp15SocketWaitEvent3GetEi':
D:/uppsvn/uppsrc/Core/Socket.cpp:766: undefined reference to `__WSAFDIsSet@8'
D:/uppsvn/uppsrc/Core/Socket.cpp:768: undefined reference to `__WSAFDIsSet@8'
D:/uppsvn/uppsrc/Core/Socket.cpp:770: undefined reference to `__WSAFDIsSet@8'


cheers Smile
Re: Problem with includes in Socket.cpp and Web.h [message #35975 is a reply to message #35974] Tue, 10 April 2012 23:16 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Mirek and Kohait

In my case MSC9, MSC10 and MinGW TDM 461 compile and link well.


Best regards
Iñaki
Re: Problem with includes in Socket.cpp and Web.h [message #36155 is a reply to message #35975] Sun, 06 May 2012 23:54 Go to previous message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Mirek

Please include ws2_32 in Core Package Organizer when WIN32 GCC.

This way Core.upp would include:

library(WIN32 GCC) "ole32 oleaut32 uuid ws2_32";


Best regards
Iñaki
Previous Topic: Warning in Socket.cpp
Next Topic: Doubt with timeout in HttpRequest
Goto Forum:
  


Current Time: Thu Mar 28 13:30:50 CET 2024

Total time taken to generate the page: 0.01102 seconds