Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Setup - error: undefined reference to '__page_size' #46

Closed
5k3105 opened this issue Aug 1, 2016 · 8 comments
Closed

Android Setup - error: undefined reference to '__page_size' #46

5k3105 opened this issue Aug 1, 2016 · 8 comments

Comments

@5k3105
Copy link
Contributor

5k3105 commented Aug 1, 2016

Hi tr - this is just something I was testing out.

C:\goworksp\src\github.com\therecipe\qt (master)
λ setup.bat android

go get golang.org/x/crypto/ssh

if 0 NEQ 0 exit /b 0

go run ./internal/setup/check.go android

if 0 NEQ 0 exit /b 0

go run C:\goworksp/src/github.com/therecipe/qt/internal/setup/generate.go android

if 0 NEQ 0 exit /b 0

go run C:\goworksp/src/github.com/therecipe/qt/internal/setup/install.go android
------------------------install-------------------------
core

install.Core_1
output:# github.com/therecipe/qt/core
C:\windows\go-build785918078\github.com\therecipe\qt\core\_obj\_cgo_main.c: In function 'crosscall2':
C:\windows\go-build785918078\github.com\therecipe\qt\core\_obj\_cgo_main.c:2:23: warning: unused parameter 'fn' [-Wunused-parameter]
 void crosscall2(void(*fn)(void*, int), void *a, int c) { }
                       ^
C:\windows\go-build785918078\github.com\therecipe\qt\core\_obj\_cgo_main.c:2:46: warning: unused parameter 'a' [-Wunused-parameter]
 void crosscall2(void(*fn)(void*, int), void *a, int c) { }
                                              ^
C:\windows\go-build785918078\github.com\therecipe\qt\core\_obj\_cgo_main.c:2:53: warning: unused parameter 'c' [-Wunused-parameter]
 void crosscall2(void(*fn)(void*, int), void *a, int c) { }
                                                     ^
C:\windows\go-build785918078\github.com\therecipe\qt\core\_obj\_cgo_main.c: In function '_cgo_allocate':
C:\windows\go-build785918078\github.com\therecipe\qt\core\_obj\_cgo_main.c:5:26: warning: unused parameter 'a' [-Wunused-parameter]
 void _cgo_allocate(void *a, int c) { }
                          ^
C:\windows\go-build785918078\github.com\therecipe\qt\core\_obj\_cgo_main.c:5:33: warning: unused parameter 'c' [-Wunused-parameter]
 void _cgo_allocate(void *a, int c) { }
                                 ^
C:\windows\go-build785918078\github.com\therecipe\qt\core\_obj\_cgo_main.c: In function '_cgo_panic':
C:\windows\go-build785918078\github.com\therecipe\qt\core\_obj\_cgo_main.c:6:23: warning: unused parameter 'a' [-Wunused-parameter]
 void _cgo_panic(void *a, int c) { }
                       ^
C:\windows\go-build785918078\github.com\therecipe\qt\core\_obj\_cgo_main.c:6:30: warning: unused parameter 'c' [-Wunused-parameter]
 void _cgo_panic(void *a, int c) { }
                              ^
# github.com/therecipe/qt/core
core\core.go: In function '_cgo_f981539ad049_Cfunc_QCoreApplication_QCoreApplication_Flush':
core\core.go:10154:33: warning: unused variable 'a' [-Wunused-variable]

                                 ^
core\core.go: In function '_cgo_f981539ad049_Cfunc_QThread_QThread_YieldCurrentThread':
core\core.go:46726:33: warning: unused variable 'a' [-Wunused-variable]
 func (ptr *QPropertyAnimation) UpdateDirectionDefault(direction QAbstractAnimation__Direction) {
                                 ^
# github.com/therecipe/qt/core
core\core.cpp:566:58: warning: unused parameter 'ptr' [-Wunused-parameter]
 int QAbstractEventDispatcher_RegisterEventNotifier(void* ptr, void* notifier)
                                                          ^
core\core.cpp:566:69: warning: unused parameter 'notifier' [-Wunused-parameter]
 int QAbstractEventDispatcher_RegisterEventNotifier(void* ptr, void* notifier)
                                                                     ^
core\core.cpp:600:61: warning: unused parameter 'ptr' [-Wunused-parameter]
 void QAbstractEventDispatcher_UnregisterEventNotifier(void* ptr, void* notifier)
                                                             ^
core\core.cpp:600:72: warning: unused parameter 'notifier' [-Wunused-parameter]
 void QAbstractEventDispatcher_UnregisterEventNotifier(void* ptr, void* notifier)
                                                                        ^
core\core.cpp:10662:43: warning: unused parameter 'ok' [-Wunused-parameter]
 int QLocale_ToInt(void* ptr, char* s, int ok)
                                           ^
core\core.cpp:10667:44: warning: unused parameter 'ok' [-Wunused-parameter]
 int QLocale_ToInt2(void* ptr, void* s, int ok)
                                            ^
core\core.cpp:11107:52: warning: unused parameter 'ok' [-Wunused-parameter]
 int QMetaEnum_KeyToValue(void* ptr, char* key, int ok)
                                                    ^
core\core.cpp:11112:54: warning: unused parameter 'ok' [-Wunused-parameter]
 int QMetaEnum_KeysToValue(void* ptr, char* keys, int ok)
                                                      ^
core\core.cpp:18600:39: warning: unused parameter 'ok' [-Wunused-parameter]
 long QStringRef_ToLong(void* ptr, int ok, int base)
                                       ^
core\core.cpp:18850:37: warning: unused parameter 'ok' [-Wunused-parameter]
 int QStringRef_ToInt(void* ptr, int ok, int base)
                                     ^
core\core.cpp:22211:35: warning: unused parameter 'ok' [-Wunused-parameter]
 int QVariant_ToInt(void* ptr, int ok)
                                   ^
core\core.cpp:22246:39: warning: unused parameter 'ok' [-Wunused-parameter]
 double QVariant_ToReal(void* ptr, int ok)
                                       ^
# github.com/therecipe/qt/core
C:/Qt/Qt5.7.0/5.7/android_armv7/lib/libQt5Core.so: error: undefined reference to '__page_size'
collect2.exe: error: ld returned 1 exit status

error:exit status 2

exit status 1

if 1 NEQ 0 exit /b 1

C:\goworksp\src\github.com\therecipe\qt (master)
@therecipe
Copy link
Owner

Hey

I will look into this.

@therecipe
Copy link
Owner

It should work now 038c906

You need to download the latest android-ndk: r12b

And also use the android-sdk tool (C:\android\android-sdk\tools\android.bat) to update/install the dependencies.

  • Tools
    • Android SDK Build-tools (24.0.1)
  • Android 7.0 (API 24)
    • SDK Platform

Then just run the setup.bat android as usual.

@5k3105
Copy link
Contributor Author

5k3105 commented Aug 14, 2016

Cool. Thanks. I'll give it a try!

@5k3105
Copy link
Contributor Author

5k3105 commented Aug 15, 2016

Hi tr!

λ setup.bat android

go get golang.org/x/crypto/ssh

if 0 NEQ 0 exit /b 0

go run ./internal/setup/check.go android

if 0 NEQ 0 exit /b 0

go run C:\goworksp/src/github.com/therecipe/qt/internal/setup/generate.go android

if 0 NEQ 0 exit /b 0

go run C:\goworksp/src/github.com/therecipe/qt/internal/setup/install.go android
------------------------install-------------------------
core

install.Core_1
output:# github.com/therecipe/qt/core
C:\windows\go-build891076022\github.com\therecipe\qt\core\_obj\_cgo_main.c: In function 'crosscall2':
C:\windows\go-build891076022\github.com\therecipe\qt\core\_obj\_cgo_main.c:2:23: warning: unused parameter 'fn'
 [-Wunused-parameter]
 void crosscall2(void(*fn)(void*, int), void *a, int c) { }
                       ^
C:\windows\go-build891076022\github.com\therecipe\qt\core\_obj\_cgo_main.c:2:46: warning: unused parameter 'a'
[-Wunused-parameter]
 void crosscall2(void(*fn)(void*, int), void *a, int c) { }
                                              ^
C:\windows\go-build891076022\github.com\therecipe\qt\core\_obj\_cgo_main.c:2:53: warning: unused parameter 'c'
[-Wunused-parameter]
 void crosscall2(void(*fn)(void*, int), void *a, int c) { }
                                                     ^
C:\windows\go-build891076022\github.com\therecipe\qt\core\_obj\_cgo_main.c: In function '_cgo_allocate':
C:\windows\go-build891076022\github.com\therecipe\qt\core\_obj\_cgo_main.c:5:26: warning: unused parameter 'a'
[-Wunused-parameter]
 void _cgo_allocate(void *a, int c) { }
                          ^
C:\windows\go-build891076022\github.com\therecipe\qt\core\_obj\_cgo_main.c:5:33: warning: unused parameter 'c'
[-Wunused-parameter]
 void _cgo_allocate(void *a, int c) { }
                                 ^
C:\windows\go-build891076022\github.com\therecipe\qt\core\_obj\_cgo_main.c: In function '_cgo_panic':
C:\windows\go-build891076022\github.com\therecipe\qt\core\_obj\_cgo_main.c:6:23: warning: unused parameter 'a'
[-Wunused-parameter]
 void _cgo_panic(void *a, int c) { }
                       ^
C:\windows\go-build891076022\github.com\therecipe\qt\core\_obj\_cgo_main.c:6:30: warning: unused parameter 'c'
[-Wunused-parameter]
 void _cgo_panic(void *a, int c) { }
                              ^
# github.com/therecipe/qt/core
core\core.go: In function '_cgo_371cc2c91f15_Cfunc_QCoreApplication_QCoreApplication_Flush':
core\core.go:10154:33: warning: unused variable 'a' [-Wunused-variable]

                                 ^
core\core.go: In function '_cgo_371cc2c91f15_Cfunc_QThread_QThread_YieldCurrentThread':
core\core.go:46726:33: warning: unused variable 'a' [-Wunused-variable]
 func (ptr *QPropertyAnimation) UpdateDirectionDefault(direction QAbstractAnimation__Direction) {
                                 ^
# github.com/therecipe/qt/core
core\core.cpp:9:30: fatal error: QAbstractAnimation: No such file or directory
 #include <QAbstractAnimation>
                              ^
compilation terminated.

error:exit status 2

exit status 1

if 1 NEQ 0 exit /b 1

Btw - I was wondering if there will be a release that will fix memory leak issues. On windows, even on a minimal program with parents set correctly there is steady memory leak.

@therecipe
Copy link
Owner

Did you run the desktop setup first?

You can check the qt/core/cgo_android_arm.go file for one of those lines /usr/local/Qt5.7.0/5.7/android_armv7.
If it does contain one of those, you need to run the desktop setup first and then run the android setup afterwards.

If this doesn't work, could you please verify that the QAbstractAnimation file exists in C:/Qt/Qt5.7.0/5.7/android_armv7/include/QtCore/?

And yes, I will release a fix for the memory leak issue as well as for the generic lists.
Maybe there is a simple way to fix most of the leaks, but I will have to look into this in detail.
I will keep you updated, if I find something.

@5k3105
Copy link
Contributor Author

5k3105 commented Aug 15, 2016

C:\goworksp\src\github.com\therecipe\qt (master)
λ setup.bat

go get golang.org/x/crypto/ssh

if 0 NEQ 0 exit /b 0

go run ./internal/setup/check.go

if 0 NEQ 0 exit /b 0

go run C:\goworksp/src/github.com/therecipe/qt/internal/setup/generate.go
------------------------generate------------------------
core                           14s
androidextras                  0
gui                            11s
network                        2s
sql                            1s
xml                            1s
dbus                           0
nfc                            0
script                         0
sensors                        2s
positioning                    0
widgets                        37s
qml                            1s
websockets                     0
xmlpatterns                    0
bluetooth                      1s
webchannel                     0
svg                            0
multimedia                     7s
quick                          2s
help                           2s
location                       0
scripttools                    0
uitools                        0
testlib                        0
serialport                     0
serialbus                      0
printsupport                   1s
designer                       2s
scxml                          0
gamepad                        0
purchasing                     0
sailfish                       0

if 0 NEQ 0 exit /b 0

go run C:\goworksp/src/github.com/therecipe/qt/internal/setup/install.go
------------------------install-------------------------
core                           1m12s
androidextras                  1s
gui                            1m7s
network                        20s
sql                            15m47s
xml                            9s
dbus                           7s
nfc                            6s
script                         6s
sensors                        17s
positioning                    6s
widgets                        0
qml                            8s
websockets                     5s
xmlpatterns                    6s
bluetooth                      10s
webchannel                     4s
svg                            9s
multimedia                     1m2s
quick                          23s
help                           18s
location                       5s
scripttools                    4s
uitools                        5s
testlib                        5s
serialport                     4s
serialbus                      8s
printsupport                   15s
designer                       19s
scxml                          6s
gamepad                        4s
purchasing                     4s
sailfish                       1s

if 0 NEQ 0 exit /b 0

go run C:\goworksp/src/github.com/therecipe/qt/internal/setup/test.go
------------------------test----------------------------
widgets\line_edits             1m7s
widgets\video_player           1m25s
widgets\graphicsscene          56s
widgets\dropsite               1m58s
quick\bridge                   1m39s
quick\bridge2                  1m32s
quick\calc                     1m7s
quick\dialog                   1m10s
quick\translate                1m16s
quick\view                     1m14s
qml\application                37s
qml\prop                       30s
uitools\calculator             1m13s

C:\goworksp\src\github.com\therecipe\qt (master)
λ setup.bat android

go get golang.org/x/crypto/ssh

if 0 NEQ 0 exit /b 0

go run ./internal/setup/check.go android

if 0 NEQ 0 exit /b 0

go run C:\goworksp/src/github.com/therecipe/qt/internal/setup/generate.go android

if 0 NEQ 0 exit /b 0

go run C:\goworksp/src/github.com/therecipe/qt/internal/setup/install.go android
------------------------install-------------------------
core                           1m6s
androidextras                  3s
gui                            54s
network                        17s
sql                            12m18s
xml                            8s
nfc                            5s
script                         4s
sensors                        17s
positioning                    5s
widgets                        0
qml                            7s
websockets                     4s
xmlpatterns                    5s
bluetooth                      9s
webchannel                     3s
svg                            8s
multimedia                     55s
quick                          20s
help                           17s
location                       5s
scripttools                    4s
uitools                        4s
testlib                        5s
serialport                     3s
serialbus                      7s
printsupport                   15s
scxml                          5s
gamepad                        3s
purchasing                     3s
sailfish                       1s

if 0 NEQ 0 exit /b 0

go run C:\goworksp/src/github.com/therecipe/qt/internal/setup/test.go android
------------------------test----------------------------
widgets\line_edits

test.widgets\line_edits
output:file.Load open C:\goworksp\src\github.com\therecipe\qt\internal\examples\widgets\line_edits\android\line_edits.keystore: The system cannot find the file specified.


deploy
output:
C:\goworksp\src\github.com\therecipe\qt {git}{hg}
{lamb} set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_101

C:\goworksp\src\github.com\therecipe\qt {git}{hg}
{lamb} C:\Qt\Qt5.7.0\5.7\android_armv7\bin\androiddeployqt.exe --input C:\goworksp\src\github.com\therecipe\qt\internal\examples\widgets\line_edits\deploy\android\android-libgo.so-deployment-settings.json --output C:\goworksp\src\github.com\therecipe\qt\internal\examples\widgets\line_edits\deploy\android\build --deployment bundled --android-platform android-24 --jdk C:\Program Files\Java\jdk1.8.0_101 --gradle
Generating Android Package
  Input file: C:\goworksp\src\github.com\therecipe\qt\internal\examples\widgets\line_edits\deploy\android\android-libgo.so-deployment-settings.json
  Output directory: C:/goworksp/src/github.com/therecipe/qt/internal/examples/widgets/line_edits/deploy/android/build/
  Application binary: C:/goworksp/src/github.com/therecipe/qt/internal/examples/widgets/line_edits/deploy/android/libgo.so
  Android build platform: android-24
  Install to device: No
Cannot find template directory C:/android/android-sdk/tools/templates/gradle/wrapper

error:exit status 3


error:exit status 1

exit status 1

C:\goworksp\src\github.com\therecipe\qt (master)
λ

@therecipe
Copy link
Owner

Did you rename the android-sdk-windows folder to android-sdk?
You need to get this path C:/android/android-sdk/tools/templates/gradle/wrapper valid.

Also, you can now just run the android setup again and it should skip the installation and only test the examples.

@5k3105
Copy link
Contributor Author

5k3105 commented Aug 16, 2016

For some reason the tools folder got deleted. I had to open up the sdk zip and copy that over again.

Everything compiled and a few of them ran on the phone (calculator, graphics, and line edit)! Looking forward to testing new code! Thanks tr!

Yes, please keep me updated of the memory issue. Thanks!

@5k3105 5k3105 closed this as completed Aug 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants