Menu

#226 Mingw32 Builds fail

open
5
2007-01-24
2006-10-18
Anonymous
No

version 1.3.8, which is currently available on
sourceforge, with the latest Mingw32, gives the
following errors:
1st: It seems to have a slight problem with whitespaces
in the path
2nd: It creates an error: file.cpp:1455:
`SECS_BETWEEN_EPOCHS' undeclared
version 1.5.1 on the other hand creates a different
error (on the same file I think). Also, it still has
the same problem with the whitespaces (/c/Documents:
No such file or directory)
Below there are the parts of the build output that I
found to be the most `interesting'.

C:\Documents and Settings\kimonas\My
Documents\demokritos\gcc-dynlibs\commoncpp2
-1.3.8>sh
sh-2.04$ ./configure
checking build system type... i686-pc-mingw32
...
checking whether build environment is sane... yes
/c/Documents: /c/Documents: No such file or directory
configure: WARNING: `missing' script is too old or missing
checking for gawk... gawk
...
configure: WARNING:
-------------------------------------------------------
configure: WARNING: Could not autodetect NAT engine -
pf, ipf or netfilter.
configure: WARNING: NAT engine c++ class interface
support was disabled.
...
...
config.status: creating include/config.h
config.status: executing default-1 commands
sh-2.04$ make
Making all in include
...
...
...
g++ -DHAVE_CONFIG_H -I. -I. -I../include -I../src
-DCCXX_EXPORT_LIBRARY -D_GNU_SOURCE -I../w32 -g -O2 -c
file.cpp -MT file.lo -MD -MP -MF .deps/file.TPlo -DDL
L_EXPORT -DPIC -o .libs/file.o

file.cpp: In function `time_t ost::lastAccessed(const
char*)':
file.cpp:1455: `SECS_BETWEEN_EPOCHS' undeclared (first
use this function)
file.cpp:1455: (Each undeclared identifier is reported
only once for each
function it appears in.)
file.cpp:1455: `SECS_TO_100NS' undeclared (first use
this function)
make[1]: *** [file.lo] Error 1
make[1]: Leaving directory `/c/Documents and
Settings/kimonas/My Documents/demok
ritos/gcc-dynlibs/commoncpp2-1.3.8/src'
make: *** [all-recursive] Error 1
sh-2.04$

And for version 1.5.1

...
g++ -DHAVE_CONFIG_H -I. -I. -I../include -I../src
-DCCXX_EXPORT_LIBRARY -D_GNU_
SOURCE -I../w32 -g -O2 -MT file.lo -MD -MP -MF
.deps/file.Tpo -c file.cpp -DDLL
_EXPORT -DPIC -o .libs/file.o
file.cpp: In function `time_t ost::lastAccessed(const
char*)':
file.cpp:1486: error: integer constant is too large for
"long" type
file.cpp: In function `time_t ost::lastModified(const
char*)':
file.cpp:1512: error: integer constant is too large for
"long" type
make[1]: *** [file.lo] Error 1
make[1]: Leaving directory `/c/p/commoncpp2-1.5.1/src'
make: *** [all-recursive] Error 1

I also tried building from a path w/o whitespaces, it
didn't fix...

Platform is i686, Windows XP

Discussion

  • Nobody/Anonymous

    Logged In: NO

    OK, it is the same person who sent the bug report.

    I fixed it (for ver. 2-1.5.1) by adding LL at following the
    constants. The full patch is to put this in line file.cpp:1464

    #ifdef WIN32
    #ifndef SECS_BETWEEN_EPOCHS
    #ifdef __GNUC__
    #define SECS_BETWEEN_EPOCHS 11644473600LL
    #else
    #define SECS_BETWEEN_EPOCHS 11644473600
    #endif
    #endif

    #ifndef SECS_TO_100NS
    #ifdef __GNUC__
    #define SECS_TO_100NS 10000000LL
    #else
    #define SECS_TO_100NS 10000000
    #endif
    #endif
    #endif

    instead of the old #defines

    After fixing this, I get one more error:

    g++ -DHAVE_CONFIG_H -I. -I. -I../include -I../src
    -DCCXX_EXPORT_LIBRARY -D_GNU_
    SOURCE -I../w32 -g -O2 -MT socket.lo -MD -MP -MF
    .deps/socket.Tpo -c socket.cpp
    -DDLL_EXPORT -DPIC -o .libs/socket.o
    socket.cpp: In member function `ost::Socket::Error
    ost::UDPSocket::join(const os
    t::IPV4Multicast&, int)':
    socket.cpp:1605: error: aggregate `ost::ip_mreq group' has
    incomplete type and c
    annot be defined
    socket.cpp:1616: error: `IP_ADD_MEMBERSHIP' undeclared
    (first use this function)

    socket.cpp:1616: error: (Each undeclared identifier is
    reported only once for ea
    ch function it appears in.)
    make[1]: *** [socket.lo] Error 1
    make[1]: Leaving directory `/c/Documents and
    Settings/kimonas/My Documents/demok
    ritos/gcc-dynlibs/commoncpp2-1.5.1/src'
    make: *** [all-recursive] Error 1
    sh-2.04$

    Any idea?
    I am a fan of Common-C++, it is a very nice project.
    thanks for developping!

    -- Kimon
    mail: std01145 at the domain di.uoa.gr

     
  • Nobody/Anonymous

    Logged In: NO

    (me again)
    I think there is a confusion between winsock and winsock2
    When I remove winsock2 support from the config file,
    socket.cpp compiles ok. I saw in some docs that
    IP_ADD_MEMBERSHIP is specific to winsock1, and should not be
    used for winsock2. However IP_ADD_MEMBERSHIP is always used.
    (that was the first bug)

    Now, I remove winsock2 support, but I get another bug. Some
    winsock2-specific functions are used, and they cause compile
    error:
    g++ -DHAVE_CONFIG_H -I. -I. -I../include -I../src
    -DCCXX_EXPORT_LIBRARY -D_GNU_
    SOURCE -I../w32 -g -O2 -MT socketport.lo -MD -MP -MF
    .deps/socketport.Tpo -c soc
    ketport.cpp -DDLL_EXPORT -DPIC -o .libs/socketport.o
    socketport.cpp: In member function `virtual void
    ost::SocketService::run()':
    socketport.cpp:921: error: `WSAEventSelect' undeclared
    (first use this function)

    socketport.cpp:921: error: (Each undeclared identifier is
    reported only once for
    each function it appears in.)
    socketport.cpp:958: error: `WSANETWORKEVENTS' undeclared
    (first use this functio
    n)
    socketport.cpp:958: error: expected `;' before "events"
    socketport.cpp:975: error: `events' undeclared (first use
    this function)
    socketport.cpp:975: error: `WSAEnumNetworkEvents' undeclared
    (first use this fun
    ction)
    make[1]: *** [socketport.lo] Error 1

    Again, this is wrong behaviour because, if winsock2 is Not
    detected on a machine (as in mine, after the config.h hack),
    then winsock2-specific functions should be disabled.
    I didn't go further on. I'm unfamiliar with winsock(1/2)... :(

     
  • David Sugar

    David Sugar - 2007-01-24

    Logged In: YES
    user_id=217
    Originator: NO

    This should be fixed in 1.5.4 where EPOCH's const is declared "ll" (its a int64)...other issues may still be open...

     
  • David Sugar

    David Sugar - 2007-01-24
    • assigned_to: nobody --> dyfet
    • status: open --> open-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.