cross-platform

How can I create a modern cross compile toolchain for the Raspberry Pi 1?

雨燕双飞 提交于 2019-12-18 09:01:00
问题 At least Debian does not provide a usable toolchain to cross develop for the Raspberry Pi 1. The Linaro toochain is at the time of this writing too old for the Qt5 developer branch. There is a project crosstools-ng, which allows to easily build custom toolchains for all kinds of systems. It supports a fairly modern GCC 4.9.1. The configuration is a bit trial and error, but the main problem is, that the toolchain does not find all the include files or libraries. How is the crosstools-ng to be

Can you use the standard GDB debugger with Qt executables?

心已入冬 提交于 2019-12-18 08:54:27
问题 I just started using Qt and I wanted to debug my Qt application. Can I use the standard GDB debugger with Qt executables? 回答1: Yes you can. You might also want to use the gdb integration in Qt Creator, which does a much better job of inspecting data at run time than gdb alone. 回答2: There is no reason why you might not do so. As Qt executables are just normal executables compiled by GCC you could debug them as all others. The fact that the Qt build process auto-generates intermediate C++ files

Storing a file in the user's directory in cross-platform Java

a 夏天 提交于 2019-12-18 08:51:46
问题 I have a Java application that runs on Mac and Windows, directly off a CD/DVD with no installation. Now, I need to store a file containing per-user data (think favourites etc.) somewhere on the local file system, so that it can be written to. So, where do you think is a good location for this file? I am thinking something like: <USER_DOCUMENTS_AND_SETTINGS>/application data/myapp/favourites.db for windows <USER_HOME_DIR>/.myapp/favourites.db for mac/nix Thoughts? And does anyone know the best

Storing a file in the user's directory in cross-platform Java

三世轮回 提交于 2019-12-18 08:51:43
问题 I have a Java application that runs on Mac and Windows, directly off a CD/DVD with no installation. Now, I need to store a file containing per-user data (think favourites etc.) somewhere on the local file system, so that it can be written to. So, where do you think is a good location for this file? I am thinking something like: <USER_DOCUMENTS_AND_SETTINGS>/application data/myapp/favourites.db for windows <USER_HOME_DIR>/.myapp/favourites.db for mac/nix Thoughts? And does anyone know the best

Practical GUI toolkit?

て烟熏妆下的殇ゞ 提交于 2019-12-18 07:34:10
问题 I am thinking about cross-platform with nice programming language bindings (Java, Ruby and Python). What would be the "flattest" learning curve but yet enough powers to perform most of the standard GUI features? What would you guys/gals recommend; FOX, wx, Tk or Qt? 回答1: I would go with Qt. It works on all the major platforms, and it's being continually improved. You can also get started really fast. There are bindings for Java, Ruby and Python. Plus it's free if you're writing open source

Why can't I read and append with std::fstream on Mac OS X?

折月煮酒 提交于 2019-12-18 07:12:36
问题 Consider the following C++ program, which takes a file and prints each line. It's a slice of a larger program where I later append to the file, based on what I see. #include <fstream> using std::fstream; #include <iostream> #include <string> using std::string; int main() { fstream file("file.txt", fstream::in | fstream::out | fstream::app); string line; while (std::getline(file, line)) std::cerr << line << std::endl; return 0; } Now apply this version of file.txt (One word on the first line,

Conditional compilation in C++ based on operating system

我是研究僧i 提交于 2019-12-18 06:13:10
问题 I would like to write a cross-platform function in C++ that contains system calls. What conditional compilation flags can I check to determine which operating system the code is being compiled for? I'm interested mostly in Windows and Linux, using Visual Studio and GCC. I think it should look something like this: void SomeClass::SomeFunction() { // Other code #ifdef LINUX LinuxSystemCall(); #endif #ifdef WINDOWS WindowsSystemCall(); #endif // Other code } 回答1: My gcc (4.3.3) defines the

What cross platform GUI library has the most native feel for each platform?

丶灬走出姿态 提交于 2019-12-18 05:56:46
问题 I've noticed that GTK has a uniform feel across all platforms, which is great for Linux lovers, but not so great for people who prefer their native GUI feel. I haven't used Qt properly yet, which is why I'm unable to say that this is the best choice to provide the most native feel for each platform - so could someone please confirm whether Qt is what I'm after? 回答1: I think Qt is a great choice to have a native look. On Windows XP, widgets will be rendered with the Luna style (Windows XP

Enable dropping a file onto a Ruby script

痴心易碎 提交于 2019-12-18 05:12:32
问题 I'm creating a small ruby script to resize images and save them in a specified directory. I'd like the application to be as transparent as possible. Is it possible to allow file dropping onto my Ruby script in all platforms? For instance, the user drags a file onto the script, which then takes the file path as an argument and resizes the image accordingly -- No GUI, no console, etc.. 回答1: The behavior of drag & drop is dependent on the OS (and in case of Linux of the Window Manager), so no.

How do I prepare a Raspberry Pi with Raspbian so I can cross compile Qt5 programs from a Linux host?

我的未来我决定 提交于 2019-12-18 05:11:57
问题 I want to setup a cross compile environment on Linux for the Raspberry Pi 1. Especially I want to try bleeding edge version, i.e. Raspbian testing + Qt5 dev branch. This question: How can I create a modern cross compile toolchain for the Raspberry Pi 1? ...explains how to get a gcc compiler, which can create code for the Raspberry Pi 1. Are there changes necessary on Raspbian itself to use it? If so, which ones? 回答1: A full toolchain is what you need A toolchain is a set of tools working