digitalmars.D - How to link *.a file on Windows?
- Brian (3/3) Sep 22 2016 I use cygwin build a C++ lib file:
- Basile B. (4/7) Sep 22 2016 should be a .lib under windows. *.a is an archive of object files
- kinke (6/9) Sep 22 2016 You'd probably need to use the GNU linker then, but the D objects
- Mike Parker (5/8) Sep 22 2016 I don't know of any D compiler that supports Cygwin. There are
- Brian (9/12) Sep 22 2016 My plan:
- Basile B. (4/5) Sep 23 2016 Just pass the filename to the compiler as if it's a ".d" source
- Mike Parker (9/23) Sep 23 2016 With dub, you can use the the 'libs' directive in your
I use cygwin build a C++ lib file: libmemcached.a but, how to link it to my dub project?
Sep 22 2016
On Thursday, 22 September 2016 at 17:09:38 UTC, Brian wrote:I use cygwin build a C++ lib file: libmemcached.a but, how to link it to my dub project?should be a .lib under windows. *.a is an archive of object files (aka a static library) for Posix systems. *.lib is the same but for Windows.
Sep 22 2016
On Thursday, 22 September 2016 at 17:09:38 UTC, Brian wrote:I use cygwin build a C++ lib file: libmemcached.a but, how to link it to my dub project?You'd probably need to use the GNU linker then, but the D objects would need to match the format used for your C++ lib. You could give the GDC compiler a shot, or use clang to compile the C++ lib to MS COFF format (.lib), which can then be fed to both DMD and LDC on Windows.
Sep 22 2016
On Thursday, 22 September 2016 at 17:09:38 UTC, Brian wrote:I use cygwin build a C++ lib file: libmemcached.a but, how to link it to my dub project?I don't know of any D compiler that supports Cygwin. There are older releases of LDC built on top of MinGW and GDC has had some releases for Windows, but I don't believe you'd be able to use anything generated by the Cygwin toolchain with those.
Sep 22 2016
On Thursday, 22 September 2016 at 17:09:38 UTC, Brian wrote:I use cygwin build a C++ lib file: libmemcached.a but, how to link it to my dub project?My plan: 1.I use cygwin build libmemcached.dll 2.use def tools export libmemcached.def 3.use VS2015 dev tools convert libmemcached.dll to libmemcached.lib 4.use coffimplib convert libmemcached.lib for D compiler but, this plan must dep dll file. how to static link libmemcached.lib?
Sep 22 2016
On Friday, 23 September 2016 at 06:27:20 UTC, Brian wrote:how to static link libmemcached.lib?Just pass the filename to the compiler as if it's a ".d" source and put the path to the sources root with -I dmd app.d libmemcached.lib -Ipath/to/memcached/interface/
Sep 23 2016
On Friday, 23 September 2016 at 06:27:20 UTC, Brian wrote:On Thursday, 22 September 2016 at 17:09:38 UTC, Brian wrote:With dub, you can use the the 'libs' directive in your configuration file. See the Build Settings section a [1] if you are using JSON and [2] for SDL. If you manage to get your Cygwin-compiled libs to work with DMD successfully with this approach, please let us know. I was unable to get anything more than simple C libraries compiled by MinGW to work with DMD. [1] https://code.dlang.org/package-format?lang=json#build-settings [2] https://code.dlang.org/package-format?lang=sdl#build-settingsI use cygwin build a C++ lib file: libmemcached.a but, how to link it to my dub project?My plan: 1.I use cygwin build libmemcached.dll 2.use def tools export libmemcached.def 3.use VS2015 dev tools convert libmemcached.dll to libmemcached.lib 4.use coffimplib convert libmemcached.lib for D compiler but, this plan must dep dll file. how to static link libmemcached.lib?
Sep 23 2016