如何将linux下的.a库转到windows下.lib库

使用MINGW\bin\dlltool.exe重新编译。
这里,dlltool是用于生成def,exp,lib文件的工具. 它可以基于obj文件(基中函数标记为__declspec(dllexport))或def文件生成exp和lib文件.
exp文件,(其中包含了.edata段)是用于创建dll; lib文件,(包含.idata段)用于使用dll

$ dlltool --help
Usage E:\MINGW\bin\dlltool.exe  
   -m --machine     Create as DLL for .  [default: i386]
        possible : arm[_interwork], i386, mcore[-elf]{-le|-be}, ppc, thumb
   -e --output-exp  Generate an export file.
   -l --output-lib  Generate an interface library.
   -a --add-indirect         Add dll indirects to export file.
   -D --dllname        Name of input dll to put into interface lib.
   -d --input-def   Name of .def file to be read in.
   -z --output-def  Name of .def file to be created.
      --export-all-symbols   Export all symbols to .def
      --no-export-all-symbols  Only export listed symbols
      --exclude-symbols  Don't export 
      --no-default-excludes  Clear default exclude symbols
   -b --base-file  Read linker generated base file.
   -x --no-idata4            Don't generate idata$4 section.
   -c --no-idata5            Don't generate idata$5 section.
   -U --add-underscore       Add underscores to symbols in interface library.
   -k --kill-at              Kill @ from exported names.
   -A --add-stdcall-alias    Add aliases without @.
   -p --ext-prefix-alias  Add aliases with .
   -S --as             Use  for assembler.
   -f --as-flags      Pass  to the assembler.
   -C --compat-implib        Create backward compatible import library.
   -n --no-delete            Keep temp files (repeat for extra preservation).
   -t --temp-prefix  Use  to construct temp file names.
   -v --verbose              Be verbose.
   -V --version              Display the program version.
   -h --help                 Display this information.

使用gcc -shared创建dll,也是一个实验的好基础:
http://www.adp-gmbh.ch/win/misc/mingw/dll.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

生活在西班牙

自己动手丰衣足食

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

我的心情魔方

天才遠私廚

希望能做一個分享各種資訊的好地方

语义噪声

西瓜大丸子汤的博客

笑对人生,傲立寰宇

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: