Link issues on Windows 7 32-bit

1,113 views
Skip to first unread message

harvey

unread,
Aug 14, 2012, 7:33:39 PM8/14/12
to andro...@googlegroups.com
Hi,

I am attempting to use Necessitas 0.3 Alpha 4 on Windows 7 32-bit to port a cross-platform Qt application to Android (tried it on Linux as well but wasn't any easier, just had different problems).  Project consists of several shared libraries with some inter-dependencies, and a small test executable. At the moment I'm having several link issues.


ISSUE #1:

Object files are generated fine but then link fails as path to object files is missing one directory separator. 

I have the following in my pro file (example for one file, I have three in total):

    CONFIG(debug, debug|release):OBJECTS_DIR += debug

    SOURCES += ../../common/common.cpp

Object file "common.obj" gets generated and ends up in "debug" subdirectory fine, as expected.  Now I get the following error:

    arm-linux-androideabi-g++: error: debugcommon.obj: No such file or directory

Name of the objects directory ("debug") and object file ("common.obj") get concatenated -- directory separator between them is missing. 

Relevant parts in generated Makefile:

    OBJECTS_DIR   = debug\

    OBJECTS       = debug\common.obj \

    DESTDIR       =

QtCreator is v2.3.1 (based on 32bit version of Qt 4.8.0).

I've found a workaround for this -- don't use debug directory:

    # CONFIG(debug, debug|release):OBJECTS_DIR += debug

This is not much of a problem when using shadow builds as all build junk gets separated from sources into shadow build directory anyway, but I'd still like to know why is this happening in the first place.  I've never had this issue with Qt before.


ISSUE #2:
 
I've spent several days struggling with the new problem: linker is incapable of finding NDK libraries.

I have tried two Necessitas installs -- one where I haven't modified anything, left all default values, and the second one where I tried to use newer NDK and configure everything manually.  Neither works.

Problem which I was unable to overcome was with linker.  It just can't find NDK, always fails with being unable to find "crtbegin_so.o".  There are a few answers on stackoverflow which suggest that this issue is with android-ndk-r6b which comes by default with Necessitas, but as mentioned previously I had even less luck when I tried to point Necessitas to a later NDK (I tried r8b -- the build fails very early on complaining about missing STL header files, found no solution for that).

I tried to work around this issue by just copying "crtbegin_so.o", "crtend_android.o" and "crtend_so.o" to my build directory but that doesn't get me much further -- linker fails again, this time on QtGui. This one is even more of a mystery since I'm trying to build a shared library that uses only 'core' and 'xml', not 'gui'.  I know that qmake variable QT by default contains 'core' and 'gui', but I thought this does not apply when TEMPLATE is set to 'lib'?  I removed 'gui' from both "mkspecs/android-g++/qmake.conf" and "qws.conf" (the only two places where I could find it), also carefully checked all my pro files just in case, but is still comes up with "ld.exe: cannot find -lQtGui" message.  I also tried with two versions of project's "libs.xml" -- one that had QtGui added to qt-libs, the other one without it. 

I checked contents of "\Necessitas\Android\Qt\480\armeabi\lib" and everything is in there, including lots of prl and pc files full of wrong paths (leftover from developers machine?) -- removing those makes them disappear from generated lnk.cmdline files but that still doesn't help.  I suspect that Windows Necessitas may be unable to handle standard Windows paths containing backslash -- "missing" QtGui is located in "\Necessitas\Android\Qt\480\armeabi\lib" and lnk.cmdfile for the first module contains "-LC:\Necessitas\Android\Qt\480\armeabi\lib".  So it should be finding it, but it isn't.  All other paths in lnk.cmdline have forward slashes as direcotry separators.  I searched everywhere (including places like Build Environment in QtCreator) but haven't found yet where this path is coming from and how to change it.


ISSUE #3:

I found this bit in the compile output:

    C:/Necessitas/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-g++ @my_lib.so.1.0.0.lnk.cmdline
    del /q 2> NUL my_lib.so.1.0.0.lnk.cmdline
    ln -s my_lib.so.1.0.0 my_lib.so
    ln -s my_lib.so.1.0.0 my_lib.so.1
    ln -s my_lib.so.1.0.0 my_lib.so.1.0

"ln -s" is failing, of course, since I'm build this on Windows.  Not sure where this is coming from or how to change it to "mklink".  The only place where I found “QMAKE_SYMBOLIC_LINK = ln –s” is "\Necessitas\Android\Qt\480\armeabi\mkspecs\unsupported\win32-g++-cross\qmake.conf" but that's not it: this conf file is meant for MinGW (tried changing it anyway -- nothing).  If I add something like "QMAKE_SYMBOLIC_LINK = copy /y" then in my generated Makefile I can see that SYMLINK changes from "ln -s" to "copy /y" but this is ignored -- lnk.cmdline still gets generated with "ln -s" instead of "copy /y".


Any help would be greatly appreciated -- I've been struggling with this for almost two weeks now.

Cheers,
Harvey

Ray Donnelly

unread,
Aug 14, 2012, 8:22:14 PM8/14/12
to andro...@googlegroups.com
The usual reason for having unix-isms in your Makefile is because
you've likely got a cygwin or a MSYS sh.exe in your path. From
cmd.exe, enter:

where sh.exe

..and remove the resulting path from your PATH env. var, then
re-launch Qt Creator and force re-run qmake.

After that you should have more luck. We're hoping to release alpha 4
(test at least) soon, but that's proving arduous to say the least!

Cheers,

Ray.

harvey

unread,
Aug 14, 2012, 10:43:55 PM8/14/12
to andro...@googlegroups.com

Hi Ray,

Thanks for your reply.

I do have Cygwin installed but it is not in my path. 

I checked the contents of PATH variable and also tried both "where sh.exe" and "where bash.exe" -- nothing.  Even renamed Cygwin install directory for good measure and tried building again -- no change.

Cheers,
Harvey

Ray Donnelly

unread,
Aug 15, 2012, 7:28:04 PM8/15/12
to andro...@googlegroups.com
Hi Harvey,

This evening, BogDan announced the Alpha 4 test release:

http://mail.kde.org/pipermail/necessitas-devel/2012-August/001122.html

Can you try with this version, and if it's still broken, If you can
prepare me a simple test project I will investigate further for you.

Cheers,

Ray.

harvey

unread,
Aug 15, 2012, 8:47:10 PM8/15/12
to andro...@googlegroups.com

Hi Ray,

Thanks for that.  Unfortunately, new installer is even more broken than the last one, doesn't work at all.

When I change install directory and press Next it crashes immediately.  I tried both with non-existent directory and an existing but empty directory.

Cheers,
Harvey

harvey

unread,
Aug 16, 2012, 1:36:05 AM8/16/12
to andro...@googlegroups.com
> When I change install directory and press Next it crashes immediately.  I tried both with non-existent directory and an existing but empty
> directory.

Found a way to prevent crash -- don't click on Next button, just press Enter with focus on path text box.


Ray Donnelly

unread,
Aug 16, 2012, 3:50:11 AM8/16/12
to andro...@googlegroups.com

Weird. Ok we'll investigate this.

Thanks for the info.

harvey

unread,
Aug 16, 2012, 8:16:24 PM8/16/12
to andro...@googlegroups.com
I tried Alpha 4. 

QtCreator hasn't crashed yet, unlike the previous one.

Have new build issue, though:

    12:11:44: Running steps for project MyProjQtAndroid...

    12:11:44: Starting: "ma-make.exe" clean -w

    ma-make.exe: Entering directory `C:/Projects/MyProjQtAndroid-build-7e5262-Debug'

    cd jni\ && ma-make.exe -f Makefile clean

    ma-make.exe: Leaving directory `C:/Projects/MyProjQtAndroid-build-7e5262-Debug'

    'ma-make.exe' is not recognized as an internal or external command,

    operable program or batch file.

    ma-make.exe: *** [sub-jni-clean] Error 1

    12:11:45: The process "ma-make.exe" exited with code 2.


harvey

unread,
Aug 16, 2012, 8:47:41 PM8/16/12
to andro...@googlegroups.com
"necessitas.bat" is located in "<install_dir>\QtCreator\bin" and looks like this:

    @SET BIN_PATH=%CD%
    @SET BIN_PATH=%BIN_PATH:\=/%
    @SET PATH=%PATH%;%BIN_PATH%

    @SET LD_LIBRARY_PATH=%BIN_PATH%/../Qt/lib;%LD_LIBRARY_PATH%
    @SET QT_PLUGIN_PATH=%BIN_PATH%/../Qt/plugins;%QT_PLUGIN_PATH%
    @SET QT_IMPORT_PATH=%BIN_PATH%/../Qt/imports;%QT_IMPORT_PATH%

    start %BIN_PATH%/qtcreator.exe %*

If I double click on "necessitas.bat" to start QtCreator it will set LD_LIBRARY_PATH, QT_PLUGIN_PATH and QT_IMPORT_PATH like this:

    LD_LIBRARY_PATH=<install_dir>/QtCreator/bin/../Qt/lib;
    QT_PLUGIN_PATH=<install_dir>/QtCreator/bin/../Qt/plugins;
    QT_IMPORT_PATH=<install_dir>/QtCreator/bin/../Qt/imports;

These directories don't exist.  The only "Qt/lib", "Qt/plugins" and "Qt/imports" I could find are all located in "<install_dir>\Android\Qt\482\armeabi".

Am I not supposed to start QtCreator with "necessitas.bat"?  I see that QtCreator start menu entry links to "qtcreator.exe", not "necessitas.bat".

harvey

unread,
Aug 17, 2012, 1:57:37 AM8/17/12
to andro...@googlegroups.com
>   'ma-make.exe' is not recognized as an internal or external command, operable program or batch file.

I can see in Build Environment that BIN_PATH is coorectly set to "C:/NecessitasA4/QtCreator/bin" but I still get this message.
To work around this issue I had to add "C:/NecessitasA4/QtCreator/bin" to PATH. 
This was not needed for previous Necessitas release.

harvey

unread,
Aug 17, 2012, 2:22:08 AM8/17/12
to andro...@googlegroups.com
Unfortunately, Alpha 4 works no better than the previous release (except for much improved QtCreator stability) -- still have the same issues with paths:

    c:/necessitasa4/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot open crtbegin_so.o: No such file or directory

    c:/necessitasa4/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot open crtend_so.o: No such file or directory

    c:/necessitasa4/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot find -lQtCore


Ray Donnelly

unread,
Aug 17, 2012, 2:23:01 AM8/17/12
to andro...@googlegroups.com

Your system seems a bit messed up to be honest with you. Windows should always look I'm the path of the running executable when launching new processes.

Ray Donnelly

unread,
Aug 17, 2012, 2:24:09 AM8/17/12
to andro...@googlegroups.com

No this is not needed and will disappear in the future.

Ray Donnelly

unread,
Aug 17, 2012, 2:27:21 AM8/17/12
to andro...@googlegroups.com

Did you delete your old settings folder before installing? it should be %APPDATA%/Nokia. Please do this and then re-install

harvey

unread,
Aug 19, 2012, 6:22:56 PM8/19/12
to andro...@googlegroups.com
Hi,


> Did you delete your old settings folder before installing? it should be %APPDATA%/Nokia. Please do this and then re-install

I didn't.  There is no %APPDATA%/Nokia in my user dir. 

I did find "%APPDATA%/Roaming/Nokia" but all paths in there were either OK (including '/' as a dir separator) or don't matter (e.g. MSVC toolchain paths).

Cheers,
Harvey

harvey

unread,
Aug 19, 2012, 6:25:28 PM8/19/12
to andro...@googlegroups.com

Hi,



> Your system seems a bit messed up to be honest with you. Windows should always look I'm the path of the running executable when
> launching new processes.

That did occur to me but then all other development tools work fine, including VS2010 with or without Qt plug-in.  I don't have these problems with anything else.

Cheers,
Harvey

harvey

unread,
Aug 29, 2012, 1:36:21 AM8/29/12
to andro...@googlegroups.com

Hi,

I have upgraded to Necessitas Alpha 4.1 and I still have problems with
crtbegin_so.o and crtend_so.o on Windows.

Linker just refuses to pick them up -- no matter what I do I always end up with this message:
c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.3/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot open crtbegin_so.o: No such file or directory

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.3/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot open crtend_so.o: No such file or directory

 

Actually, that's not quite correct -- one thing that does work is if I copy these files into my project's obj directory; everything else fails.

 

Why would this not work?

LIBS += $$(ANDROID_NDK_ROOT)/platforms/$$(ANDROID_NDK_PLATFORM)/arch-arm/usr/lib/crtbegin_so.o
LIBS += $$(ANDROID_NDK_ROOT)/platforms/$$(ANDROID_NDK_PLATFORM)/arch-arm/usr/lib/crtend_so.o


This expands nicely in
lnk.cmdfile into correct paths:

C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtbegin_so.o
C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtend_so.o

Yet I still get the same error message.

 

Any ideas?

 

Cheers,

Harvey

Ray Donnelly

unread,
Aug 29, 2012, 7:10:39 AM8/29/12
to andro...@googlegroups.com
Hi Harvey,

Can you add -v to the link flags and paste me the full output of the
link command and link output?

harvey

unread,
Aug 29, 2012, 6:11:32 PM8/29/12
to andro...@googlegroups.com
> Can you add -v to the link flags and paste me the full output of the link command and link output?

Link command:

-Wl,-soname,libnw_usb.so.1 -v -Wl,--no-undefined -Wl,-z,noexecstack -shared -Wl,-rpath=C:/tmp/necessitas/unstable/Android/Qt/482/build-armeabi/install/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libnw_libusb.so.1.0.0 common.o hid_rdp.o nw_libusb.o   -LC:/NecessitasA41/android-ndk/platforms/android-5/arch-arm//usr/lib -LC:\NecessitasA41\Android\Qt\482\armeabi\lib  -LC:/Projects/Android/libusb_android/libs/armeabi -lusb -lgnustl_shared -LC:/NecessitasA41/android-ndk/../Android/Qt/482/armeabi/lib -LC:/NecessitasA41/android-ndk/sources/crystax/empty/arm -LC:/NecessitasA41/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/4.6.3 -lQtCore -LC:\NecessitasA41\Android\Qt\482\armeabi/lib -L/tmp/necessitas/android-ndk/platforms/android-5/arch-arm//usr/lib -llog -lz -lm -ldl -lc -lgcc 

Link output:

echo -Wl,-soname,libnw_usb.so.1 -v -Wl,--no-undefined -Wl,-z,noexecstack -shared -Wl,-rpath=C:/tmp/necessitas/unstable/Android/Qt/482/build-armeabi/install/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libnw_libusb.so.1.0.0 common.o hid_rdp.o nw_libusb.o -LC:/NecessitasA41/android-ndk/platforms/android-5/arch-arm//usr/lib -LC:\NecessitasA41\Android\Qt\482\armeabi\lib -LC:/Projects/Android/libusb_android/libs/armeabi -lusb -lgnustl_shared -LC:/NecessitasA41/android-ndk/../Android/Qt/482/armeabi/lib -LC:/NecessitasA41/android-ndk/sources/crystax/empty/arm -LC:/NecessitasA41/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/4.6.3 -lQtCore -LC:\NecessitasA41\Android\Qt\482\armeabi/lib -L/tmp/necessitas/android-ndk/platforms/android-5/arch-arm//usr/lib -llog -lz -lm -ldl -lc -lgcc > libnw_libusb.so.1.0.0.lnk.cmdline

C:/NecessitasA41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/arm-linux-androideabi-g++ @libnw_libusb.so.1.0.0.lnk.cmdline

Using built-in specs.

COLLECT_GCC=C:/NecessitasA41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/arm-linux-androideabi-g++

COLLECT_LTO_WRAPPER=c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../libexec/gcc/arm-linux-androideabi/4.6.3/lto-wrapper.exe

Target: arm-linux-androideabi

Configured with: /home/crystax/work/ndk/toolchain/build/../gcc/gcc-4.6.3/configure --prefix=/home/crystax/work/ndk/platform/ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows --target=arm-linux-androideabi --host=i586-mingw32msvc --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++,objc,obj-c++ --with-gmp=/tmp/ndk-crystax/build/toolchain/temp-install --with-mpfr=/tmp/ndk-crystax/build/toolchain/temp-install --with-mpc=/tmp/ndk-crystax/build/toolchain/temp-install --with-cloog=/tmp/ndk-crystax/build/toolchain/temp-install --with-ppl=/tmp/ndk-crystax/build/toolchain/temp-install --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --enable-shared --disable-tls --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --enable-initfini-array --disable-nls --prefix=/home/crystax/work/ndk/platform/ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows --with-sysroot=/home/crystax/work/ndk/platform/ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/sysroot --with-binutils-version=2.22 --with-mpfr-version=3.0.1 --with-gmp-version=5.0.2 --with-gcc-version=4.6.3 --with-gdb-version=7.3 --with-mpc-version=0.9 --with-expat-version=2.0.1 --with-cloog-ppl-version=0.15.9 --with-ppl-version=0.11.2 --with-arch=armv5te --program-transform-name='s&^&arm-linux-androideabi-&'

Thread model: posix

gcc version 4.6.3 20120105 (prerelease) (Linaro GCC 4.6-2012.01)

COMPILER_PATH=c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../libexec/gcc/arm-linux-androideabi/4.6.3/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../libexec/gcc/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.3/../../../../arm-linux-androideabi/bin/

LIBRARY_PATH=c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.3/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../lib/gcc/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.3/../../../../arm-linux-androideabi/lib/

COLLECT_GCC_OPTIONS='-v' '-shared' '-o' 'libnw_libusb.so.1.0.0' '-LC:/NecessitasA41/android-ndk/platforms/android-5/arch-arm//usr/lib' '-LC:NecessitasA41AndroidQt482armeabilib' '-LC:/Projects/Android/libusb_android/libs/armeabi' '-LC:/NecessitasA41/android-ndk/../Android/Qt/482/armeabi/lib' '-LC:/NecessitasA41/android-ndk/sources/crystax/empty/arm' '-LC:/NecessitasA41/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/4.6.3' '-LC:NecessitasA41AndroidQt482armeabi/lib' '-L/tmp/necessitas/android-ndk/platforms/android-5/arch-arm//usr/lib' '-shared-libgcc' '-march=armv5te' '-mfloat-abi=soft' '-mfpu=vfp'

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../libexec/gcc/arm-linux-androideabi/4.6.3/collect2.exe --sysroot=/home/crystax/work/ndk/platform/ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/sysroot --eh-frame-hdr -shared -dynamic-linker /system/bin/linker -X -m armelf_linux_eabi -Bsymbolic -o libnw_libusb.so.1.0.0 crtbegin_so.o -LC:/NecessitasA41/android-ndk/platforms/android-5/arch-arm//usr/lib -LC:NecessitasA41AndroidQt482armeabilib -LC:/Projects/Android/libusb_android/libs/armeabi -LC:/NecessitasA41/android-ndk/../Android/Qt/482/armeabi/lib -LC:/NecessitasA41/android-ndk/sources/crystax/empty/arm -LC:/NecessitasA41/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/4.6.3 -LC:NecessitasA41AndroidQt482armeabi/lib -L/tmp/necessitas/android-ndk/platforms/android-5/arch-arm//usr/lib -Lc:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.3 -Lc:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../lib/gcc -Lc:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.3/../../../../arm-linux-androideabi/lib @C:\Users\HMuzina\AppData\Local\Temp\cc96u2vq -lgcc -lgcc_eh -lcrystax -Bdynamic -lstdc++ -llog -lc -ldl -lgcc -lgcc_eh crtend_so.o

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.3/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot open crtbegin_so.o: No such file or directory

ma-make: Leaving directory `C:/Projects/TomI/DurianQtAndroid-build-7e5262-Necessitas_Qt_4_8_2_for_Android_armv5_Debug/jni/nw_usb/libusb'

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.3/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot open crtend_so.o: No such file or directory

collect2: ld returned 1 exit status

ma-make: *** [libnw_libusb.so.1.0.0] Error 1

10:08:17: The process "C:\NecessitasA4\QtCreator\bin\ma-make.exe" exited with code 2.

Error while building/deploying project DurianQtAndroid (target: Necessitas Qt 4.8.2 for Android armv5)

When executing step 'Make'




Ray Donnelly

unread,
Aug 29, 2012, 6:32:52 PM8/29/12
to andro...@googlegroups.com
Ok, why are you using Crystax's NDK?

"home/crystax/work"

and why did you not think this information useful or revelant? ;-)

harvey

unread,
Aug 29, 2012, 7:58:24 PM8/29/12
to andro...@googlegroups.com
> Ok, why are you using Crystax's NDK?

Because I need support for wchar and exceptions (cross-platform app, started on Windows but now works on Mac and Linux as well).



> and why did you not think this information useful or revelant? ;-)

Oooops.  I guess I better ask Crystax about this issue then.

I did have this issue before switching to Crystax as well but that was before Alpha4.

Thanks,
Harvey

Ray Donnelly

unread,
Aug 29, 2012, 9:32:12 PM8/29/12
to andro...@googlegroups.com
Hi Harvey,

I'm going to dissect the first line of your reply bit by bit as
there's so much I need to reply to in that single line.

> Because I need support for wchar

Please see where I discuss wchar_t being 4 bytes big on android
platform > 8 on the Python issue tracker here:

http://bugs.python.org/issue3754

..but I accept that this may not be enough for your needs (which I
don't fully understand - I'm guessing your using some non-Qt C++
library that you compile with unicode support or something like that?)

There was some talk about 8 months ago of me and Dmitry possibly
merging our NDKs, but we never really got further than wondering if it
would be a good idea. I think now, for Android Qt it's too late to
consider such a big change. Also, I try to merge upstream anyway.

> and exceptions

Every NDK released by anyone since (AFAIR) r5 fully supports
exceptions (and RTTI).

> (cross-platform app

But you're using Qt, it's is a cross platform application framework
*by definition*. Can you not stay in Qt-land for all of your string
processing needs? Is utf8 on Qt not the obvious choice for
internationalisation of strings anyway? Personally I've always thought
using 32bits for each character is crazy. Besides, you then continue
with...

> , started on Windows but now works on Mac and Linux as well)

...and this part has totally thrown me, you say you started on
Windows? well, that uses its own 16 byte wide character format, so
obviously you're used to handling two different character encodings
already (Mac and Linux use UCS-32).

Anyway, if you still want to use Crystax's NDK you'd have to rebuild
all of Qt Android using it (and fix any bugs that doing this would
cause), which would mean you 'd:

1. Not be able to use Ministro.
2. Have to re-work things so that your new UCS-32 Qt .so files are
local to your apk (or investigate completely statically linking if GPL
is ok for your project)

I'm thinking that the Necessitas project needs to make it explicit
that Android Qt absolutely requires the Necessitas Special NDK as I'm
spending a lot of time explaining this to different folks!

Having said that, I'm also keen that Android Qt can be built with (and
Necessitas can be used with) the official Google NDK, but that
requires patches that Google will either accept or reject (so far some
of my changes have been accepted, but even the official r8b can't be
used to build the Android Qt libraries at present, nor will gdb
pretty-printing work in Qt Creator with it)... we don't provide our
own version of the NDK just for fun.

The thing I hope you take away from this slightly long and slightly
ranty email is that:

Libraries compiled with different toolchains/NDKs are generally
incompatible. A big part Android Qt is a set of pre-compiled
libraries.

Best regards,

Ray.

harvey

unread,
Aug 30, 2012, 7:56:55 PM8/30/12
to andro...@googlegroups.com
Hi Ray,


> ..but I accept that this may not be enough for your needs (which I
> don't fully understand - I'm guessing your using some non-Qt C++
> library that you compile with unicode support or something like that?)

I had to use a library developed by other team which was supposed to be cross-platform but it wasn't.  They just made everything Windows specific because cross-platform was too hard.  To make matters worse this library was still under active development, going through many changes, but it was already being used in mission critical software. The best I could do was branch it and keep my changes as minimal as possible to facilitate frequent large merges.  What I ended up with works, but it's ugly.


I switched back to Necessitas NDK and I still get the same link problem:

echo -Wl,-soname,libnw_usb.so.1 -v -Wl,--no-undefined -Wl,-z,noexecstack -shared -Wl,-rpath=C:/tmp/necessitas/unstable/Android/Qt/482/build-armeabi/install/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libnw_libusb.so.1.0.0 common.o hid_rdp.o nw_libusb.o -LC:/NecessitasA41/android-ndk/platforms/android-5/arch-arm//usr/lib -LC:\NecessitasA41\Android\Qt\482\armeabi\lib -LC:/Projects/Android/libusb_android/libs/armeabi -lusb -lgnustl_shared -LC:/NecessitasA41/android-ndk/../Android/Qt/482/armeabi/lib -LC:/NecessitasA41/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtbegin_so.o C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtend_so.o -lQtCore -LC:\NecessitasA41\Android\Qt\482\armeabi/lib -L/tmp/necessitas/android-ndk/platforms/android-5/arch-arm//usr/lib -llog -lz -lm -ldl -lc -lgcc > libnw_libusb.so.1.0.0.lnk.cmdline

C:/NecessitasA41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-g++ @libnw_libusb.so.1.0.0.lnk.cmdline

Using built-in specs.

COLLECT_GCC=C:/NecessitasA41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-g++

COLLECT_LTO_WRAPPER=c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../libexec/gcc/arm-linux-androideabi/4.6.x-google/lto-wrapper.exe

Target: arm-linux-androideabi

Configured with: /tmp/necessitas/android-qt-ndk/toolchain-source/gcc/gcc-4.6/configure --prefix=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-arm-linux-androideabi-4.6 --build=i686-linux-gnu --host=i686-w64-mingw32msvc --target=arm-linux-androideabi --with-sysroot=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-arm-linux-androideabi-4.6/sysroot --with-gmp=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-mpfr=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-mpc=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-gmp=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-mpfr=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-mpc=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-gnu-as --with-gnu-ld --enable-threads --disable-libssp --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-tls --disable-libquadmath --disable-plugin --disable-libitm --disable-bootstrap --enable-languages=c,c++ --disable-shared --disable-nls --disable-werror --enable-target-optspace --enable-initfini-array --with-arch=armv5te --with-float=soft --with-fpu=vfp

Thread model: posix

gcc version 4.6.x-google 20120106 (prerelease) (GCC)

COMPILER_PATH=c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../libexec/gcc/arm-linux-androideabi/4.6.x-google/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../libexec/gcc/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/

LIBRARY_PATH=c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/lib/

COLLECT_GCC_OPTIONS='-v' '-shared' '-o' 'libnw_libusb.so.1.0.0' '-LC:/NecessitasA41/android-ndk/platforms/android-5/arch-arm//usr/lib' '-LC:NecessitasA41AndroidQt482armeabilib' '-LC:/Projects/Android/libusb_android/libs/armeabi' '-LC:/NecessitasA41/android-ndk/../Android/Qt/482/armeabi/lib' '-LC:/NecessitasA41/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi' '-LC:NecessitasA41AndroidQt482armeabi/lib' '-L/tmp/necessitas/android-ndk/platforms/android-5/arch-arm//usr/lib' '-march=armv5te' '-mfloat-abi=soft' '-mfpu=vfp'

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../libexec/gcc/arm-linux-androideabi/4.6.x-google/collect2.exe --sysroot=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-arm-linux-androideabi-4.6/sysroot --eh-frame-hdr -shared -dynamic-linker /system/bin/linker -X -m armelf_linux_eabi -Bsymbolic -z noexecstack -z relro -z now -o libnw_libusb.so.1.0.0 crtbegin_so.o -LC:/NecessitasA41/android-ndk/platforms/android-5/arch-arm//usr/lib -LC:NecessitasA41AndroidQt482armeabilib -LC:/Projects/Android/libusb_android/libs/armeabi -LC:/NecessitasA41/android-ndk/../Android/Qt/482/armeabi/lib -LC:/NecessitasA41/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi -LC:NecessitasA41AndroidQt482armeabi/lib -L/tmp/necessitas/android-ndk/platforms/android-5/arch-arm//usr/lib -Lc:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google -Lc:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc -Lc:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/lib @C:\Users\HMuzina\AppData\Local\Temp\ccQruuKd -lgcc -lc -ldl -lgcc crtend_so.o

ma-make: Leaving directory `C:/Projects/TomI/DurianQtAndroid-build-7e5262-Necessitas_Qt_4_8_2_for_Android_armv5_Debug/jni/durian/nw_usb/libusb'

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot open crtbegin_so.o: No such file or directory

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot open crtend_so.o: No such file or directory

collect2: ld returned 1 exit status

ma-make: *** [libnw_libusb.so.1.0.0] Error 1

11:44:09: The process "C:\NecessitasA4\QtCreator\bin\ma-make.exe" exited with code 2.

Error while building/deploying project DurianQtAndroid (target: Necessitas Qt 4.8.2 for Android armv5)

When executing step 'Make'


Link command:

-Wl,-soname,libnw_usb.so.1 -v -Wl,--no-undefined -Wl,-z,noexecstack -shared -Wl,-rpath=C:/tmp/necessitas/unstable/Android/Qt/482/build-armeabi/install/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libnw_libusb.so.1.0.0 common.o hid_rdp.o nw_libusb.o   -LC:/NecessitasA41/android-ndk/platforms/android-5/arch-arm//usr/lib -LC:\NecessitasA41\Android\Qt\482\armeabi\lib  -LC:/Projects/Android/libusb_android/libs/armeabi -lusb -lgnustl_shared -LC:/NecessitasA41/android-ndk/../Android/Qt/482/armeabi/lib -LC:/NecessitasA41/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtbegin_so.o C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtend_so.o -lQtCore -LC:\NecessitasA41\Android\Qt\482\armeabi/lib -L/tmp/necessitas/android-ndk/platforms/android-5/arch-arm//usr/lib -llog -lz -lm -ldl -lc -lgcc 


However, this is actually worse than before -- now I can't just copy crtbegin_so.o and crtend_so.o into my obj dir, if I do that I get this:

echo -Wl,-soname,libnw_usb.so.1 -v -Wl,--no-undefined -Wl,-z,noexecstack -shared -Wl,-rpath=C:/tmp/necessitas/unstable/Android/Qt/482/build-armeabi/install/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libnw_libusb.so.1.0.0 common.o hid_rdp.o nw_libusb.o -LC:/NecessitasA41/android-ndk/platforms/android-5/arch-arm//usr/lib -LC:\NecessitasA41\Android\Qt\482\armeabi\lib -LC:/Projects/Android/libusb_android/libs/armeabi -lusb -lgnustl_shared -LC:/NecessitasA41/android-ndk/../Android/Qt/482/armeabi/lib -LC:/NecessitasA41/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtbegin_so.o C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtend_so.o -lQtCore -LC:\NecessitasA41\Android\Qt\482\armeabi/lib -L/tmp/necessitas/android-ndk/platforms/android-5/arch-arm//usr/lib -llog -lz -lm -ldl -lc -lgcc > libnw_libusb.so.1.0.0.lnk.cmdline

C:/NecessitasA41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-g++ @libnw_libusb.so.1.0.0.lnk.cmdline

Using built-in specs.

COLLECT_GCC=C:/NecessitasA41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-g++

COLLECT_LTO_WRAPPER=c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../libexec/gcc/arm-linux-androideabi/4.6.x-google/lto-wrapper.exe

Target: arm-linux-androideabi

Configured with: /tmp/necessitas/android-qt-ndk/toolchain-source/gcc/gcc-4.6/configure --prefix=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-arm-linux-androideabi-4.6 --build=i686-linux-gnu --host=i686-w64-mingw32msvc --target=arm-linux-androideabi --with-sysroot=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-arm-linux-androideabi-4.6/sysroot --with-gmp=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-mpfr=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-mpc=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-gmp=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-mpfr=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-mpc=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-prereqs --with-gnu-as --with-gnu-ld --enable-threads --disable-libssp --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-tls --disable-libquadmath --disable-plugin --disable-libitm --disable-bootstrap --enable-languages=c,c++ --disable-shared --disable-nls --disable-werror --enable-target-optspace --enable-initfini-array --with-arch=armv5te --with-float=soft --with-fpu=vfp

Thread model: posix

gcc version 4.6.x-google 20120106 (prerelease) (GCC)

COMPILER_PATH=c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../libexec/gcc/arm-linux-androideabi/4.6.x-google/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../libexec/gcc/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/

LIBRARY_PATH=c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/;c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/lib/

COLLECT_GCC_OPTIONS='-v' '-shared' '-o' 'libnw_libusb.so.1.0.0' '-LC:/NecessitasA41/android-ndk/platforms/android-5/arch-arm//usr/lib' '-LC:NecessitasA41AndroidQt482armeabilib' '-LC:/Projects/Android/libusb_android/libs/armeabi' '-LC:/NecessitasA41/android-ndk/../Android/Qt/482/armeabi/lib' '-LC:/NecessitasA41/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi' '-LC:NecessitasA41AndroidQt482armeabi/lib' '-L/tmp/necessitas/android-ndk/platforms/android-5/arch-arm//usr/lib' '-march=armv5te' '-mfloat-abi=soft' '-mfpu=vfp'

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../libexec/gcc/arm-linux-androideabi/4.6.x-google/collect2.exe --sysroot=/tmp/necessitas/ndk-build/build/host-gcc/i686-w64-mingw32msvc/temp-arm-linux-androideabi-4.6/sysroot --eh-frame-hdr -shared -dynamic-linker /system/bin/linker -X -m armelf_linux_eabi -Bsymbolic -z noexecstack -z relro -z now -o libnw_libusb.so.1.0.0 crtbegin_so.o -LC:/NecessitasA41/android-ndk/platforms/android-5/arch-arm//usr/lib -LC:NecessitasA41AndroidQt482armeabilib -LC:/Projects/Android/libusb_android/libs/armeabi -LC:/NecessitasA41/android-ndk/../Android/Qt/482/armeabi/lib -LC:/NecessitasA41/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi -LC:NecessitasA41AndroidQt482armeabi/lib -L/tmp/necessitas/android-ndk/platforms/android-5/arch-arm//usr/lib -Lc:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google -Lc:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc -Lc:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/lib @C:\Users\HMuzina\AppData\Local\Temp\cc4wZgfx -lgcc -lc -ldl -lgcc crtend_so.o

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: error: C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtbegin_so.o: multiple definition of '__FINI_ARRAY__'

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: crtbegin_so.o: previous definition here

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: error: C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtbegin_so.o: multiple definition of '__dso_handle'

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: crtbegin_so.o: previous definition here

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: error: C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtbegin_so.o: multiple definition of '__INIT_ARRAY__'

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: crtbegin_so.o: previous definition here

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: error: C:/NecessitasA41/android-ndk/platforms/android-5/arch-arm/usr/lib/crtbegin_so.o: multiple definition of 'atexit'

c:/necessitasa41/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: crtbegin_so.o: previous definition here

collect2: ld returned 1 exit status

ma-make: Leaving directory `C:/Projects/TomI/DurianQtAndroid-build-7e5262-Necessitas_Qt_4_8_2_for_Android_armv5_Debug/jni/durian/nw_usb/libusb'

ma-make: *** [libnw_libusb.so.1.0.0] Error 1

11:47:16: The process "C:\NecessitasA4\QtCreator\bin\ma-make.exe" exited with code 2.

Error while building/deploying project DurianQtAndroid (target: Necessitas Qt 4.8.2 for Android armv5)

When executing step 'Make'



Cheers,
Harvey

harvey

unread,
Aug 31, 2012, 1:13:34 AM8/31/12
to andro...@googlegroups.com
I figured out how to work around "multiple definition".

Test cases:
1. Do NOT have crtbegin_so.o and crtend_so.o added to LIBS + do NOT copy crtbegin_so.o and crtend_so.o into obj directory -> cannot open crtbegin_so.o/crtend_so.o: No such file or directory
2. DO add crtbegin_so.o and crtend_so.o to LIBS + do NOT copy crtbegin_so.o and crtend_so.o into obj directory -> cannot open crtbegin_so.o/crtend_so.o: No such file or directory
3. DO add crtbegin_so.o and crtend_so.o to LIBS + DO copy crtbegin_so.o and crtend_so.o into obj directory -> multiple definition
4. Do NOT have crtbegin_so.o and crtend_so.o added to LIBS + DO copy crtbegin_so.o and crtend_so.o into obj directory -> all good.

Question: how come linker cannot find crtbegin_so.o and crtend_so.o when paths just added to LIBS but as soon as crtbegin_so.o and crtend_so.o are also copied to obj dir (in addition to their paths being added to LIBS) it CAN suddenly find them in both places and start complaining about multiple definitions?

Ray Donnelly

unread,
Aug 31, 2012, 7:32:16 AM8/31/12
to andro...@googlegroups.com
Hi Harvey.

We should probably take this off list and then just report back the
(eventual!) solution...

I think using Process Monitor [1] at this point would be a good idea.
I suspect you've got some old env vars hanging around causing issues
somehow or else some weird permissions thing going on. If you can
filter so that only file IO by *ld.exe collect2.exe and *g++.exe are
reported, and send me the log, that'd be great.

[1] http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

Cheers,

Ray.
Reply all
Reply to author
Forward
0 new messages