title: link static library with headers with Green Hills compiler
body: <p>I have a static library .a with several header files provided. I want to link it with .o files into binary using Green hills compiler.
  The error I get is:</p>
  
  <blockquote>
    <p><strong>[elxr] (error #412) unresolved symbols.</strong></p>
  </blockquote>
  
  <p>I am trying to specify path to header files providing <code>-I filepath</code> to linker.</p>
  
  <p>However, this does not seem to work.</p>
  
  <p>Updated with code.</p>
  
  <pre><code># Recipe for linking
  __GHSRH850_ERRALL += $(__GHSRH850_TARGETERR)
  GHSRH850_LIB = SRC\MCU\DROME\RGL\libd1mx_rh850_ghs.a
  $(GHSRH850_TARGETEMU): $(__GHSRH850_OBJS) $(GHSRH850_LSCRIPT) $(GHSRH850_LIB) \
                        $(CORE_MAKPREREQS) | __GHSRH850_DIRS
      $(call CORE_REPORTFILE,Linking,$(@F))
      $(eval __GHSRH850_ERRDONE += $(__GHSRH850_TARGETERR))
      $(GHSRH850_LD)                       \
         $(GHSRH850_LSCRIPT)                                                            \
         -o $@                                                                          \
         $(GHSRH850_LIB)                                                  \
         $(__GHSRH850_OBJS)                                                            \
         $(GHSRH850_LFLAGS)                                                             \
         &gt; $(__GHSRH850_TARGETERR)
  </code></pre>
  
  <p>The make file is quite huge, so I cannot put all of it here. Basically library is added with:</p>
  
  <p><code>GHSRH850_LIB = file\path\to\libname.a</code></p>
  
  <p>In flags added filepath to headers with:</p>
  
  <p><code>GHSRH850_LFLAGS += -I file\path\to\headers</code></p>
  
  <p>Other descriptions are:</p>
  
  <p><code>GHSRH850_LFLAGS</code>           - Linker flags</p>
  
  <p><code>GHSRH850_LSCRIPT</code>          - Linker script file</p>
  
  <p><code>__GHSRH850_OBJS</code>           - Object files list</p>
  
  <p>Compiler that is used ccrh850.exe.</p>
  
  <p>Error code:</p>
  
  <pre><code>[elxr] (error #412) unresolved symbols: 35
  _R_UTIL_DHD_Init    from drglgmm_dhd.o
  _R_UTIL_DHD_Config  from drglgmm_dhd.o
  _R_DEV_SQRTF    from libd1mx_rh850_ghs.a(r_drw2d_main.o)
  _R_VDCE_Sys_HsyncActLevelSet    from libd1mx_rh850_ghs.a(r_vdce_api.o)
  </code></pre>