title: C++ Compilation Issue - Undefined symbols for architecture x86_64 - Mac Os X Mountain Lion
body: <p>I'm having a compilation issue which I'm unable to solve. I'm developing a cross platform C++ project coding on both Mac Os X 10.8 and Windows. The code compiles and run fine on Windows and on Mac Os X Leopard as well.</p>
  
  <p>Since Apple pushes the developers to stick to the latest platform for various reasons I'm forced to develop on Mountain Lion and I'm trying to get the project to work again.</p>
  
  <p>I compiled correctly all the libraries I needed (wxWidgets, etc) and I imported the project in the latest version of Eclipse. When I try to build the project it tries to compile the firts .cpp file and at the end it (why?) tries to invoke the linker resulting on a series of missing symbols for my own defined classes. None of the other .cpp files is being compiled, so it's pretty understendable why the whole process is failing.</p>
  
  <p>I also tried to invoke make from CLI, with the same result. I went into the makefile and everything seems correct. It looks like a very newbie issue, I feel I'm missing something huge here.</p>
  
  <p>I'm pasting below the output of the compiler, just in case some compiling guru step in. Please feel free to ask for more details.</p>
  
  <h2>Compiler output</h2>
  
  <p>Pastebin Link: <a href="http://pastebin.com/6a06EyyC" rel="nofollow">Compiler output</a></p>
  
  <p>I used PB since the output is quite large.</p>
  
  <p>The relevant section are the invocation of <em>as</em> and <em>collect2</em> soon after the compiling phase of the very first .cpp file. The missing symbols are defined in other .cpp files in the same dir.</p>
  
  <pre><code>/usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin11/4.2.1/as -arch x86_64 -force_cpusubtype_ALL -o /var/folders/br/h6ln_j014ll56zwc8x6xjmk80000gn/T//ccSUmHal.o /var/folders/br/h6ln_j014ll56zwc8x6xjmk80000gn/T//ccn8ex81.s
  
  /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin11/4.2.1/collect2 -dynamic -arch x86_64 -macosx_version_min 10.8.3 -weak_reference_mismatches non-weak -o Calcoli.o -lcrt1.10.6.o -L/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/x86_64 -L/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/x86_64 -L/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1 -L/usr/llvm-gcc-4.2/bin/../lib/gcc -L/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1 -L/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/../../.. -L/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/../../.. /var/folders/br/h6ln_j014ll56zwc8x6xjmk80000gn/T//ccSUmHal.o -lstdc++ -lSystem -lgcc -lSystem
  </code></pre>
  
  <p>The compiler output ends with the "classic" undefined symbol issue. All <em>emphasized text</em>*emphasized text*<em>emphasized text</em></p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "typeinfo for TipoPuntoCalc", referenced from:
        Calcoli::setPuntoS(GTGraphicObject*)      in ccSUmHal.o
    "typeinfo for TipoPali", referenced from:
        Calcoli::setPaloS(GTGraphicObject*)      in ccSUmHal.o
    "typeinfo for TipoRett", referenced from:
        Calcoli::setFondazioneS(GTGraphicObject*)       in ccSUmHal.o
    "_main", referenced from:
        start in crt1.10.6.o
  ld: symbol(s) not found for architecture x86_64
  collect2: ld returned 1 exit status
  make: *** [Calcoli.o] Error 1
  </code></pre>
  
  <p>This shouldn't be an architecture related issue, since specifing i386 as target has the same result (symbol(s) not found for architecture i386).</p>
  
  <p>Thank you,</p>
  
  <p>Evelina</p>