title: Code compiles in Xcode but not from Command Line
body: <p>So I have a mini OpenGL project that I am doing in C++ in Xcode.  I am using several libraries including the SOIL and GLEW libraries, their respective header files, and the SDL2, OpenGL, and Corefoundation frameworks.  The project builds just fine in Xcode with the following compiler options: C++ Language Dialect set to -std=c++11 and C++ Standard Library set to libc++.  However, when I try to build this project with clang on the command line, with the following command:</p>
  
  <pre><code>clang++ -stdlib=libc++ -std=c++11
  -I/usr/local/include/SOIL/src 
  -I/usr/local/include/glm/glm
  -I/usr/local/include/glew-1.10.0/include/ 
  -framework SDL2
  -framework CoreFoundation
  -framework OpenGL 
  -L/usr/local/include/glew-1.10.0/lib/ 
  -L/usr/local/lib 
  main.cpp euchre.cpp euchre.h (These 3 files are in the same directory)
  </code></pre>
  
  <p>I get the following errors:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
  "_SOIL_free_image_data", referenced from:
    Euchre::MakeObject::LoadTexture(char const*, int) in euchre-d6b330.o
  "_SOIL_load_image", referenced from:
    Euchre::MakeObject::LoadTexture(char const*, int) in euchre-d6b330.o
  "___glewActiveTexture", referenced from:
    Euchre::MakeObject::LoadTexture(char const*, int) in euchre-d6b330.o
  "___glewAttachShader", referenced from:
    Euchre::MakeObject::LoadShaders(char const*, char const*) in euchre-d6b330.o
  "___glewBindBuffer", referenced from:
    Euchre::MakeObject::makeAttribute(unsigned int, char const*, unsigned int, unsigned int, int, unsigned int, unsigned char, int, void const*) in euchre-d6b330.o
    unsigned int Euchre::MakeObject::makeBufferObject&lt;float&gt;(int, unsigned int, unsigned int, std::__1::vector&lt;float, std::__1::allocator&lt;float&gt; &gt;) in euchre-d6b330.o
    unsigned int Euchre::MakeObject::makeBufferObject&lt;unsigned int&gt;(int, unsigned int, unsigned int, std::__1::vector&lt;unsigned int, std::__1::allocator&lt;unsigned int&gt; &gt;) in euchre-d6b330.o
  "___glewBindVertexArray", referenced from:
    _main in main-6799fc.o
  "___glewBufferData", referenced from:
    unsigned int Euchre::MakeObject::makeBufferObject&lt;float&gt;(int, unsigned int, unsigned int, std::__1::vector&lt;float, std::__1::allocator&lt;float&gt; &gt;) in euchre-d6b330.o
    unsigned int Euchre::MakeObject::makeBufferObject&lt;unsigned int&gt;(int, unsigned int, unsigned int, std::__1::vector&lt;unsigned int, std::__1::allocator&lt;unsigned int&gt; &gt;) in euchre-d6b330.o
  "___glewCompileShader", referenced from:
    Euchre::MakeObject::compileShader(unsigned int, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;) in euchre-d6b330.o
  "___glewCreateProgram", referenced from:
    Euchre::MakeObject::LoadShaders(char const*, char const*) in euchre-d6b330.o
  "___glewCreateShader", referenced from:
    Euchre::MakeObject::LoadShaders(char const*, char const*) in euchre-d6b330.o
  "___glewDeleteBuffers", referenced from:
    _main in main-6799fc.o
  "___glewDeleteProgram", referenced from:
    _main in main-6799fc.o
  "___glewDeleteShader", referenced from:
    Euchre::MakeObject::LoadShaders(char const*, char const*) in euchre-d6b330.o
  "___glewDeleteVertexArrays", referenced from:
    _main in main-6799fc.o
  "___glewEnableVertexAttribArray", referenced from:
    Euchre::MakeObject::makeAttribute(unsigned int, char const*, unsigned int, unsigned int, int, unsigned int, unsigned char, int, void const*) in euchre-d6b330.o
  "___glewGenBuffers", referenced from:
    unsigned int Euchre::MakeObject::makeBufferObject&lt;float&gt;(int, unsigned int, unsigned int, std::__1::vector&lt;float, std::__1::allocator&lt;float&gt; &gt;) in euchre-d6b330.o
    unsigned int Euchre::MakeObject::makeBufferObject&lt;unsigned int&gt;(int, unsigned int, unsigned int, std::__1::vector&lt;unsigned int, std::__1::allocator&lt;unsigned int&gt; &gt;) in euchre-d6b330.o
  "___glewGenVertexArrays", referenced from:
    Euchre::MakeObject::makeVertexArrayObject(int) in euchre-d6b330.o
  "___glewGetAttribLocation", referenced from:
    Euchre::MakeObject::makeAttribute(unsigned int, char const*, unsigned int, unsigned int, int, unsigned int, unsigned char, int, void const*) in euchre-d6b330.o
  "___glewGetShaderiv", referenced from:
    Euchre::MakeObject::compileShader(unsigned int, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;) in euchre-d6b330.o
  "___glewLinkProgram", referenced from:
    Euchre::MakeObject::LoadShaders(char const*, char const*) in euchre-d6b330.o
  "___glewShaderSource", referenced from:
    Euchre::MakeObject::compileShader(unsigned int, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;) in euchre-d6b330.o
  "___glewUseProgram", referenced from:
    _main in main-6799fc.o
  "___glewVertexAttribPointer", referenced from:
    Euchre::MakeObject::makeAttribute(unsigned int, char const*, unsigned int, unsigned int, int, unsigned int, unsigned char, int, void const*) in euchre-d6b330.o
  "_glewExperimental", referenced from:
    _main in main-6799fc.o
  "_glewInit", referenced from:
    _main in main-6799fc.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>What I don't understand is how I am compiling with the same settings as on Xcode, but in terminal, I can't get this to work.</p>