< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate-users] Compile Resiprocate with MinGW


I did the MinGW port back in 2006, and I don't think there's been much maintenance on it as new functionality was added. I no longer use Windows on a daily basis, so I don't really have any reason (or, really, any tools) to fix problems that might arise.

That said, because resip is well-used with both gcc and with Windows, shoring up the MinGW port should be a very straightforward exercise. With extremely rare exception, the problems you encounter are going to be caused by someone conflating "Microsoft's compiler" with "Microsoft Windows" and/or "GCC" with "Unix-like platform."

So, for example, you'll sometimes see code like:

#ifdef WIN32
<do stuff specific to Microsoft Visual C++ compiler>
#endif

Or code like:

#ifdef _MSC_VER
<do stuff specific to Microsoft Windows>
#endif

Or similar mismatches. Of course, with MinGW, you need to use WIN32 to check for Windows behavior, and _MSC_VER to check for compiler behavior (since the WIN32 stuff applies to MinGW, while the Microsoft-compiler-specific behavior will not.)

Your mileage may vary, but I suspect it's only a small amount of work to get this working again. If you *do* fix the compile for MinGW, please consider submitting patches back to the project.

/a


On 2/14/12 4:40 AM, Ulrich Van Den Hekke wrote:
Hi,

I try to compile the last version of resiprocate with the last version of MinGW, and i have the following error. This happened on the compilation of ares.

The first error, come from the missing WINDEF variable where the default value is 0x0400, so in iptypes.h, type are not defined.

The second error, come from the syntax :
(void*)GetNetworkParams = GetProcAddress(hLib, TEXT("GetNetworkParams"));

If i add WINVER to 0x0501, and correct lines as this :
GetNetworkParams = (DWORD (WINAPI *)(FIXED_INFO*, DWORD*))GetProcAddress(hLib, TEXT("GetNetworkParams"));

The compilation continue, until i have other error on non existence of _ltoa function in other part of the source, or other error...

Is the compilation on MinGW is always supported ? How can i compile resiprocate with MinGW ? (Maybe there is some define, or config file missing).

Thanks in advance for all your help.

if gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKA GE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"ares\" -DVERSION=\"1.1.2\" -I. -I../ares -I../ares -g -O2 -MT ares_init.o -MD -MP -MF ".deps/ares_init
.Tpo" \
-c -o ares_init.o `test -f '../ares/ares_init.c' || echo '../ares/'`..
/ares/ares_init.c; \
        then mv -f ".deps/ares_init.Tpo" ".deps/ares_init.Po"; \
        else rm -f ".deps/ares_init.Tpo"; exit 1; \
        fi
In file included from ../ares/ares_init.c:44:0:
../ares/ares.h:268:0: warning: "NOERROR" redefined
d:\c\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winerror.h:1888:0: n
ote: this is the location of the previous definition
../ares/ares_init.c: In function 'init_by_defaults':
../ares/ares_init.c:499:4: error: lvalue required as left operand of assignment
../ares/ares_init.c: In function 'get_physical_address':
../ares/ares_init.c:952:67: error: expected declaration specifiers or '...' befo
re 'IP_ADAPTER_ADDRESSES'
../ares/ares_init.c:956:3: error: 'IP_ADAPTER_ADDRESSES' undeclared (first use i
n this function)
../ares/ares_init.c:956:3: note: each undeclared identifier is reported only onc
e for each function it appears in
../ares/ares_init.c:956:25: error: 'pAdapterAddresses' undeclared (first use in
this function)
../ares/ares_init.c:966:3: error: lvalue required as left operand of assignment ../ares/ares_init.c:974:3: error: too many arguments to function 'GetAdaptersAdd
ressesProc'
../ares/ares_init.c:978:48: error: expected expression before ')' token
../ares/ares_init.c:991:3: error: too many arguments to function 'GetAdaptersAdd
ressesProc'
../ares/ares_init.c:999:28: error: 'AI' undeclared (first use in this function) ../ares/ares_init.c:1002:7: error: 'PIP_ADAPTER_DNS_SERVER_ADDRESS' undeclared (
first use in this function)
../ares/ares_init.c:1002:38: error: expected ';' before 'dnsServers'
../ares/ares_init.c:1004:14: error: 'dnsServers' undeclared (first use in this f
unction)
make[1]: *** [ares_init.o] Error 1
make[1]: Leaving directory `/d/workspace_eclipse/softphone/ext/resiprocate/contr
ib/ares-build.MINGW32_NT-6.1.i686'
make: *** [ares] Error 2