cross-platform

Cross-platform configuration, options, settings, preferences, defaults

一世执手 提交于 2019-12-07 03:14:55
问题 I'm interested in peoples' views on how best to store preferences and default settings in cross-platform applications. I primarily work in node.js and Perl on *nix and Windows but I'm also interested in the bigger picture. In the *nix world "dotfiles" (and directories) are very common with system-wide or application default settings generally residing in one path and user-specific settings in the home directory. Such files and dirs begin with a dot "." and are hidden by default from directory

Physical layout on disk of large cross-platform C++ project with many third party dependencies

吃可爱长大的小学妹 提交于 2019-12-07 02:56:45
问题 I am in the process of reorganizing the physical (on disk) layout of a large cross-platform C++ project with many third party dependencies, built using CMake. Since we need to support Windows, a platform on which there is no well-established package manager, we decided a long time ago to include the third party libraries we rely on in the source tree. However, on the other platforms we support such as Linux and Mac OS X, many of these third party libraries are available as packages or are

Is it better to use `#ifdef` or inheritance for cross-compiling?

≯℡__Kan透↙ 提交于 2019-12-07 02:38:45
问题 To follow from my previous question about virtual and multiple inheritance (in a cross platform scenario) - after reading some answers, it has occurred to me that I could simplify my model by keeping the server and client classes, and replacing the platform specific classes with #ifdefs (which is what I was going to do originally). Will using this code be simpler? It'd mean there'd be less files at least! The downside is that it creates a somewhat "ugly" and slightly harder to read Foobar

How to generate a OS independent path in c++

ぐ巨炮叔叔 提交于 2019-12-06 23:13:31
问题 I have a destination path and a file name as strings and I want to concatenate them with c++. Is there a way to do this and let the program/compiler choose between / and \ for windows or unix systems? 回答1: If you wanted to do it at compile time you could certainly do something like #ifdef WIN32 #define OS_SEP '\\' #else #define OS_SEP '/' #endif Or you could just use '/' and things will work just fine on windows (except for older programs that parse the string and only work with '\'). It only

Is there a non-java, cross platform way to launch the associated application for a certain file type?

怎甘沉沦 提交于 2019-12-06 21:35:35
问题 First, I found a couple of java specific questions and answers for this. I am looking for more "native", but cross platform solution, using C, C++, some kind of shell scripts, or, in my case, Qt. So the question is, are there standard, cross platform, ways to programmatically open the associated application for certain file types. Or at least to find out if there are associated applications and be able to locate and launch them? By cross platform I mean Windows, OSX and linux (gnome/kde). The

Will Java compiled in windows work in Linux?

Deadly 提交于 2019-12-06 20:27:39
问题 My Java program is in working order when i use it under Windows(Eclipse and Bluej). I compress it to a Jar and send it to my red hat and bang. nothing works. It breaks on the weirdest things, such as text field set text will not show, JPasswordfield just disappeared, Java AWT ROBOT dies too... the list goes on, first i thought it must be my Linux JRE is out of date, but i installed latest JRE then the JDK with no improvement at all. I have a feeling that i miss understood the Java cross plat

Using environment variables in npm scripts across platforms

折月煮酒 提交于 2019-12-06 18:39:15
问题 I am building a package.json and use "npm run" to run some scripts, to be exactly, https://docs.npmjs.com/misc/scripts. My script would need to expand some environment variables and I want to make it cross platform compatible. For example, my script would say "scripts": { "build": "md %npm_package_version%\helloworld" } But it's currently running on Windows because the expansion of environment variables. Linux would use md $npm_package_version\helloworld . Does npm comes with a mechanism to

Cross platform audio analysis library

筅森魡賤 提交于 2019-12-06 16:40:34
问题 I'm looking for a cross-platform library that allows me to analyze the waveform of a sound file. It needs to be able to at least have the ability to query the amplitude for a given sample, and it would be nice if it could do frequency detection. 回答1: Well, querying the amplitude for a given sample is rather easy, you only need to convert the sample's value to decibels. As for the other types of analysis, you'll probably find aubio to be a good tool. It can do frequency detection, and even

Can C++ be compiled into platform independent code? Why Not?

混江龙づ霸主 提交于 2019-12-06 14:36:22
问题 Is it possible to compile C++ program into some intermediate stage (similar to bytecode in java) where the output is platform independent and than later compile/link at runtime to run in native (platform dependent) code? If answer is no, why? 回答1: It is indeed possible, see for example LLVM. 回答2: Of course. Keep in mind that the C++ standard only specifies behavior: What should happen when this program executes. It doesn't specify how it should be implemented. C++ code can be compiled to an

Add PhoneGap app to “share” menu on Android and IOS

坚强是说给别人听的谎言 提交于 2019-12-06 14:34:57
I am wondering whether it is possible to add my PhoneGap application to android and ios "share" screens. This is basically what i am talking about: User is on Chrome and wants to share a particular page url Instead of copying the link into the clipboard and manually running the app, the user can select the "share" option and choose my application from the list I am using PhoneGap Build service to build my application. I have been searching online and here on StackOverflow and there are plugin solutions for android but i can't seem to find anything for ios. Plus, the solutions i found are for