Archive 17/01/2023.

NDK verison problem?

k7x

Hello !
Please help sort it out.
I downloaded the latest version of NDK, Urho3d-1.7.1 and CMake.
But when I tried to generate the project, CMake said that the compiler is not able to generate a simple test program.
Compiler paths do not contain special characters. Also, the paths are written in English without spaces.

Advise the version of CMake and NDK which can work with Urho3d.

Thank !

Pencheff

I also had a problem with latest ndk 20 on Linux. I downgraded to 17c

Modanung

@k7x Is it a conscious choice to not use the master head?
@Pencheff What version of Urho are you using?

Are there any errors that may contain useful information as to why this happens?

Pencheff

I was building from my fork which is from 1569ef3247999ba4304e991a1f510826a73268b7 .
My error was:

requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC

It happened during linking of Urho3DPlayer.so, everything else seemed to compile fine with a bunch of clang warnings about comparing char type to a 500 constant in SLikeNet related code. I can try to switch back to ndk 20 and dig deeper

Modanung

Did you try compiling with the -fPIC flags mentioned in the error?
@k7x Is that the same error you got?

Pencheff

I actually did build with -fPIC, I have a custom AndroidToolchain.cmake thats used for my dependency project, which consists of 10 other libraries.

From AndroidToolchain.cmake:

set(CMAKE_CXX_FLAGS "--sysroot=${CMAKE_FIND_ROOT_PATH} -std=c++11 -fPIC -frtti" CACHE STRING "" FORCE)

These are my CMake flags:

  set(ANDROID_CMAKE_FLAGS
    -DANDROID_PLATFORM=android-${ANDROID_API_LEVEL}
    -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
    -DANDROID=${ANDROID}
    -DANDROID_NDK=$ENV{ANDROID_NDK}
    -DTOOLCHAIN_ROOT=${TOOLCHAIN_ROOT}
    -DANDROID_STL=${ANDROID_STL}
    -DCMAKE_AR=${CMAKE_AR}
    -DURHO3D_WEBP=OFF # TODO: needs cpu-features.h
  )
Modanung

And these are you defaults, so that doesn’t change anything?

Might be worth opening an issue on GitHub, if one doesn’t exist already.

Pencheff

I will when I’m 100% sure it is not my own setup that causes those errors, which is possible.

k7x

@Modanung,I do not really understand what you mean

Modanung

You mentioned you are using Urho3d-1.7.1, common practice is to use the very latest.

k7x

@Modanung, The software I’m working on requires stability. Moreover, it is possible because I am not an expert on the git repository. It seemed to me that this is still the same 1.7.1.
Do you mean that compiling a version from git will help fix the problem?
And taking this opportunity, I want to ask about the compilation on windows and mingw. I downloaded the compiler installer and basic packages. A project for a simake is still being created somehow, but when compiling it when it comes to sdl audio, it produces an error in the code itself. If you disable sdl then the error will already be in urho.

Modanung

It might be a solved issue; I do not know if it is.

The latest version of Urho3D - the HEAD of the master branch - can be downloaded as a ZIP through the Clone or download button on GitHub, but it’s better to use git. That way you can update your local Urho3D with a simple git pull command after running git clone https://repo/URL once inside the folder you keep you clones. As you are using Windows you may want to look at Git for Windows.
If at any time you’d wish to become a git expert, read the Git Book.

The documentation contains information for building Urho3D:

I’m sure the community will be happy to help you pass any hurdles you may encounter. I have no experience building on Windows.

k7x

@Modanung, I managed to build an android project urho under ndk p17. I had to disable PCH and LUA. Next, I cd C: / AndroidBin on the command line and then launched E: /ndk/ndk-build.cmd but in response to the FreeType compilation I got the answer that the include string.h was not found. I also use APP_BUILD=SCRIPT=makefile in ndk-build.cmd. If not - they say /jni/Android.mk not found.
What the problem might be ?
Thank!

Modanung

I’m afraid I do not know, hopefully someone else does.

k7x

Yeah. It used to be like collecting urho. But it was like NDK from the Nvidia website.
In general, this is all strange. Of course, maybe my hands are not growing from that place, but this is all unjustifiably complicated. Compilation may not be the easiest process, but certainly it does not require + 10 GB of any different tool. In the same lunix, this process seems a lot easier. I think this is partly to blame for the micro-soft with its mpecific culture of long-term installations by standard installers. I’m already silent about the visual studio.

Modanung

Did you try or consider compiling with Linux? It’s free. :slightly_smiling_face:

:penguin:

Also Android is technically a Linux distribution.

EDIT: Ah, that’s what you meant by lunix. I thought you meant Lumix maybe.

k7x

@Modanung, I’m happy, but when installing, I’m afraid to affect the main system. I am not the only user.

I was eating build on android. And that would be very cool. But when creating a project with cmake he does not find GLES.h

is there any way to build urho without cmake ?

I accidentally made a typo

Modanung

I don’t think so.
Maybe ming32-make could also work, but I don’t know how different it may be from cmake.

k7x

I do not want other engines! :slight_smile:
I have enough urho. Generally very cool that you can write on the tablet, even where theft and to run a program or a game without compilation. Almost a low-level (I mean that opportunities are not as unlimited as that of the same C ++), but it is a complete development environment

Its about Lumix)

k7x

@Modanung, I think ming32-make its like build-essential and make in linux. But on my machine its dont compile SDK_Audio and some urho staff

k7x

console

Pencheff

About the errors I get when building with NDK18 on Linux:
requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC

I was able to fix the issue by adding to my CMAKE_CXX_FLAGS -Wl,-Bsymbolic in my toolchain file.

set(CMAKE_CXX_FLAGS "--sysroot=${CMAKE_SYSROOT} -std=c++11 -fPIC -frtti -Wl,-Bsymbolic" CACHE STRING "" FORCE)