Linux Night brought to you by
description
Transcript of Linux Night brought to you by
Linux Night brought to you by
Why are you here? Hopefully to learn I do not claim to be a Linux expert one bit.. I wish I am here to inspire you to broaden your
horizons I want you to feel familiar with Linux so you
hopefully write some “free” code What you should learn? Absolutely Nothing!
Unless you go outside of this room.
Who has only used Windows? Why? (hint: Your parents) Windows has Market share
Which Linux is right for me?
Brief History of Unix
History of Linux Linux History Chart:
http://www.levenez.com/unix/unix.pdf Linus Torvalds October 1991 The Unix operating system was conceived and
implemented in 1969 at AT&T's Bell Laboratories in the United States by Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna.
The GNU project, started in 1983 by Richard Stallman wanted a free version of Unix (Bell Labs)
Why make the switch to linux? Linux is Free Software repositories Live CDs/USB’s Community support/non commercial more than 90% of today's 500 fastest
supercomputers run some variant of Linux,[16] including the 10 fastest.
Linux is Free Companies license the software to
businesses and sell their support for a fee so the desktop versions are free (Canonical, Red Hat)
Open source, anyone can rewrite the kernel if you are so inclined
Software repositories -All “safe” software has been added. Debian, Ubuntu, Other APT based systems:
sudo apt-get install <whatever you want> Fedora, SUSE, Mandriva, RHEL, Other RPM
based systems: yum install <whatever you want>
Installing, updating and removing software in Linux is typically done through the use of package managers such as the Synaptic Package Manager, PackageKit, and Yum Extender
How I got eclipse
How do I get stuff I can’t find in the software center?
Live CD’s/USB’s Boot straight from a CD or USB drive Take it anywhere and still have all of
your features Drivers are supported directly at the
kernel level so it is incredibly portable Can even be installed simultaneously
with other installations
Community support/non-commercial Lots of software developers across the world use
it and they will help you with your problems There isn’t a commercial deadline or politics to
get in the way of releasing You can use any combinations of software you
like It is naturally more secure than Windows and
because it is less mainstream people do not target the OS as much
All of the software in the repo is verified prior to being made available
Customizable Any Distro Any Layout Tons of software to choose from Multiple Desktops Blah blah blah
Terms I couldn’t slip in anywhere else… GCC (GNU Compiler Collection) GNU GRUB ( Grand Unified
Bootloader) Wine (WINdows Emulator or Wine Is Not an Emulator)
Referencegasm https://www.cfa.harvard.edu/~jbattat/co
mputer/linuxReferenceCard.pdf http://files.fosswire.com/2007/08/fwunixr
ef.pdf http://www.perpetualpc.net/srtd_comma
nds_rev.html
Eclipse (Netbeans) IDE (Integrated Development
Environment) Reduces dependency on command line
tools http://
www.codeproject.com/Articles/14222/C-Development-using-eclipse-IDE-Starters-guide
Setting Up
Wrong!!!
Need the Dev tools…
Help->Check For Updates
Help->Install New Software
Then we can make a fancy Project
Main.cpp #include <iostream> #include "mine.h"
int main() { int myint = 1; for (int i = 0; i <100; i++) { myint = i + myint * 2; std::cout << myint << " "; }
mine newObject;
std::cout << std::endl << newObject.getSome(); std::cout << " MyInt = " << newObject.getmyint(); std::cout << " Increment Ret Val = " << newObject.increment(5); std::cout << " MyInt2 = "<< newObject.getmyint(); return 0; }
Mine.h #pragma once
#include <string> #include <iostream>
class mine { private: int myint; std::string caos; public: mine() { myint = 0; caos = "start some"; }
void helloWorld(){std::cout << "Hello World";}int increment(int incVal){myint += incVal;return (myint);}std::string getSome(){return caos;}int getmyint(){return myint;}};
Eclipse Generated makefile
######################################### # Automatically-generated file. Do not edit! ############################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here -include sources.mk -include subdir.mk -include objects.mk
ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C++_DEPS)),) -include $(C++_DEPS) endif ifneq ($(strip $(C_DEPS)),) -include $(C_DEPS) endif ifneq ($(strip $(CC_DEPS)),) -include $(CC_DEPS) endif ifneq ($(strip $(CPP_DEPS)),) -include $(CPP_DEPS) endif ifneq ($(strip $(CXX_DEPS)),) -include $(CXX_DEPS) endif ifneq ($(strip $(C_UPPER_DEPS)),) -include $(C_UPPER_DEPS) endif endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Targetall: MyProject
# Tool invocationsMyProject: $(OBJS) $(USER_OBJS)@echo 'Building target: $@'@echo 'Invoking: GCC C++ Linker'g++ -o"MyProject" $(OBJS) $(USER_OBJS) $(LIBS)@echo 'Finished building target: $@'@echo ' '
# Other Targetsclean:-$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) MyProject-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
My Makefile all:
g++ main.cpp -o main
It can get much more complicated and if you were doing anything non-trivial it should get more complicated
Need a resource?http://mrbook.org/tutorials/make/
Make In software
development, Make is a utility that automatically builds executable programs and libraries from source code by reading files called makefiles which specify how to derive the target program.
Directory Structure Reference