How to Fix: Manually compiled TigerVNC throws syntax error on Raspberry Pi
TigerVNC compilation error on Raspberry Pi B+ due to 64-bit executable and lack of dynamic linking.
📋 Table of Contents
The error 'Could not start Xvnc. /usr/local/bin/Xvnc: 1: /usr/local/bin/Xvnc: Syntax error: ')' unexpected' is encountered when attempting to run TigerVNC on a Raspberry Pi B+ with XRandR support. This issue affects users who have compiled TigerVNC from source using CMake and are experiencing difficulties in starting the Xvnc server.
This error can be frustrating, especially for users who are new to compiling software from source. However, by following the steps outlined below, it is possible to resolve this issue and successfully run TigerVNC on the Raspberry Pi.
🔍 Why This Happens
- The primary reason for this error is that the compiled Xvnc binary is a 64-bit executable, which is not compatible with the 32-bit ARM BCM2835 CPU of the Raspberry Pi. This incompatibility causes the 'not a dynamic executable' error when attempting to run the Xvnc binary.
- Another possible reason for this error could be that the compiled Xvnc binary is missing or corrupted, causing the system to fail to find it.
✅ Best Solutions to Fix It
Using a compatibility layer
- Step 1: To resolve this issue, install the 'lib32-dev' package on the Raspberry Pi, which provides the necessary 32-bit libraries for running 64-bit executables.
- Step 2: Run the command 'sudo apt-get install lib32-dev' to install the required package.
- Step 3: Once installed, try running Xvnc again using the compatibility layer: '/usr/local/bin/Xvnc -A :0 -screen 0 1024x768x16'.
Recompiling with dynamic linking
- Step 1: To avoid this issue in the future, recompile the Xvnc binary using CMake with dynamic linking. This can be done by adding '-DCMAKE_BUILD_TYPE=Release -DLIBCST static' to the CMake command.
- Step 2: Run the following command to recompile the Xvnc binary: 'cmake .. && make'.
✨ Wrapping Up
By following these steps, it is possible to resolve the 'Syntax error: ')' unexpected' issue and successfully run TigerVNC on the Raspberry Pi B+. Remember to install the 'lib32-dev' package or recompile the Xvnc binary with dynamic linking to avoid this issue in the future.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid