Hello,

I've been trying to get sword-1.5.7 to compile on FreeBSD, but I just
can't get it done. When compiling installmgr.cpp, it says:

  In file included from /usr/include/sys/stat.h:50,
                   from ../include/filemgr.h:25,
                   from ../src/mgr/installmgr.cpp:16:
  /usr/include/sys/time.h:156: field `tc_nanotime' has incomplete type

and the same message about st_[amc]timespec in sys/stat.h. After having
given up on it several times, I finally have an idea what it's cause is.
See attachment for a stripped file that shows the problem. time.h is
included (from ftpparse.h) inside the sword namespace. When sys/time.h
is included later on outside the sword namespace, things like time_t are
not known there, but the #define's that do their magic inside the header
files are still defined and think it's already done.

I can get around it by replacing time_t by long and including time.h in
ftpparse.c.

I see a comment before the ftpparse #include directive in installmgr.h:
// move this include to cpp once struct ftpparse isn't exposed anymore
It should be solved when this is done. I might take some time to look
into it, but I'm not overly familiar with the plusses in c++.

Regards,
- Willem
/*
 * This is installmgr.cpp
 */
 
//
// installmgr.h -> swbuf.h
//
#include <stdlib.h>

//
// installmgr.h
//
namespace sword {       //SWORD_NAMESPACE_START

extern "C" {
#include <time.h>	// ftpparse.h
}

} // SWORD_NAMESPACE_END

//
// filemgr.h
//
#include <sys/stat.h>

Reply via email to