Menu

Build errors in MinGW (but not on Linux)

Porting
Frank_S
2005-01-26
2012-11-20
  • Frank_S

    Frank_S - 2005-01-26

    I downloaded the newest (1.3.1) version and tried to compile in on Windows 2000 using MinGW and MSYS.  It worked fine for commonCpp 1.2.7, but now I get errors.

    I just downloaded it, unzipped and untared it.

    Then, in MinGW, in the commoncpp2-1.3.1 directory, I ran configure with no options.  That completed fine.  Then I ran make, which compiled for a while, but then I got this error:

    /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../include    -I../src -DCCXX_EXPORT_LIBRARY  -D_GNU_SOURCE  -I../w32  -g -O2 -c -o file.lo `test -f file.cpp || echo './'`file.cpp
    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  -DDLL_EXPORT -DPIC -o .libs/file.o
    file.cpp: In function `time_t ost::lastAccessed(const char*)':
    file.cpp:1453: `SECS_BETWEEN_EPOCHS' undeclared (first use this function)
    file.cpp:1453: (Each undeclared identifier is reported only once for each
       function it appears in.)
    file.cpp:1453: `SECS_TO_100NS' undeclared (first use this function)
    make[1]: *** [file.lo] Error 1
    make[1]: Leaving directory `/c/temp/commonCpp-1.3.1/commoncpp2-1.3.1/src'
    make: *** [all-recursive] Error 1

    It's like it totally missed the w32/c++/config.h file.

    What's the best way to correct this?

    I really want to contribute some code to allow raw UDP sockets, but build errors are killing me.  (When I started this with 1.2.7 I didn't have this many build problems.)  BTW, I was not using my new code on this build.  It was a fresh download.

     
    • David Sugar

      David Sugar - 2005-01-28

      It looks like "lastAccessed" in file.cpp is doing this because it's following the w32 build path rather than posix.  The SECS_xxx is defined somewhere in recent windows sdk, but perhaps is missing in the one distributed inside ming??  If so, it would be easy enough to add a #ifndef #define for these.  I don't know the correct values offhand, but if someone has a w32 machine with visual studio they should be able to look it up.

       
    • Seikima

      Seikima - 2005-06-22

      I'm having exactly the same issue when building with MinGW, under MSYS.  Indeed, it's somehow not picking up on the w32/cc++/config.h file, so I've tried about a dozen different ways of inlcuding that file in the problematic file.cpp, but it's only resulted in more errors, not less.  When the file is included, it not only has a problem with "SECS_BETWEEN_EPOCHS" and "SECS_TO_100NS", but also "snprintf" and others.

      Any other tips for fixing this problem?  (I'm using the most recent versions for all relevant programs.)

       

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.