Just wanted to share my experience of trying to get gloox to compile on
Microsoft Visual Studio 2008 on a Vista x64 machine, since the supplied
project isn't correct:
(Using 1.0-rc1)
Compile errors: "time" undefined. I fixed this by adding #include <ctime> to
config.h.win, since I did not want to modify any sourcefiles.
Link errors: Pretty much all the needed libs are not added to the
projectfile:
I (mis)used config.h.win for my fixes since I did not want to edit any
sourcecode. Result of my modification of the config.h.win file:
#include <ctime>
#pragma comment(lib,"Dnsapi.lib")
#pragma comment(lib,"Secur32.lib")
#pragma comment(lib,"Crypt32.lib")
#pragma comment(lib,"ws2_32.lib")
After this I could compile correctly.
Note: Due to my solution-layout I preferred adding the (Studio only
probably) pragma's, but you could just add those to the project settings
too..
You can pretty much delete the whole release configuration of the supplied
project, as it has all the wrong settings (I spot *nix defines and even a
reference to c:\iksemel and its lib!). I guess many people new to Studio
will also fall over the fact that Debug is set as /mDd (Multithreaded Debug
DLL) and Release as /MT (Multi-threaded).
Warnings:
Many C4355 warnings ('this' : used in base member initializer list):
- connectionbosh.cpp(35)
- connectionbosh.cpp(48)
- clientbase.cpp(94)
- clientbase.cpp(111)
x64 problems (I guess most can be muted by just casting) :
- dns.cpp(299) : warning C4244: 'return' : conversion from '__int64'
to 'int', possible loss of data
(an int for Studio is 32bits even in an x64 env - use size_t or __int64)
- parser.cpp (many lines) 'return' : conversion from 'size_t' to
'int', possible loss of data
- socks5bytestreamserver.cpp(155) : warning C4267: 'initializing' :
conversion from 'size_t' to 'unsigned int', possible loss of data
- tlsschannel.cpp(62) : warning C4267: 'initializing' : conversion
from 'size_t' to 'const int', possible loss of data
- tlsschannel.cpp(142) : warning C4267: '=' : conversion from 'size_t'
to 'unsigned long', possible loss of data
- tlsschannel.cpp(337) : warning C4267: '=' : conversion from 'size_t'
to 'unsigned long', possible loss of data
A few minor ones:
- connectiontcpserver.cpp(147) : warning C4244: 'initializing' :
conversion from 'SOCKET' to 'int'
- jinglesession.cpp(169) : warning C4065: switch statement contains
'default' but no 'case' labels
- jinglesession.cpp(182) : warning C4065: switch statement contains
'default' but no 'case' labels
Last, many Microsoft specific warnings (C4996) about using "unsafe"
variants: strncpy -> strncpy, sprint -> sprintf_s throughout the whole
project. You can mute these warnings by adding defining
_CRT_SECURE_NO_WARNING (maybe in config.h.win?)
All of these are pretty minor and I'm actually pleasantly surprised how easy
it was to get it to compile/work, so consider this my way to thank you for a
nice project. I hope this will help some people trying to get it to work on
a modern Windows env, especially since the developer obviously is no Windows
user J
Regards,
Freddy
ff.net / pantsu.net