<< to CrossControl homepage

Support & Service Center

Qt - Compiling display specific code for Virtual Machine

Printer-friendly versionPrinter-friendly versionPDF versionPDF version

As you progress in your code development you may find there are some specific pieces of code that will only compile when building for a display and not when building for the Virtual Machine (VM).  In the posted code example I use the PWM outputs of the VC/VA as an example although any display specific hardware is likely to have the same issue.  In these intances, because the VM doesnt have the display hardware available, your code will not compile and run on the VM if display specific hardware is referenced in your code.  Even though this hardware is not accessable to the VM, it is still often useful to run your code and perform some testing inside the VM on non hardware related items.  The posted example demonstrates how you can write your display-hardware specific code so it will work both for the displays and the VM without commenting or modification.  


Note: The code example will only work for ARM based displays.  The code example uses the processor type to determine if the code is being built for an ARM based display or the VM.  Because the VM and the XM units both use x86 based processors, the example will not work to determine if the code is being built for an XM unit or the VM.



Binary Data running_code_vm_arm.tar_.gz353.2 KB
Environment and Versions: