The linux static library format .a is basically only an archive of compiled object files. If you are developing a linux static library that use external functions coming from another static library you need to release both libraries (your library just developed and the second library you get functions from) for allow the final executable to compile correctly. However a more "elegant" and easy solution would be to "incorporate" the secondary library inside your library as result to distribute one single library containing all required object files for compile. This can be done by extracting all the object files from the secondary library and include inside your library. In our example we'll call MyLibrary.a the library we just developed and SecondaryLibrary.a the library we require function from. All the required command will be included inside a shell script we can call addlib.sh as follow:

#!/bin/sh

mkdir tmp
cd tmp

ar x ../SecondaryLibrary.a
ar r ../MyLibrary.a *

rm *
cd ..
rm -r tmp

As you can see the script create a temporary folder called tmp where extract all the object files from inside SecondaryLibrary.a and include all into the MyLibrary.a just compiled. At the end remove all object files and remove the temporary folder. This will allow MyLibrary.a to incorporate all the required objects for allow compilation distributing it standalone. Both SecondaryLibrary.a and MyLibrary.a need to be placed in the same position where the script file is executed. In case you use some IDE like, for example, Code::block you need to set the automatically execution of this script at the end of each compilation.
The latest revisions Qt framework allow to port application developed in C++ code to run in Android OS also. For standard app the Qt framework provide all the required features but in some case is necessary to interact with the system using native java code. For make such task Qt provide some specific objects able to allow a more easy work.

In case you are programming under Linux and have a binary file that want "import" inside your C/C++ code is there an useful linux utility tool called xxd able to make such conversion in a very easy way. This tool is usually installed by default in all major linux distributions. The use is very simple, if you have a binary file called, for example, MyFile.bin with length of 100 bytes and wan to convert in a C/C++ source code array you can simply type:

xxd -i MyFile.bin > MyFile.h

The source code array generated inside the header file will have a format like the following:

unsigned char MyFile[] = {
  0xXX, 0xXX, ....., 0xXX
};
unsigned int MyFile_len = 100;

Obviously 0xXX is the hexadecimal content of the binary file. Now you can import the header file just generated and use in your project.
In case you need to get a random number Qt provide the "classic" pseudo random generator based to an initial seed number. A pseudo random number is a simply algorithm able to generate a list of different numbers based to an initial number value called "seed". Please note that in this case using the same seed number multiple times will have the consequence that the sequence of numbers generated will be always the same every time. For this reasons is very important to set a "casual" seed number at each new call. The common practice is to use the current millisecond time at the moment of initialization call as follow:

qsrand(static_cast<uint>(QTime::currentTime().msec()));

The srand() function must to be call only once usually at program startup. Another important note is this function is thread dependent. This mean you have to call this function for set the seed number from inside the thread where you'll need to get the random numbers. For example in case you need to get a random number in the main thread and in a secondary thread you'll have to call srand() two times at beginning of both threads. Once clarified this point the function for get a random number included between a min and max value is the following:

int GetRandomNumber(const int Min, const int Max)
{
    return ((qrand() % ((Max + 1) - Min)) + Min);
}

Each time you'll call this function you'll get a different number in the requested range.

There are some different ways to take a screenshot of a view. Here some code snippets ready to use in your app. The basic concept consists in render the content of the view into a bitmap.