Qt Resource System. rcc cross-platform binary manipulation.



  • Hi all,

    My question is pretty simple: I was wondering whether I could manipulate binaries from
    other platforms using rcc.
    Example:
    Suppose have a win32 executable 'app.exe', and I would like to embed resources into it,
    my question is basically, Can use the 'rcc' tool in Linux to embed the files, and still
    have a valid win32 application?

    Use case: I have an application available to download on a Linux server, a user
    request a download for the win32 version, the server runs a 'rcc' command to embed user-specific resources
    previous to download, and the user gets a customised application.

    Do you think this is possible at all?

    Thanks,

    Sergio



  • RCC doesn't embed resources into the binary (executable file) directly. Instead it will generate C++ source code files. Those will then have to be compiled and linked into your binary, e.g. with MSVC or MinGW on the Windows platform or with GCC on the Linux platform. It's also possible to "cross compile" a Win32 executable from Linux host (and probably also the other way around). But, as far as I know, once you have a "finished" executable file, you cannot embed additional resources or modify existing ones - not without re-compiling from the sources!

    Alternatively, RCC can generate an "external" .rcc file (binary resource file) instead of compiling the resources into the executable file. Your program can then load the .rcc file at runtime, using QResource::registerResource(). This way you can modify the resources later on without modifying (re-comping) the executable file. You can simply do that by replacing the .rcc file with a new one. You can also use the same .rcc file on different platforms.

    http://doc.qt.digia.com/stable/resources.html


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.