Skip to content

Instantly share code, notes, and snippets.

@georgyo
Created August 24, 2016 20:13
Show Gist options
  • Save georgyo/dc7c1253cf670223db58d00dc9505869 to your computer and use it in GitHub Desktop.
Save georgyo/dc7c1253cf670223db58d00dc9505869 to your computer and use it in GitHub Desktop.
shammas@shamm ~/tmp/helloworld % cat hw.go
package main
import "fmt"
func main () {
fmt.Println("Hello World")
}
shammas@shamm ~/tmp/helloworld % go build -o goout -ldflags "-s" hw.go
shammas@shamm ~/tmp/helloworld % ls -lhva goout
-rwxr-xr-x 1 shammas shammas 996K Aug 24 20:12 goout
shammas@shamm ~/tmp/helloworld % cat hw.cpp
#include <iostream>
using namespace std;
int main() {
cout << "Hello World";
}
shammas@shamm ~/tmp/helloworld % g++ -o cppout -static -Os -s hw.cpp
shammas@shamm ~/tmp/helloworld % ls -lhva cppout
-rwxr-xr-x 1 shammas shammas 1.6M Aug 24 20:12 cppout
shammas@shamm ~/tmp/helloworld %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment