PDA

View Full Version : RTPack Linux compilation



Dima Litvinov
05-02-2013, 11:13 PM
Hi!

I'm trying to build android project under Linux and stuck at compiling RTPack.
I installed clanlib-dev, then got PVERTexLib from here https://github.com/TermiT/mkpack/tree/master/PVRTexLib
(and renamed Linux to Linux_x86_32).
Then I cd'ed to tools/RTPack, ran build.sh - COMPILATION was OK!
But then I got LINK errors:



Linking CXX executable RTPack
CMakeFiles/RTPack.dir/home/dimalit/Desktop/voip/proton/shared/util/MiscUtils.cpp.o: In function `GetHashOfFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool)':
MiscUtils.cpp:(.text+0xd2): undefined reference to `FileManager::Get(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int*, bool, bool)'
CMakeFiles/RTPack.dir/home/dimalit/Desktop/voip/proton/shared/linux/LinuxUtils.cpp.o: In function `LogMsg(char const*, ...)':
LinuxUtils.cpp:(.text+0x20b): undefined reference to `IsBaseAppInitted()'
LinuxUtils.cpp:(.text+0x248): undefined reference to `GetBaseApp()'
LinuxUtils.cpp:(.text+0x262): undefined reference to `Console::AddLine(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
collect2: ld returned 1 exit status
make[2]: *** [RTPack] Error 1


I suppose these errors are not because of PVERTexLib (there are no such functions)
May be some latest changes in Proton sources have broken this build?
Or am I missing something?
Please help.

Dima Litvinov
05-03-2013, 02:35 PM
I got it!

So, here are the steps how to build RTSimpleApp under Android SDK Tools rev 21.1, NDK r8e:
(in addition to official manual http://www.rtsoft.com/wiki/doku.php?id=proton:android_setup_linux)

1) Install android-17 (or any other version) API in Android SDK Manager.
2) Skip the step with "android update project -p ." for now.
3) Make changes to build.xml as described in this thread: http://www.rtsoft.com/forums/showthread.php?5604-build-bat-failed-on-Windows-using-ndk-r8b-sdk-20-0-1 (see posts #7 and #17 too!)

Now need to compile RTPack.

4) Get clanlib-dev and also download PVRTexLib from here:
https://github.com/TermiT/mkpack/tree/master/PVRTexLib

5) Copy PVERTexLib from .zip to <PROTON>/tools/RTPack
6) In file <PROTON>/tools/RTPack/CMakeLists.txt add -D_CONSOLE to "add_definitions" command. Compile it with build.sh. Check if executable was generated.

Now back to RTSimpleApp.

7) Go back to RTSimpleApp/android and run <PROTON>/tools/linux/prepareAndroid.sh. Don't run ndk-build.
8) Unpack app_info_setup.sh and build_prepare.sh from current dir from the attached file. Make changes to app_info_setup.sh if you have other version than anroid-17.
9) Run build_prepare.sh. It should automatically do ndk-build (so, it compiles all .cpp files into libs/armeabi/librtsimpleapp.so).

Next, to run update_media.sh we need some tricks.

10) open <PROTON>/tools/linux/update_media.sh and find line containing text "Texture conversion flags are empty". Remove "exit 1" line from there (so, it wouldn't break when it finds empty "games" dir in the project's media dir)
11) cd to RTSimpleApp/media and run <PROTON>/tools/linux/update_media.sh. It should create "audio", "game", and "interface" dirs in RTSimpleApp/bin (with a lot of files there!)
12) run <PROTON>/tools/linux/androidSyncAssets.sh from RTSimpleApp/android directory

13) Finally, do "ant debug" and install bin/RTSimpleApp-debug.apk to your device!

(get sh-scripts from the attached files.zip; use other files from this zip only for your reference - i.e. don't simply copy them to your computer!)

Seth
05-05-2013, 07:42 AM
Thanks for the info, I'm sure this will help other linux users.

Dima Litvinov
05-05-2013, 01:15 PM
hmmm, actually I posted a little "how-to" about my solution of this problem...
System told me that my post was waiting for moderation and would appear after it. But it is still not there.
So, Seth, could you please look at the forum's moderator's interface for my post waiting for moderation?
(If there is some problem, I can send it again - I made a copy for myself).

Seth
05-05-2013, 03:23 PM
Oops, sorry, didn't notice it was moderated. It's now approved. :sweatdrop: