Hi!
Working environment:
Debian 8 Jessie 64bit, Qt Creator 3.2.1, both Debian's CrossToolchains and the ones provided for Raspberry Pi in the official repo on github
Rapsberry Pi 2, Rasbian (latest version)
I have recently bought a Raspberry Pi 2 and decided to check out the embedded development features Qt and Qt Creator provide. It took me a couple of days to get the right compilation setup but finally I can compile a valid 32bit ARM binary that is automatically send over to the Raspberry Pi 2 when I click on Deploy. The binary runs without any issues when I open it natively on the device. However I would also like to be able to run and debug it remotely (over SSH). This seems a very difficult task for me.
My project is a CMake project and accordingly I have a CMakeLists.txt
# Description: Arm-linux cross-compilation project for RPi2 using Qt Creator
project(RPiCrossCompileRemoteTest)
cmake_minimum_required(VERSION 2.8)
include(CMakeForceCompiler)
# Set OS and processor architecture
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_SYSTEM_VERSION 1) # not so important
# Specify the compilers
#set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) # for C
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) # for C++
# TODO: auto-generate the deployment configuration file for connecting local with remote paths
# ...
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
# Description: Arm-linux cross-compilation project for RPi2 using Qt Creator
project(RPiCrossCompileRemoteTest)
cmake_minimum_required(VERSION 2.8)
include(CMakeForceCompiler)
# Set OS and processor architecture
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_SYSTEM_VERSION 1) # not so important
# Specify the compilers
#set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) # for C
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) # for C++
# TODO: auto-generate the deployment configuration file for connecting local with remote paths
# ...
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
To copy to clipboard, switch view to plain text mode
and a QtCreatorDeployment.txt
/home/pi/Projects/remote_projects/
/home/pi/Projects/remote_projects/
To copy to clipboard, switch view to plain text mode
I thought that running the application actually uses the same setting for working directory as does the Deployment for the SFTP transfer, remote command execution etc. However it seems this is not the case.
The only thing I can come up with is giving the full SFTP address in that field:
sftp://192.168.1.102/home/pi/Projects/remote_projects/
sftp://192.168.1.102/home/pi/Projects/remote_projects/
To copy to clipboard, switch view to plain text mode
All I get in return is a slap from Qt Creator:
Cannot change to working directory "sftp:/192.168.1.101/home/pi/Projects/remote_projects": No such file or directory
Cannot change to working directory "sftp:/192.168.1.101/home/pi/Projects/remote_projects": No such file or directory
To copy to clipboard, switch view to plain text mode
In total I have wasted something like 3 days looking into this issue without any success whatsoever. Is it really that difficult to do something like this? 
I have seen settings for Symbian and Maemo/MeeGo devices for example but the exact part I so desperately need seems to be set automatically. The generic Linux device (which I am using) section contains multiple things that don't look like that anymore and the part of setting the remote working directory is skipped completely (you can just see Executable on device: /opt/MyProject/bin/MyProject).
Please help! I can do all that via terminal but I would really like to use the very neat functionality Qt Creator offers as IDE.
Bookmarks