[omniORB] omniORB 4.2.3 - mingw x86 - tcpSocket.cc error - sprintf

DIETMAR MAY dietmar.may at outlook.com
Fri Mar 15 00:36:00 GMT 2019


No, just the much simpler missing include file:

#include<stdio.h>

I'd venture a guess that this works on gcc / linux because 
HAVE_INET_NTOP is (probably) defined on that platform, but not on Windows.

Might be good to add this to tcpSocket.cc ... perhaps bracketed 
inside|#ifdef ||__MINGW32__.|

-------

On 3/14/2019 11:25 AM, Dietmar May wrote:
> When building omniORB 4.2.3 with cygwin's mingw compiler, I receive 
> the error below.
>
> Looks like either it's building with wchar support, or one of the 
> #defines is missing and I'm picking up the wrong #if code sections.
>
> omkdepend builds fine, as do a number of other components up to 
> tcpSocket.cc
>
> Any ideas?
>
> -------
>
> /usr/bin/i686-w64-mingw32-g++ -c -O2  -D_WINSTATIC -mthreads -I.. -I./..
> -I../../../../include/omniORB4/internal -DUSE_omniORB_logStream
> -D_OMNIORB_LIBRARY -DOMNIORB_VERSION_STRING='"4.2.3"'
> -DOMNIORB_VERSION_HEX='0x040203F1'
> -DCONFIG_DEFAULT_LOCATION='"C:\\OMNIORB.CFG"'
> -DCONFIG_ENV='"OMNIORB_CONFIG"' -D"NTArchitecture" -I. -I.
> -I../../../../include -D__WIN32__ -D_WIN32_WINNT=0x0400 -D__x86__
> -D__NT__ -D__OSVERSION__=4 -ostatic/tcpSocket.o tcpSocket.cc
> tcpSocket.cc: In static member function ‘static char*
> omni::tcpSocket::addrToString(sockaddr*)’:
> tcpSocket.cc:976:3: error: ‘sprintf’ was not declared in this scope
>     sprintf(result,"%d.%d.%d.%d",ip1,ip2,ip3,ip4);
>     ^~~~~~~
> tcpSocket.cc:976:3: note: suggested alternative: ‘wsprintf’
>     sprintf(result,"%d.%d.%d.%d",ip1,ip2,ip3,ip4);
>     ^~~~~~~
>     wsprintf
> tcpSocket.cc: In static member function ‘static char*
> omni::tcpSocket::addrToURI(sockaddr*, const char*)’:
> tcpSocket.cc:1065:3: error: ‘sprintf’ was not declared in this scope
>     sprintf(result,"%s%d.%d.%d.%d:%d",prefix, ip1, ip2, ip3, ip4, port);
>     ^~~~~~~
> tcpSocket.cc:1065:3: note: suggested alternative: ‘wsprintf’
>     sprintf(result,"%s%d.%d.%d.%d:%d",prefix, ip1, ip2, ip3, ip4, port);
>     ^~~~~~~
>     wsprintf
> make[3]: *** [../../../../mk/mingw.mk:290: static/tcpSocket.o] Error 1
>
> -------
>
> I've installed Cygwin x86, with mingw64-i686-gcc-g++ and cygwin binutils
> packages.
>
> I've downloaded and installed MSVC++ 2008 SP1 redistributables
>
> https://www.microsoft.com/en-US/download/details.aspx?id=5582
>
> and copied MSVCRT90.DLL to cygwin's /usr/bin directory.
>
> I've edited <top>/config/config.mk and enabled
>
> platform = x86_win32_mingw
>
> I've installed python.org's python interpreter, and don't have cygwin's
> python installed:
>
> $printenv PATH
>
> /usr/local/bin:/usr/bin: ... :/C/programs/python
>
> $ which python
> /C/programs/python/python
>
> I've edited <top>/mk/platforms/x86_win32_mingw.mk and updated the PYTHON
> macro:
>
> PYTHON = /c/programs/python/python
>
> (cygwin's /etc/fstab contains "c:/  /C     ntfs binary,posix=0,user 0 0")
>
> I've changed <top>/mk/mingw.mk:
>
> MINGW = /usr/bin/i686-w64-mingw32-
> AR = ar cq
> CXX = $(MINGW)g++
> CXXLINK = $(MINGW)g++
> CC = $(MINGW)gcc
> CLINK = $(MINGW)gcc
>
>


More information about the omniORB-list mailing list