Skip to content

Instantly share code, notes, and snippets.

@Keith-S-Thompson
Last active December 16, 2015 09:59
Show Gist options
  • Save Keith-S-Thompson/5416640 to your computer and use it in GitHub Desktop.
Save Keith-S-Thompson/5416640 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "% g++ --version"
g++ --version
echo "% head foo.h bar.h c.cpp"
head foo.h bar.h c.cpp
echo "% g++ -c c.cpp"
g++ -c c.cpp
% g++ --version
g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% head foo.h bar.h c.cpp
==> foo.h <==
extern void func()
==> bar.h <==
// ;
==> c.cpp <==
#include "foo.h"
#include "bar.h"
int main() {
func();
}
% g++ -c c.cpp
c.cpp:3:1: error: expected initializer before ‘int’
#include "foo.h"
#include "bar.h"
int main() {
func();
}
extern void func()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment