netbeans c++ change remote building path - c++

I'm using Netbeans 8.2 on a Win 10 Machine for remote developing on a RaspPi with Raspbian Jessi.
I set up the remote building system and it works very well.
There one think I do not like. Netbeans is using this path to copy the data
pi#raspberrypi:~/.netbeans/remote/192.168.1.46/workstation-Windows-x86_64/C/Users/user/Documents/NetBeansProjects/.....
How can I change this path e.g. to
pi#raspberrypi:~/NetBeansProjects/

Related

Libpcap issues with release build C++ application

I've developed a network sonification app in C++ that uses libpcap for packet capture. It works fine on my computer (early 2012 Macbook) but when I try to run the release build application on any other machine libpcap can't open a handle and returns null. I've added a post-build script in Xcode that adds the libpcap .dylibs from my usr/libs folder to a Frameworks folder in the application contents so they should be accessible but I can't figure out why libpcap is not working.
Thanks.

Qt Creator remote debugging

I have an application that I run on an Embedded Linux device.
In Eclipse, I can run remote debugging using the eclipse-cdt-launch-remote plugin where I point a binary to run, and where to put it on the device with some environment variables to be exported before running the application.
The application is a C++ application with a custom Makefile for building the application as an ELF file.
The application is deployed on the device via SSH, using login with user and password. And then, I can debug from Eclipse using stepping and so on.
(I am also using the MentorGraphics crosscompiler for arm-none-linux-gnueabi-2014.05)
My question is: How do I mimic the same functionality in Qt Creator since I like coding with Qt Creator more than coding with Eclipse?
I know that an easy fix would be to code in Qt Creator, and then debug using Eclipse, but I really want to debug using Qt Creator.
Edit: Solved it by hours of testing and reading up on the Qt Creator
IDE.
Imported my project that was an Makefile project.
Then I went in to Options under Tools and added my Device that used SSH.
After that I added a debugger, I used gdb-multiarch since the one provided in the prebuilt toolchain binary did not support python.
Then I added my custom toolchain pointing the compiler path to the toolchains binary g++. And set the ABI to
arm-linux-generic-elf-32bit. Although I dont actually see the
compiler settings being used during debug.
I created a new kit using my Device, Debugger, and Compiler. And set device type to Generic Linux Device. Pointing to my sysroot that
I extracted when using buildroot for the filesystem. These were the
only options I set in the kit.
Closed the options menu, and went into Projects where I added my new kit
Changed the build settings and set the build directory and build steps for the application.
Changed the run settings to use some custom commands, like moving the newly built .elf application to target. And then I set where the
local executable was and where the remote executable was. The remote
executable is the one I moved to the target using custom command from
host.
Voila! I could now run remote debugging on my target from Qt Creator.
Qt Creator has built-in support for automatic deploy on remote devices.
On the Embedded Linux device:
Create a login password for the root user
Install the openssh-server and gdb-server packages
On Qt Creator:
Enter Tools > Options > Devices and create a new device specifying address (i.e. IP and port numbers) and credentials (i.e. root and password). Further information available here.
Enter Tools > Options > Build & Run > Compilers and add the gcc cross-compiler path (further information available here)
Enter Tools > Options > Build & Run > Debuggers and add the gdb cross-debugger path (further information available here)
As the last step, finally enter Tools > Options > Build & Run > Kits and link compiler, debugger and device into a single Kit, also specifying the sysroot (i.e. local copy of the embedded Linux root filesystem).
Set the build target to Debug.
In the Qt project, check that all deploy steps are selected (e.g. transfer file to the remote device) and add any needed argument (e.g. -qws for touchscreen on Qt 4.x)
In general, have a look at the guide here.

Run Mac application of C++ and Qt on another Mac

I am trying run a simple C++ with QT application on another mac. I am trying to avoid having to install Qt on the other mac. This application was created in Xcode with cmake.
Two notes: my application (for some reason) does not create an .app file. It just creates a file with the name of my project (and no extension). I can run this file by double clicking, but still, it is not an .app. Does this matter?
Another thing, I am linking my application to static libraries of Qt. From what I understand, this should allow to run the application even if Qt is not installed, right? The result of running my application on the other mac is simply a terminal window that says: Instruction unknown.

linux development on windows

We develop C++ code primarily on a headless linux x64 server with VI. We are provided with windows desktops and I was wondering how others in similar situation work? Do you just use windows to remote into linux box or is there a way to develop on windows.
Two solutions that come to my mind are:
Run a linux VM on windows desktop.
Cygwin. (not sure about it).
Any others?
There is a VIM port for windows. As an everyday user I can say that the experience is seamless, except for using windows path separators.
There are other options to consider:
MSYS supplies you with a set of GNU tools compiled natively for windows, including a shell, ssh/scp
MinGW gets you a Windows port of gcc.
UnxUtilx is another set of GNU tool ports, but with no recent activity.
As others have mentioned, putty gets you ssh/scp, purpose-built for windows.
The only C++ app I currently develop is Qt based and cross platform so I tend to develop in Windows using Visual Studio and then test on linux. For testing on linux I mostly use putty, vi and make but if I need to use a debugger I use nemiver and xming with putty exporting the x session to the PC for xming to render.
Do you just use windows to remote into linux box or is there a way to develop on windows. -- yes mostly I do that.
winscp is a tool that lets you do your text-editing locally in your editor of choice, whether it be emacs for windows or gedit or notepad, and save remotely.
When I worked in an environment like that, I installed Cygwin/X and putty on my windows box. You use putty to connect to the Linux box with the Connection --> SSH --> X11 --> "Enable X11 forwarding" turned on. You
Install Cygwin including Cygwin/X http://x.cygwin.com/ — download the installer, make sure the xinit package is selected in the things to install, and hit go!
Install PuTTY http://www.chiark.greenend.org.uk/~sgtatham/putty/ and enable X forwarding in your session settings. PuTTY will automagically set your DISPLAY environment variable correctly.
Start your X server on Windows (Start -> Programs -> Cygwin/X -> XWin Server ) — you may want to copy this to your Startup group so it runs whenever you log in.
Use PuTTY to connect to your *nix box and fire up an X Windows program — remember to "amp it off" http://www.catb.org/jargon/html/A/amp-off.html.
You can use whatever X programs are available on the Linux machine seamlessly on your local client desktop. You can do it with Eclipse or gvim or kate.
Another thing I've had good luck with is using Samba on the Linux box to share my source tree, and then mapping a drive in Windows to that share, using native Windows tools to edit it.

How to debug a linux C++ program from Windows with Eclipse?

I use a headless (i.e. no screen) remote ubuntu server x64 for developping a C++ application (with no UI either).
I want to conveniently (IDE like, not command line) debug this program from windows (7/64), with Eclipse if possible. I have a windows share between the two and full root access on both machines.
So far I have heard of two solutions :
Remote gdb
Remote X server
I have worked on solution 1 : built a cross gdb, copied my program and libs on windows. I'm able to remote-gdb from cygwin command line, but not from eclipse (stuck at "launching... 85%" with no error message nor log)
I have also worked on solution 2 : installed xauth, set X forwarding, installed xming on my windows, set DISPLAY on the linux box. But no effect "can't open DISPLAY xxx" with no easy troubleshoot.
When googling for those problems, I only find outdated pages or different problems.
Did anyone do it ? Can you share advices or fresh pointers on how to remote debug a C++ linux app from Windows ?
I suggest to install an X11 server on your Windows machine (e.g. Xming perhaps?) and to do ssh -X with some X11 client applications (like emacs, ddd if needed, xterm) on your Linux server. Don't use a complex thing like Eclipse. You could just use emacs (remotely on the Linux server, displaying on the Windows desktop X11 server)...
Once emacs works well (running on the remote Linux server, displaying on the Windows desktop X11 server), you can run gdb inside it.
To get ssh -X working, you need to configure it appropriately. Maybe you forgot that step. To test it, just use ssh -X yourlinuxhost xterm, and work on configuration till that step works.
Of course you could also install Linux on your laptop or desktop, perhaps inside a virtual machine above your Windows.
NB. I never used Windows, but I do know that some X11 servers exist for it.
There is a eclipse plugin RSE (Remote System Explorer), it can pretty much do what you are expecting. The code base can be in linux server, eclipses uses telnet / ssh to login. Execution again can happen on a server, native gdb is used to debug.
You can use the following simple plugin for Eclipse.
http://marketplace.eclipse.org/content/direct-remote-c-debugging
It needs just ssh connection to the server and it cares about anything else