hx-ffi icon indicating copy to clipboard operation
hx-ffi copied to clipboard

Error readout from attempted Win7/Cygwin build.

Open 0b1kn00b opened this issue 11 years ago • 7 comments

Not experienced in building C, so may be something simple. Using latest hxcpp + cygwin. Configure seems to pass ok

haxelib run hxcpp Build.xml
cl.exe -Ilibffi/bin/include -nologo -O2 /WX- /fp:precise -DHX_WINDOWS -GR -Zi -Oy- -c -EHs -IC:\world\stack\prj\haxe\hxcpp-read-only//include -DHXCPP_VISIT_ALLOCS -D_CRT_SECURE_NO_DEPRECATE -wd4996 -MT ./common/ExternalInterface.cpp -Foobj/mscv17/common/ExternalInterface.obj
ExternalInterface.cpp
./common/ExternalInterface.cpp(62) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
./common/ExternalInterface.cpp(62) : error C2146: syntax error : missing ';' before identifier 'len'
./common/ExternalInterface.cpp(62) : error C2065: 'len' : undeclared identifier
./common/ExternalInterface.cpp(63) : error C2065: 'len' : undeclared identifier
./common/ExternalInterface.cpp(64) : error C2146: syntax error : missing ';' before identifier 'i'
./common/ExternalInterface.cpp(64) : error C2065: 'i' : undeclared identifier
./common/ExternalInterface.cpp(64) : error C2065: 'len' : undeclared identifier
./common/ExternalInterface.cpp(64) : error C2146: syntax error : missing ')' before identifier 'i'
./common/ExternalInterface.cpp(64) : error C2059: syntax error : ';'
./common/ExternalInterface.cpp(64) : error C2059: syntax error : ')'
./common/ExternalInterface.cpp(64) : error C2143: syntax error : missing ';' before '{'
./common/ExternalInterface.cpp(65) : error C2065: 'i' : undeclared identifier
./common/ExternalInterface.cpp(67) : error C2065: 'len' : undeclared identifier
./common/ExternalInterface.cpp(79) : error C2065: 'uint' : undeclared identifier
./common/ExternalInterface.cpp(79) : error C2146: syntax error : missing ';' before identifier 'len'
./common/ExternalInterface.cpp(79) : error C2065: 'len' : undeclared identifier
./common/ExternalInterface.cpp(81) : error C2065: 'len' : undeclared identifier
./common/ExternalInterface.cpp(83) : error C2065: 'len' : undeclared identifier
./common/ExternalInterface.cpp(85) : error C2065: 'len' : undeclared identifier
./common/ExternalInterface.cpp(86) : error C2065: 'uint' : undeclared identifier
./common/ExternalInterface.cpp(86) : error C2146: syntax error : missing ';' before identifier 'i'
./common/ExternalInterface.cpp(86) : error C2065: 'i' : undeclared identifier
./common/ExternalInterface.cpp(86) : error C2065: 'len' : undeclared identifier
./common/ExternalInterface.cpp(86) : error C2146: syntax error : missing ')' before identifier 'i'
./common/ExternalInterface.cpp(86) : error C2059: syntax error : ';'
./common/ExternalInterface.cpp(86) : error C2059: syntax error : ')'
./common/ExternalInterface.cpp(87) : error C2146: syntax error : missing ';' before identifier 'val_array_set_i'
./common/ExternalInterface.cpp(87) : error C2065: 'i' : undeclared identifier
./common/ExternalInterface.cpp(108) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
./common/ExternalInterface.cpp(108) : error C2146: syntax error : missing ';' before identifier 'num'
./common/ExternalInterface.cpp(108) : error C2065: 'num' : undeclared identifier
./common/ExternalInterface.cpp(109) : error C2065: 'num' : undeclared identifier
./common/ExternalInterface.cpp(110) : error C2146: syntax error : missing ';' before identifier 'i'
./common/ExternalInterface.cpp(110) : error C2065: 'i' : undeclared identifier
./common/ExternalInterface.cpp(110) : error C2065: 'num' : undeclared identifier
./common/ExternalInterface.cpp(110) : error C2146: syntax error : missing ')' before identifier 'i'
./common/ExternalInterface.cpp(110) : error C2059: syntax error : ';'
./common/ExternalInterface.cpp(110) : error C2059: syntax error : ')'
./common/ExternalInterface.cpp(110) : error C2143: syntax error : missing ';' before '{'
./common/ExternalInterface.cpp(111) : error C2065: 'i' : undeclared identifier
./common/ExternalInterface.cpp(119) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
./common/ExternalInterface.cpp(119) : error C2146: syntax error : missing ';' before identifier 'args_size'
./common/ExternalInterface.cpp(119) : error C2065: 'args_size' : undeclared identifier
./common/ExternalInterface.cpp(120) : error C2065: 'args_size' : undeclared identifier
./common/ExternalInterface.cpp(121) : error C2146: syntax error : missing ';' before identifier 'i'
./common/ExternalInterface.cpp(121) : error C2065: 'i' : undeclared identifier
./common/ExternalInterface.cpp(121) : error C2065: 'args_size' : undeclared identifier
./common/ExternalInterface.cpp(121) : error C2146: syntax error : missing ')' before identifier 'i'
./common/ExternalInterface.cpp(121) : error C2059: syntax error : ';'
./common/ExternalInterface.cpp(121) : error C2059: syntax error : ')'
./common/ExternalInterface.cpp(121) : error C2143: syntax error : missing ';' before '{'
./common/ExternalInterface.cpp(122) : error C2065: 'i' : undeclared identifier
./common/ExternalInterface.cpp(125) : error C2065: 'args_size' : undeclared identifier
./common/ExternalInterface.cpp(132) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
./common/ExternalInterface.cpp(132) : error C2146: syntax error : missing ';' before identifier 'type'
./common/ExternalInterface.cpp(132) : error C2065: 'type' : undeclared identifier
./common/ExternalInterface.cpp(133) : error C2065: 'type' : undeclared identifier
./common/ExternalInterface.cpp(133) : error C2050: switch expression not integral
./common/ExternalInterface.cpp(138) : error C2061: syntax error : identifier 'uint8_t'
./common/ExternalInterface.cpp(139) : error C2061: syntax error : identifier 'int8_t'
./common/ExternalInterface.cpp(140) : error C2061: syntax error : identifier 'uint16_t'
./common/ExternalInterface.cpp(141) : error C2061: syntax error : identifier 'int16_t'
./common/ExternalInterface.cpp(142) : error C2061: syntax error : identifier 'uint32_t'
./common/ExternalInterface.cpp(143) : error C2061: syntax error : identifier 'int32_t'
./common/ExternalInterface.cpp(147) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
./common/ExternalInterface.cpp(147) : error C2146: syntax error : missing ';' before identifier 'low'
./common/ExternalInterface.cpp(147) : error C2065: 'low' : undeclared identifier
./common/ExternalInterface.cpp(148) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
./common/ExternalInterface.cpp(148) : error C2146: syntax error : missing ';' before identifier 'high'
./common/ExternalInterface.cpp(148) : error C2086: 'const int int64_t' : redefinition
        ./common/ExternalInterface.cpp(147) : see declaration of 'int64_t'
./common/ExternalInterface.cpp(148) : error C2065: 'high' : undeclared identifier
./common/ExternalInterface.cpp(149) : error C2061: syntax error : identifier 'int64_t'
./common/ExternalInterface.cpp(152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
./common/ExternalInterface.cpp(152) : error C2146: syntax error : missing ';' before identifier 'size'
./common/ExternalInterface.cpp(152) : error C2065: 'size' : undeclared identifier
./common/ExternalInterface.cpp(153) : error C2065: 'size' : undeclared identifier
./common/ExternalInterface.cpp(155) : error C2146: syntax error : missing ';' before identifier 'i'
./common/ExternalInterface.cpp(155) : error C2065: 'i' : undeclared identifier
./common/ExternalInterface.cpp(159) : error C2065: 'i' : undeclared identifier
./common/ExternalInterface.cpp(163) : error C2065: 'i' : undeclared identifier
./common/ExternalInterface.cpp(181) : error C2065: 'uint8_t' : undeclared identifier
./common/ExternalInterface.cpp(181) : error C2059: syntax error : ')'
./common/ExternalInterface.cpp(182) : error C2065: 'int8_t' : undeclared identifier
./common/ExternalInterface.cpp(182) : error C2059: syntax error : ')'
./common/ExternalInterface.cpp(183) : error C2065: 'uint16_t' : undeclared identifier
./common/ExternalInterface.cpp(183) : error C2059: syntax error : ')'
./common/ExternalInterface.cpp(184) : error C2065: 'int16_t' : undeclared identifier
./common/ExternalInterface.cpp(184) : error C2059: syntax error : ')'
./common/ExternalInterface.cpp(185) : error C2065: 'uint32_t' : undeclared identifier
./common/ExternalInterface.cpp(185) : error C2059: syntax error : ')'
./common/ExternalInterface.cpp(186) : error C2065: 'int32_t' : undeclared identifier
./common/ExternalInterface.cpp(186) : error C2059: syntax error : ')'
./common/ExternalInterface.cpp(189) : error C2065: 'uint' : undeclared identifier
./common/ExternalInterface.cpp(189) : error C2146: syntax error : missing ';' before identifier 'size'
./common/ExternalInterface.cpp(189) : error C2065: 'size' : undeclared identifier
./common/ExternalInterface.cpp(190) : error C2065: 'size' : undeclared identifier
./common/ExternalInterface.cpp(190) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Called from ? line 1
Called from BuildTool.hx line 1536
Called from BuildTool.hx line 673
Called from BuildTool.hx line 708
Called from BuildTool.hx line 845
Called from BuildTool.hx line 942
Uncaught exception - Error in building thread
Makefile:8: recipe for target `build-32' failed
make: *** [build-32] Error 1

dayz@dayz-HP /cygdrive/c/world/stack/prj/haxe/hx-ffi/project
$

0b1kn00b avatar Oct 01 '13 12:10 0b1kn00b

What compiler are you using?

TomBebbington avatar Oct 03 '13 15:10 TomBebbington

Using either MSV10 or MSV11 32 bit produces a similar set of errors. I can post them if they're needed

0b1kn00b avatar Oct 03 '13 17:10 0b1kn00b

Huh... it works fine with Clang and GCC on my Linux machine. If possible, could you please try again with MinGW (or Clang if there's a windows build)? Looks like there are some incompatibilities between platforms.

On Thu, Oct 3, 2013 at 6:17 PM, 0b1kn00b [email protected] wrote:

Using either MSV10 or MSV11 32 bit produces a similar set of errors. I can post them if they're needed

— Reply to this email directly or view it on GitHubhttps://github.com/TopHattedCoder/hx-ffi/issues/1#issuecomment-25639766 .

TomBebbington avatar Oct 07 '13 13:10 TomBebbington

Still no joy. I #include <stdint.h>, changed uint to unsigned int and then got

cl.exe -Ilibffi/bin/include -nologo -O2 /WX- /fp:precise -DHX_WINDOWS -GR -Zi -Oy- -c -EHs -IC:\world\stack\prj\haxe\hxcpp-read-only//include -DHXCPP_VISIT_ALLOCS -D_CRT_SECURE_NO_DEPRECATE -wd4996 -MT ./common/ExternalInterface.cpp -Foobj/mscv17/common/ExternalInterface.obj
ExternalInterface.cpp
c:\world\stack\prj\haxe\hx-ffi\project\common\externalinterface.cpp(259) : warning C4700: uninitialized local variable 'func' used
link.exe -out:obj/lib/ffi.ndll -nologo -machine:x86 -dll -libpath:lib @all_objs -lffi -lneko
LINK : warning LNK4044: unrecognized option '/lffi'; ignored
LINK : warning LNK4044: unrecognized option '/lneko'; ignored
   Creating library obj/lib/ffi.lib and object obj/lib/ffi.exp
ExternalInterface.obj : error LNK2019: unresolved external symbol _ffi_prep_cif referenced in function "struct _value * __cdecl hx_ffi_cif_prep(struct _value *,struct _value *,struct _value *)" (?hx_ffi_cif_prep@@YAPAU_value@@PAU1@00@Z)
ExternalInterface.obj : error LNK2019: unresolved external symbol _ffi_call referenced in function "struct _value * __cdecl hx_ffi_cif_call(struct _value *,struct _value *,struct _value *)" (?hx_ffi_cif_call@@YAPAU_value@@PAU1@00@Z)
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_void
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_uint8
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_sint8
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_uint16
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_sint16
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_uint32
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_sint32
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_uint64
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_sint64
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_float
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_double
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_pointer
ExternalInterface.obj : error LNK2001: unresolved external symbol __imp__ffi_type_longdouble
obj/lib/ffi.ndll : fatal error LNK1120: 15 unresolved externals
Called from ? line 1
Called from BuildTool.hx line 1536
Called from BuildTool.hx line 673
Called from BuildTool.hx line 708
Called from BuildTool.hx line 845
Called from BuildTool.hx line 953
Called from BuildTool.hx line 336
Uncaught exception - Error : 1120 - build cancelled

which might bring us closer to a solution: Looks to me like TYPE(tname) isn't working right

0b1kn00b avatar Oct 28 '13 16:10 0b1kn00b

Thanks... it looks like there is a linkage error to me from this output: LINK : warning LNK4044: unrecognized option '/lffi'; ignored LINK : warning LNK4044: unrecognized option '/lneko'; ignored I'm still working on getting this library to work with Haxe 3.0.1, if anything fails to compile for you.

TomBebbington avatar Oct 28 '13 17:10 TomBebbington

That's worth knowing. I managed to get a successful build using some of Cauê Waneks code (with a lot of help from him), have yet to test it. Will get back to you.

0b1kn00b avatar Oct 28 '13 17:10 0b1kn00b

where might I find m.dll referenced in the tests?

0b1kn00b avatar Oct 28 '13 17:10 0b1kn00b