0

I'm trying to compile .dll of this project on windows using MinGW. Everything goes ok except one point: output is the .exe file - not .dll.

Here is the notification, that libtool gave me:

*** 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.

Well, I've not found anywhere in project option -no-undefined and that's why I wonder what symbols(and how??) should be fixed to get needed .dll?

Maybe there are some issues with linker? I dont know where to change($LIBRARY_PATH = /c/mingw already) it and that's why during make this warning pops up:

*** 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: c:/Strawberry/c/bin/../lib/gcc/x86_64
-w64-mingw32/4.8.3/../../..//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.
im_infamous
  • 327
  • 1
  • 3
  • 17

2 Answers2

0

Looks like your program need zlib, but c:/Strawberry/c/bin/../lib/gcc/x86_64 -w64-mingw32/4.8.3/../../..//libz.a is not valid (different target architecture - x86 vs x86_64?). You need to get a real zlib, compile for the same architecture and point your program to it.

vitalyster
  • 4,980
  • 3
  • 19
  • 27
0

you can use a .cmd file with following content

::source code file path
set src_path=source.cpp

::output file path

set bin_path=yourlib.dll

::library you need

set libs=-lmingw32 -lkernel32 -lshell32 -luser32 -lwsock32 -lws2_32 -lole32 -loleaut32

::windows subsystem

set sub_sys=-mwindows

::cpp version used by g++

set cpp_ver=-std=c++1y

::jump to g++ path

cd "%your_mingw32_folder_path%\bin\"

::run g++ with args

g++.exe "%src_path%" -o "%bin_path%" -Wall -W -w -static %sub_sys% %libs% %cpp_ver%


pause
umläute
  • 28,885
  • 9
  • 68
  • 122
Pedramphhi
  • 19
  • 2