title: Undefined reference but (dynamic) library is linked. (possibly bad reloc address error)
body: <p>I've been trying to compile OpenVDB on window, but I have a type of error that I have not encountered before</p>
  
  <p>Here is the command (generated by cmake and make) which causes an error:</p>
  
  <pre><code>C:\mingw\bin\g++.exe     -shared -o libopenvdb.dll -Wl,--out-implib,libopenvdb.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles\openvdb.dir/objects.a -Wl,--no-whole-archive  -LC:\mingw\install C:\mingw\install\lib\Half.lib C:\mingw\install\lib\libzlib.dll -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 
  CMakeFiles\openvdb.dir/objects.a(Grid.cc.obj):Grid.cc:(.text$_ZN4halfC2Ef[__ZN4halfC2Ef]+0x70): undefined reference to `half::_eLut'
  CMakeFiles\openvdb.dir/objects.a(Grid.cc.obj):Grid.cc:(.text$_ZN4halfC2Ef[__ZN4halfC2Ef]+0xb5): undefined reference to `half::convert(int)'
  c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.3/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles\openvdb.dir/objects.a(Grid.cc.obj): bad reloc address 0xb5 in section `.text$_ZN4halfC2Ef[__ZN4halfC2Ef]'
  </code></pre>
  
  <p>Undefined reference but Half.lib is being linked.</p>
  
  <p>I ran dumpbin on the lib file to check if the missing items were present and they are indeed there: <a href="http://pastebin.com/6JjhGyky" rel="nofollow">http://pastebin.com/6JjhGyky</a></p>
  
  <p>I tried looking at the other stack overflow posts and googled issues with similar description but they do not seem sufficiently relevant to my problem to be of help.</p>
  
  <p>I'm not sure if I've seen the "bad realoc address" error before, which may be the key to my problem, but googling has provided me little understanding of what exactly it means.</p>
  
  <p>Any suggestions to where my problem might lie is appreciated!</p>