ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I wish to create a program that will be portable across Linux/BSD and Windows. My workstation runs Linux (Debian) but I also have a small Windows XP partition specifically for this purpose. I want to know how I can be sure that a cirtain function available in Linux will also be available in Windows [and do the same thing, etc.] without having to write the code in Linux, reboot into Windows, try to compile etc. I have very little experience with Windows programming.
Also.. I need my program to look "something like" the irssi window. [simpler, but I need "user input" to have a specific place on the screen, same for program output ; the program runs in interactive mode]. Is there any portable way to achieve this [a portable lib etc.].
The easiest way is to use a portable language such as Java or Python, taking care that you use only portable functions. These languages have a portable layer that is guaranteed to work on every implementation.
For your target platforms, verify which versions are available of the chosen language, and stick to the minimum level.
BTW, I heard that Java on BSD is tricky license-wise, so something like Python is maybe more appropriate.
You could write a console program that uses only standard C functions. You could also look into wxWidgets. It is an open source C++ API for GUI applications that will run on anything from Linux, Windows, WindowsCE, Mac OS X, even on OS/2, a smartphone or a Palm Pilot. You can also install language bindings for Python, Perl, wxBasic, javascript, java, ruby, C# and others.
I was thinking of using ncurses + cgywin [is this possible?]. This is what I'd like the user interface to look like:http://img208.imageshack.us/img208/6021/imgtg6.png. Is ncurses the right tool for this job?
Since Sun is actively GPLing Java SE I doubt this should be a problem installing it on BSD. Also, there are other Java distributions, like blackdown www.blackdown.org
Since Sun is actively GPLing Java SE I doubt this should be a problem installing it on BSD.
You should be aware that GPL and BSD tend to avoid each other. The BSDs have their own licence and often have a problem with the GPL. Nevertheless, there ara Sun Java binaries for FreeBSD. Java is not officially supported on OpenBSD. I don't know about NetBSD.
To introuble: is C a must?
There are some libraries for C that create a "portable" environment for C: I remember that Mozilla uses one, Qt has portable functions beyond graphics as well, and others exist. But none of these solutions are as easy as using a language designed for portability and which has a large library, such as Python.
However looking at the docs in /usr/share/doc/ncurses/, I don't see any problem. Read the license info for the cygwin port to make sure. Maybe this author is off base, I don't know. (I can't imagine Eric Raymond releasing an evil eula, but Mad Dog might disagree.)
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Quote:
Originally Posted by uselpa
You should be aware that GPL and BSD tend to avoid each other. The BSDs have their own licence and often have a problem with the GPL.
Java SE is released under a dual (or triple) license, GPL, CDDL and commercial.
Unlike GPL, CDDL is not viral and is certainly compatible with BSD requirements.
You should be aware that GPL and BSD tend to avoid each other. The BSDs have their own licence and often have a problem with the GPL.
While it's true that GPL code is kept out of the kernel source (and most of the system binaries), you can get any GNU code you want from Ports / pkgsrc. I use lots of GNU software, some of it absolutely essential (Bash and Emacs for two).
Your statement comes off that BSD systems don't have GPL software on them, or that they are somehow fundamentally opposed to one another, which is simply not true. And I don't think many working on the BSD system have a "problem" with the GPL, it's just not the license they're working under. Heck, a lot of GNU software gets used to build a BSD system, like ... umm ... GCC?
Rereading the link I gave above, it doesn't seem to be a problem unless you compile and distribute a propriety application using the cygwin dll. Especially if you modified it. Then you must supply the source code. This is more about using Cygwin and the GPL then using ncurses. I hope I didn't alarm you too much.
I don't know what your application actually does, but you could use the ncurses library with C or python or use ncurses tput command in a bash script. It may be easier for other users if they only needed to install ncurses when using cygwin or cygwin/X, if your app where a simple bash script. ( I have nothing against python or perl here at all. ) You also wouldn't need to use the gcc ming compiler if you wrote a script. Also, since you are only distributing your own script you have less worry about whether you are violating a license due to the use of a dll You are just supplying a script ( which is in itself open source code, neat! ).
Interpreted scripts and programs are also the most portable across many platforms. A python script, for example, would require that python be installed, but it wouldn't require installing Cygwin. A bash script would require a Cygwin installation, but you might be doing the end user a favour eventually. ( All of those text utilities like sed, awk, cut, sort, latex, ps2pdf, etc. that could allow to do things in a couple 3 line scripts that they might have installed a bulky GUI application to do in the past. )
The application involves Network Programming + a home made protocol; amongst other things. If Python was [during my last posts] a somewhat possible option.. shell scripts were (are) definitely out. I need speed, and others, that BASH scripting can not give me.
I said "during my last posts" because I've decided to give Python a shot after all; but I think C would have done the job nicely as well. (irssi seems to be a success story in this sense; though I don't know through how much hassle the developers went.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.