What are the options for setting up a UNIX environment to learn C using Kernighan and Richie’s The C Programming Language?

I’m a novice programmer and have been experimenting with Javascript, jQuery and PHP but felt I wasn’t getting a real depth of understanding of what I was doing. So, after reading Joel Spolsky’s response to a question on this site (which I can’t find now!), I took it back to basics and read Charles Petzold’s ‘Code’ and am about to move onto Kernighan and Richie’s The C Programming Language. I want to learn this in a UNIX environment but only have access to a Windows system. I have Ubuntu 12.04 running on a virtualised machine via VMWare Player, and done some coding in the terminal.

Is using a Linux distro the only option for programming in a UNIX environment on Windows? And what are the next steps to start programming in C in UNIX and where do I get a compiler from?

1

Linux in VM is the easiest option to learn UNIX. If you’re running Ubuntu, you can open up terminal and type:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>sudo apt-get install gcc
</code>
<code>sudo apt-get install gcc </code>
sudo apt-get install gcc

And you’ll have your compiler. Debian-based distros in general will make development very easy because if you’re missing library X, chances are it’s already in the repositories and you can apt-get it with minimum fuss.

For the other part of your question: no, Linux in VM is not the only way to go, but it’s the easiest to get started with. You can always intall FreeBSD / Open Solaris / etc but I don’t recommend those for your first plunge.

Finally, if you want to force yourself to learn the system, you can install it on bare metal and ditch the VM. I recommend dual-booting to start. You will probably start running into driver / configuration problems 🙂 and ultimately have to learn how everything works.

Good luck.

EDIT

In reference to some comments: MinGW and Cygwin will not help the OP learn UNIX/POSIX. The OP clearly stated that she/he is interested in C programming in UNIX, and that means UNIX-specific APIs, patterns, and issues.

4

If you really don’t want to move to Linux, or continue using Linux on a virtual machine, you could give Cygwin a try. It’s:

  • a collection of tools which provide a Linux look and feel environment for Windows.

  • a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality.

More importantly, it makes The GNU Compiler Collection available on Windows. A similar tool, but a bit more tuned for developers is MinGW. It includes:

  • A port of the GNU Compiler Collection (GCC), including C, C++, ADA and Fortran compilers;
  • GNU Binutils for Windows (assembler, linker, archive manager)
  • A command-line installer (mingw-get) for MinGW and MSYS deployment on MS-Windows
  • A GUI wrapper (mingw-get-inst) for the command line installer

Everything you need, and then some.

4

OSX since 10.5 and forward is offically considered a Unix. Solaris is another option. Either one can be installed on Virtual Box, both include GCC as a compiler. Ignore cygwin under Windows, it is more trouble than it is worth, and isn’t a full Unix environment/experience.

I use Virtual Box on both an OSX machine and a Windows machine to host Linux ( CentOS ) and with a dual monitor setup and plenty of RAM you don’t even realize that it is not a real machine you are using.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật