c++ - Creating correct D3D11 library file for GCC -
c++ - Creating correct D3D11 library file for GCC -
what right way convert files d3d11.lib provided in directx sdk *.a gcc library format? i've tried mutual reimp method converting *.lib files *.a files, doesn't seem work.
step 1 involves creating definitions file:
bin\reimp -d d3d11.lib
let's want utilize d3d11createdevice function should provided in library. if open created definitions file seems ok:
library "d3d11.dll" exports (...) d3d11createdevice d3d11createdeviceandswapchain (...)
next seek create *.a file using definitions file , original lib file:
bin\dlltool -v -d d3d11.def -l libd3d11.a
this in fact produce valid library (and no error messages when dlltool set verbose), if seek utilize function d3d11createdevice should implemented in it, error:
undefined reference `d3d11createdevice'
if inquire nm symbol nowadays in library (and filter using grep), this:
d:\tools\lib2a>bin\nm libd3d11.a | grep d3d11createdevice file stdin: 00000000 __imp__d3d11createdeviceandswapchain 00000000 t _d3d11createdeviceandswapchain 00000000 __imp__d3d11createdevice 00000000 t _d3d11createdevice
the imp function function calls actual implementation of d3d11createdevice within dll. however, actual implementation prefixed underscore.
why "_d3d11createdevice" defined while "d3d11createdevice" not though mentioned in definitions file?
just do:
copy d3d11.lib libd3d11.a
alternatively utilize x:\path\to\d3d11.lib
on gcc command line instead of -ld3d11
. gnu utilities on windows utilize same pecoff archive format microsoft's tools use.
c++ gcc directx-11
Comments
Post a Comment