| Issue 46: | Problem with IntHash and Android | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
I'm just testing to compile for android and got an issue with IntHash, it compiles fine when the target is cpp but it fails when -D android is set, other classes seems to compile fine. I'm not sure if this is specific to my environment or a general problem. I'm compiling on windows, with the modified ndk that you mentioned on your blog.
The Testclass, compiled with: haxe -cpp cpp -main Test3 -D android
package;
class Test3
{
public static function main () {
var h = new IntHash();
h.set(1, "hello");
}
}
and the error message:
haxelib run hxcpp Build.xml haxe -Dandroid -Dcpp -Dhaxe_205 -Dtrue
D:\work\android\android-ndk-r4/build/prebuilt/windows/arm-eabi-4.4.0/bin/arm-eabi-g++ -I/cygdrive/D\work\android\android-ndk-r4/build/platforms/android-5/arch-arm/usr/include -I/cygdrive/d\work\dev\haxe\hxcpp
/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -frtti -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -m
arch=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fno-strict-aliasing -finline-limit=10000 -DANDROID -Wa,--noexecstack -O2 -DNDEBUG -c -Iinclude ./src/IntHash.cpp -oobj/Release/src/IntHash.obj
D:\work\android\android-ndk-r4/build/prebuilt/windows/arm-eabi-4.4.0/bin/arm-eabi-g++ -I/cygdrive/D\work\android\android-ndk-r4/build/platforms/android-5/arch-arm/usr/include -I/cygdrive/d\work\dev\haxe\hxcpp
/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -frtti -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -m
arch=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fno-strict-aliasing -finline-limit=10000 -DANDROID -Wa,--noexecstack -O2 -DNDEBUG -c -Iinclude ./src/Test3.cpp -oobj/Release/src/Test3.obj
./src/IntHash.cpp: In member function 'virtual Void IntHash_obj::set(int, Dynamic)':
./src/IntHash.cpp:38: error: invalid initialization of non-const reference of type 'Dynamic&' from a temporary of type 'Dynamic'
/cygdrive/d\work\dev\haxe\hxcpp/include/hx/StdLibs.h:68: error: in passing argument 1 of 'void __int_hash_set(Dynamic&, int, const Dynamic&)'
./src/IntHash.cpp: In member function 'virtual Dynamic IntHash_obj::get(int)':
./src/IntHash.cpp:48: error: invalid initialization of non-const reference of type 'Dynamic&' from a temporary of type 'Dynamic'
/cygdrive/d\work\dev\haxe\hxcpp/include/hx/StdLibs.h:69: error: in passing argument 1 of 'Dynamic __int_hash_get(Dynamic&, int)'
./src/IntHash.cpp: In member function 'virtual bool IntHash_obj::exists(int)':
./src/IntHash.cpp:56: error: invalid initialization of non-const reference of type 'Dynamic&' from a temporary of type 'Dynamic'
/cygdrive/d\work\dev\haxe\hxcpp/include/hx/StdLibs.h:70: error: in passing argument 1 of 'bool __int_hash_exists(Dynamic&, int)'
./src/IntHash.cpp: In member function 'virtual bool IntHash_obj::remove(int)':
./src/IntHash.cpp:64: error: invalid initialization of non-const reference of type 'Dynamic&' from a temporary of type 'Dynamic'
/cygdrive/d\work\dev\haxe\hxcpp/include/hx/StdLibs.h:71: error: in passing argument 1 of 'bool __int_hash_remove(Dynamic&, int)'
./src/IntHash.cpp: In member function 'virtual Dynamic IntHash_obj::keys()':
./src/IntHash.cpp:72: error: invalid initialization of non-const reference of type 'Dynamic&' from a temporary of type 'Dynamic'
/cygdrive/d\work\dev\haxe\hxcpp/include/hx/StdLibs.h:72: error: in passing argument 1 of 'Dynamic __int_hash_keys(Dynamic&)'
./src/IntHash.cpp: In member function 'virtual Dynamic IntHash_obj::iterator()':
./src/IntHash.cpp:81: error: invalid initialization of non-const reference of type 'Dynamic&' from a temporary of type 'Dynamic'
/cygdrive/d\work\dev\haxe\hxcpp/include/hx/StdLibs.h:73: error: in passing argument 1 of 'Dynamic __int_hash_values(Dynamic&)'
Called from <null> line 1
Called from BuildTool.hx line 883
Called from BuildTool.hx line 451
Called from BuildTool.hx line 474
Called from BuildTool.hx line 547
Called from BuildTool.hx line 618
Uncaught exception - Error in building thread
Error : Build failed
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Jul 30, 2010
#1
aboutwh...@googlemail.com
Aug 3, 2010
I changed the Dynamic refs to Dynamic values a few build ago - it seems the problem is not there now, so I'm going to call it fixed.
Status:
Fixed
Aug 3, 2010
thx, inthash seems to work now, but i get other errors: the first: ./src/__main__.cpp: In function 'void Java_org_haxe_HXCPP_main(JNIEnv*)': ./src/__main__.cpp:13: error: 'ANDROID_LOG_ERROR' was not declared in this scope ./src/__main__.cpp:13: error: '__android_log_print' was not declared in this scope after removing the call to __android_log_print i get the following error: /cygdrive/d\work\dev\haxe\hxcpp/src/hx/Lib.cpp: In function 'Dynamic __loadprim(String, String, int)': /cygdrive/d\work\dev\haxe\hxcpp/src/hx/Lib.cpp:358: error: 'struct std::string' has no member named '__CStr' /cygdrive/d\work\dev\haxe\hxcpp/src/hx/Lib.cpp:462: error: 'name' was not declared in this scope
Aug 3, 2010
all __android_log_print-lines causing problems on my system, after uncommenting all of them it compiles.
Aug 3, 2010
By the way, i get it compiled, but the apk crashes on my desire (your example worked for me). Can you send me your Basic Project Framework for your HxTest-App please (manifest etc), that would be fantastic :)
Aug 3, 2010
by the way i have two accounts, so the other posts was me too ;) |