Fossa is an asynchronous, non-blocking multi-protocol networking library for C/C++ from
http://cesanta.com. The source is available on Github at
https://github.com/cesanta/fossa.
I'm looking into it to simplify creating a chat-like server-client application for a LAN. But trying to build fossa.c and fossa.h (into a shared library, doubt that matters) gives many errors, such as:
- - - - - - - - - - common.lib
Building fossa.obj.
C:\Users\Me\Async\Common\fossa.c(1039): warning #2018: Undeclared function 'wcscat' (did you mean 'strcat'?); assuming 'extern' returning 'int'.
C:\Users\Me\Async\Common\fossa.c(2824): warning #2018: Undeclared function 'close' (did you mean 'pclose'?); assuming 'extern' returning 'int'.
C:\Users\Me\Async\Common\fossa.c(3072): warning #2166: Inconsistent linkage for 'ns_forward', previously declared at C:\Users\Me\Async\Common\fossa.c(75).
C:\Users\Me\Async\Common\fossa.c(3288): warning #2018: Undeclared function '_mkdir' (did you mean '(no name)'?); assuming 'extern' returning 'int'.
C:\Users\Me\Async\Common\fossa.c(3368): warning #2018: Undeclared function '_atoi64' (did you mean 'atoi'?); assuming 'extern' returning 'int'.
C:\Users\Me\Async\Common\fossa.c(3562): warning #2117: Old-style function definition for 'ws_random_mask'.
C:\Users\Me\Async\Common\fossa.c(3583): warning #2154: Unreachable code.
C:\Users\Me\Async\Common\fossa.c(4185): error #2152: Unknown field 'st_mtime' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4186): error #2152: Unknown field 'st_size' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4227): error #2152: Unknown field 'st_size' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4247): error #2152: Unknown field 'st_size' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4254): error #2152: Unknown field 'st_size' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4261): error #2152: Unknown field 'st_mtime' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4261): warning #2145: Assignment of 'int *' to 'unsigned long int *'.
C:\Users\Me\Async\Common\fossa.c(4694): error #2152: Unknown field 'st_size' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4695): error #2152: Unknown field 'st_mode' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4715): error #2152: Unknown field 'st_mtime' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4715): warning #2145: Assignment of 'int *' to 'const unsigned long int *'.
C:\Users\Me\Async\Common\fossa.c(4730): error #2149: Undefined size for 'st' with type 'ns_stat_t'.
C:\Users\Me\Async\Common\fossa.c(4796): error #2152: Unknown field 'st_mtime' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4812): error #2152: Unknown field 'st_mode' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4813): error #2152: Unknown field 'st_size' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4829): error #2152: Unknown field 'st_mode' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4837): error #2152: Unknown field 'st_mode' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4865): error #2149: Undefined size for 'st' with type 'ns_stat_t'.
C:\Users\Me\Async\Common\fossa.c(4874): error #2152: Unknown field 'st_mode' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4881): warning #2018: Undeclared function 'rmdir' (did you mean '(no name)'?); assuming 'extern' returning 'int'.
C:\Users\Me\Async\Common\fossa.c(4887): error #2149: Undefined size for 'st' with type 'ns_stat_t'.
C:\Users\Me\Async\Common\fossa.c(4890): error #2152: Unknown field 'st_mode' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(4908): error #2149: Undefined size for 'st' with type 'ns_stat_t'.
C:\Users\Me\Async\Common\fossa.c(4923): error #2149: Undefined size for 'st' with type 'ns_stat_t'.
C:\Users\Me\Async\Common\fossa.c(4946): warning #2018: Undeclared function '_atoi64' (did you mean 'atoi'?); assuming 'extern' returning 'int'.
C:\Users\Me\Async\Common\fossa.c(4975): error #2149: Undefined size for 'st' with type 'ns_stat_t'.
C:\Users\Me\Async\Common\fossa.c(4997): error #2168: Operands of '=' have incompatible types 'ns_stat_t' and 'ns_stat_t'.
C:\Users\Me\Async\Common\fossa.c(5077): warning #2018: Undeclared function '_endthread' (did you mean '_hread'?); assuming 'extern' returning 'int'.
C:\Users\Me\Async\Common\fossa.c(5099): warning #2018: Undeclared function '_endthread' (did you mean '_hread'?); assuming 'extern' returning 'int'.
C:\Users\Me\Async\Common\fossa.c(5109): error #2048: Undeclared identifier 'ns_start_thread' (did you mean 'ns_stat_t'?).
C:\Users\Me\Async\Common\fossa.c(5109): error #2001: Syntax error: expected ')' but found ','.
C:\Users\Me\Async\Common\fossa.c(5109): error #2149: Undefined size for 'func' with type 'ns_stat_t'.
C:\Users\Me\Async\Common\fossa.c(5109): error #2149: Undefined size for 'tp' with type 'ns_stat_t'.
C:\Users\Me\Async\Common\fossa.c(5109): error #2001: Syntax error: expected ';' but found ')'.
C:\Users\Me\Async\Common\fossa.c(5109): warning #2114: Local 'tp' is not referenced.
C:\Users\Me\Async\Common\fossa.c(5109): warning #2114: Local 'func' is not referenced.
C:\Users\Me\Async\Common\fossa.c(5117): warning #2018: Undeclared function 'wcslen' (did you mean '(no name)'?); assuming 'extern' returning 'int'.
C:\Users\Me\Async\Common\fossa.c(5507): error #2149: Undefined size for 'st' with type 'ns_stat_t'.
C:\Users\Me\Async\Common\fossa.c(5510): error #2152: Unknown field 'st_mode' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(5541): error #2152: Unknown field 'st_mode' of 'ns_stat_t' (did you mean '(no name)'?).
C:\Users\Me\Async\Common\fossa.c(5747): warning #2018: Undeclared function '_wstati64' (did you mean '_wstat'?); assuming 'extern' returning 'int'.
C:\Users\Me\Async\Common\fossa.c(5768): warning #2018: Undeclared function '_wopen' (did you mean '_lopen'?); assuming 'extern' returning 'int'.
C:\Users\Me\Async\Common\fossa.c(6963): warning #2030: '=' used in a conditional expression.
C:\Users\Me\Async\Common\fossa.c(6971): warning #2251: Operands of '>=' have types with different signedness: 'int' and 'unsigned int'.
*** Error code: 1 ***
Done.
Now I'd assume this should compile in Windows, and there are several "#ifdef _WIN32" so it must, but there is no mention of the compiler. Some of the included libraries seem like they might be for gcc/linux... "#include <signal.h>" etc. Could all the errors simply be because gcc is required (and is not mentioned)?
And is it worth it to try and "fix" these issues for native Pelle's compilation, or just build into a static library using gcc and link it? (Can polink even link .obj with .o objects?) Some of these I don't see an intuitive solution to, such as "Unknown field 'st_mtime' of 'ns_stat_t' (did you mean '(no name)'?)." Any ideas? Thanks for taking a look.