Unix and FreeBSD

My ultimate goal is to write a program that can run on Unix. I know that there are many versions of Unix, and I don’t know exactly which one I need to support. I cannot install Unix OS right now. The only thing I can do is use the free OS, which is as close as possible to Unix. Is FreeBSD a good choice for this? I know there is OpenBSD, maybe something else.

Additional Information: The programming language is C ++, I use GCC with some portable libraries: Boost and wxWidgets.

+7
unix freebsd
source share
6 answers

OpenBSD, FreeBSD, DragonFlyBSD, NetBSD, Open Solaris, etc. - all these are open and free Unix operating systems, you cannot come close to this.

To get around the installation limitation, consider virtualizing with a tool such as the Sun Virtual Block .

+6
source share

Depending on what your program does, what language it is written in, etc., you can write portable code on any platform. For example, I regularly port one of my applications, written in C ++ from Windows, where I develop it, to Linux with one minor change (I remove ODBC support). Thus, the choice of OS for development is not critical - consciously write portable code.

+5
source share

See the POSIX standard. It is a portable API supported by most Unix-like operating systems.

+3
source share

See Unified UNIX Specification . If you make only the assumptions given in the man pages provided by OpenGroup in your Single UNIX specification, then your code should work on all UNIX-compatible OSs.

If you use my development / coding search engine , it is highly biased in favor of sources from the Unified UNIX Specification and clicks on “Unified UNIX Specification” to limit the search to this source. While you are limited to the guarantees provided by the specification, then it should work on all UNIX variants.

I should also note that if you further restrict the use of only functions provided by the ISO C ++ standard, Boost C ++ and WxWidgets libraries, then you can target not only all UNIX variants, but also Windows. However, if you need to target UNIX, then any of the system interfaces in the Single UNIX specification, as indicated in it, should be safe to use.

Regarding the development environment, I would recommend that you install a copy of Ubuntu Linux on VirtualBox , since setting up a development environment on this particular Linux distribution is as simple as a single call to sudo apt-get install , and Linux is de facto UNIX compatible. The only sudo apt-get install build-essential pkg-config g++ automake autoconf cmake doxygen libboost1.40-dev libwxgtk2.8-dev enough to get a fully working C ++ development environment on Ubuntu with WxWidgets and installed Boost C ++ libraries .

+3
source share

What programs do you write and in what language do you use? Regardless of whether you use FreeBSD or Solaris, etc., you can write quite portable code using C ++ / Python / Perl, etc. These programming languages ​​can work on different platforms, and I do not think that you will have serious problems with this.

+2
source share

Most of the systems mentioned above have (limited) support for running Linux executables. You can try creating and distributing the linux binary. If you build it on something like RHEL4, most of them will support the necessary ABI to run the program.

For example, flashplugin on most BSDs is actually linux-flashplugin.

0
source share

All Articles