Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Would you, please, add DLL too? #3

Closed
vhanla opened this issue Aug 15, 2016 · 5 comments
Closed

Would you, please, add DLL too? #3

vhanla opened this issue Aug 15, 2016 · 5 comments
Labels

Comments

@vhanla
Copy link

vhanla commented Aug 15, 2016

Since I can't compile myself with Mingw64 showing up many unknown errors, different versions, no make neither configure files for c-ares, etc. and of course not knowing if the resultant executable or DLL is correct, since I got a 150MB executable after many attempts, I rather ask you, if would you mind adding it along the executables?.

@vhanla
Copy link
Author

vhanla commented Aug 16, 2016

After following your mingw-config bash, I could build correctly the executable, but I wasn't able to build a DLL file, it only linked to a very tiny unusable executable, I also patched the Make.am file as suggested here aria2/aria2#707

I used the following configure variation

./configure \
    --host=$HOST \
    --prefix=$PREFIX \
    --without-included-gettext \
    --disable-nls \
    --with-libcares \
    --without-gnutls \
    --without-wintls \
    --with-openssl \
    --with-sqlite3 \
    --without-libxml2 \
    --with-libexpat \
    --with-libz \
    --without-libgmp \
    --with-libssh2 \
    --without-libgcrypt \
    --without-libnettle \
    --with-cppunit-prefix=$PREFIX \
    --enable-libaria2 \
    --enable-static \
    CPPFLAGS="-I$PREFIX/include" \
    LDFLAGS="-L$PREFIX/lib" \
    PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"

Everything was fine until it reached the linking time

*** Warning: This system cannot link to static lib archive /usr/i686-w64-mingw32/lib/libssh2.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: linker path does not have real file for library -lz.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libz and none of the candidates passed a file format test
*** using a file magic. Last file checked: /usr/i686-w64-mingw32/lib/libz.a
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.
  CXXLD    aria2c.exe

So I suppose it is needed to build the external libraries as DLL, isn't it?
So I tried to build libz as shared lib, but I couldn't accomplish either, raises error on LD which couldn't find -lc if I try to build without the --static parameter

I apologize in advance if I'm not following correctly the building instructions in documentation, but I'm new to this.

I wan't to use libaria2 within a C++ program using the API, but I guess I have to rely on the executable as RPC maybe.

@q3aql
Copy link
Owner

q3aql commented Aug 16, 2016

@vhanla Answering your questions:

  • My mingw-config is for cross-compile aria2 (static) from GNU/Linux to Windows. I use Crunchbang++ (Debian). What is your OS?
  • If the size of your executable binary is 150MB, is because need to be stripped ($ strip --strip-all <executable>)
  • My builds are static builds of aria2 (the libraries "DLL" are within/linked in the executable). Do you want a shared build of aria2 or only aria2 with libaria2?.

@vhanla
Copy link
Author

vhanla commented Aug 16, 2016

Thanks for your answer, I could finally build it using your mingw-config as guide, I also built the examples to use with DLL. And strip reduced it as needed. BTW. I'm using LSW (Linux Subsystem for Windows) on Windows 10 1607. Thanks again.

@vhanla vhanla closed this as completed Aug 16, 2016
@q3aql
Copy link
Owner

q3aql commented Aug 16, 2016

@vhanla Perfect! xD

@q3aql q3aql added the question label Oct 16, 2016
@RedHairSakuragiHanamichi

After following your mingw-config bash, I could build correctly the executable, but I wasn't able to build a DLL file, it only linked to a very tiny unusable executable, I also patched the Make.am file as suggested here aria2/aria2#707

I used the following configure variation

./configure \
    --host=$HOST \
    --prefix=$PREFIX \
    --without-included-gettext \
    --disable-nls \
    --with-libcares \
    --without-gnutls \
    --without-wintls \
    --with-openssl \
    --with-sqlite3 \
    --without-libxml2 \
    --with-libexpat \
    --with-libz \
    --without-libgmp \
    --with-libssh2 \
    --without-libgcrypt \
    --without-libnettle \
    --with-cppunit-prefix=$PREFIX \
    --enable-libaria2 \
    --enable-static \
    CPPFLAGS="-I$PREFIX/include" \
    LDFLAGS="-L$PREFIX/lib" \
    PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"

Everything was fine until it reached the linking time

*** Warning: This system cannot link to static lib archive /usr/i686-w64-mingw32/lib/libssh2.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: linker path does not have real file for library -lz.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libz and none of the candidates passed a file format test
*** using a file magic. Last file checked: /usr/i686-w64-mingw32/lib/libz.a
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.
  CXXLD    aria2c.exe

So I suppose it is needed to build the external libraries as DLL, isn't it? So I tried to build libz as shared lib, but I couldn't accomplish either, raises error on LD which couldn't find -lc if I try to build without the --static parameter

I apologize in advance if I'm not following correctly the building instructions in documentation, but I'm new to this.

I wan't to use libaria2 within a C++ program using the API, but I guess I have to rely on the executable as RPC maybe.

I got the same prolbem with you on ubuntu with i686-w64-mingw32.
*** Warning: This system cannot link to static lib archive /usr/i686-w64-mingw32/lib/libssh2.la.
Have do you fix it? What should I to do?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants