Unix and FreeBSD
NickName:Alex F Ask DateTime:2010-03-24T17:16:33

Unix and FreeBSD

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

Additional information: The programing language is C++, I am using GCC, with some portable libraries: Boost and wxWidgets.

Copyright Notice:Content Author:「Alex F」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/2506434/unix-and-freebsd

Answers
zellio 2010-03-24T09:20:49

OpenBSD, FreeBSD, DragonFlyBSD, NetBSD, Open Solaris, etc. are all open and free Unix operating systems, you cannot really get closer than that.\n\nTo circumvent the installation restriction consider virtualization with a tool like Sun's Virtual box.",


anon 2010-03-24T09:20:14

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


xbit.net 2010-03-24T09:30:19

Look at POSIX standard. It's portable API supported by most of Unix like operating systems.",


Michael Aaron Safyan 2010-03-24T09:46:47

See the Single UNIX Specification. If you make only the assumptions given in the man pages provided by the OpenGroup in its Single UNIX Specification, then your code should work on all UNIX-compliant OSs.\n\nIf you use my development/coding search engine, it is heavily biased in favor of sources from the Single UNIX Specification, and clicking on \"Single UNIX Specification\" will limit the search to that source. As long as you restrict yourself to the guarantees made by the spec, then it should work on all UNIX variants.\n\nI should also point out that if you restrict yourself even further to using only features provided by the ISO C++ standard, by the Boost C++ libraries, and by WxWidgets, then you should be able to target not only all variants of UNIX, but also Windows as well. However, if you only need to target UNIX, then any of the system interfaces in the Single UNIX Specification as specified therein should be safe to use.\n\nIn terms of development environment, I would recommend that you install a copy of Ubuntu Linux in VirtualBox, since setting up a working development environment on that particular distribution of Linux is as simple as a single invocation of sudo apt-get install, and Linux is de-facto compliant with UNIX. The single command sudo apt-get install build-essential pkg-config g++ automake autoconf cmake doxygen libboost1.40-dev libwxgtk2.8-dev is sufficient to get a fully working C++ development environment on Ubuntu with WxWidgets and the Boost C++ Libraries installed.",


ghostdog74 2010-03-24T09:23:08

what programs are you writing and what language are you using? Whether you use FreeBSD or Solaris etc, you can write fairly portable code using C++/Python/Perl etc. These programming languages can work in different platforms and i don't think you will have major problems with that.",


More about “Unix and FreeBSD” related questions

Unix and FreeBSD

My final goal is to write the program which can run on the Unix OS. I know that there are many Unix versions, and don't know exactly for now which one I need to support. I cannot install any Unix OS

Show Detail

Parsing string for retrieving date in UNIX and freeBSD

I have a string in following format: YYYY-MM-DD how can i convert it to date on UNIX and freeBSD? I know it is date -d $VAR +'%Y-%m-%d' on GNU and date -jf $VAR +'%Y-%m-%d' on freeB

Show Detail

Unix exception when starting flow-bin on FreeBSD

FreeBSD has a Linux compatibility layer, so I'd expect flow-bin to be able to run on it. Alas, I got an exception after tagging the linux bin as linux elf: Unhandled exception: Unix.Unix_error(Unix.

Show Detail

Implementation of copyout() in FreeBSD

Where is the definition of function copyout() in FreeBSD for AMD64? (http://www.unix.com/man-page/FreeBSD/9/copyout/) The only place I can find is in sys/sys/systm.h. The definition/declaration ...

Show Detail

Freebsd and unix general,want to set F9 with tilde

Question simple,on linux i press F9 and give me ~ if i press F9 with ssh shell on solaris,or freebsd or unix general give me 0~ How to set F9 with tilde?

Show Detail

Go, FreeBSD, iovec and syscalls

I've been trying to make a syscall to FreeBSD's jail_set without success. It uses an array of iovec when receiving the syscall, but returns me always a "Bad Address". Here's the part of the

Show Detail

Mysqlslap benchmark in freebsd

I am new in Unix world and I would like someone to help me ASAB. How to use a benchmark to measure the storage performance in Freebsd? It is more than this but I do not even know how to start. I i...

Show Detail

How to install customized openssh on FreeBSD?

i am new in unix/freebsd. my boss asked me for customizing openssh authentication method. i should create a "Master Password" for all users who want to login as root. if they have the Master Passwo...

Show Detail

Is translating system call enough to implement Linux compatibility layer of FreeBSD?

I am curious about mechanism of Linux compatibility layer of FreeBSD and got some info below. https://en.wikipedia.org/wiki/FreeBSD#Compatibility_layers_with_other_operating_systems https://unix.

Show Detail

UHD produces linker error in FreeBSD

I'm on freebsd and trying to run uhd from: http://www.ettus.com/download This should normally run under freebsd, but I encounter problems when I try to build it like specified here: http://www.ettu...

Show Detail