title: Undefined reference to C++ variables in ASM code
body: <p>I'm trying to compile following asm code inside a C++ file, but it like GCC can't find the variables used in the asm part.</p>
  
  <pre><code>DWORD d_eaxSave, d_ebxSave, d_ecxSave, d_edxSave, d_esiSave, d_ediSave, d_espSave, d_ebpSave;
  
  #define ASM_UNPREFIXED_INTEL_START ".intel_syntax noprefix\n\t"
  #define SAVE_REGISTERS() __asm__ (ASM_UNPREFIXED_INTEL_START    \
                                "mov d_eaxSave, eax\n\t"      \
                                "mov d_ebxSave, ebx\n\t"      \
                                "mov d_ecxSave, ecx\n\t"      \
                                "mov d_edxSave, edx\n\t"      \
                                "mov d_esiSave, esi\n\t"      \
                                "mov d_ediSave, edi\n\t"      \
                                "mov d_espSave, esp\n\t"      \
                                "mov d_ebpSave, ebp");
  </code></pre>
  
  <p>But when I try to compile, GCC gives me the following errors :</p>
  
  <pre><code>undefined reference to `d_eaxSave'
  undefined reference to `d_ebxSave'
  undefined reference to `d_ecxSave'
  undefined reference to `d_edxSave'
  undefined reference to `d_esiSave'
  undefined reference to `d_ediSave'
  undefined reference to `d_espSave'
  undefined reference to `d_ebpSave'
  </code></pre>
  
  <p>What can I do to get rid of those erros, please ?</p>