On Ned Nov 20 16:58:59 2016, VAL wrote:
Show quoted text> On Sun Nov 20 15:46:03 2016, PALI wrote:
> > On Ned Nov 20 15:23:04 2016, VAL wrote:
> > > I was blaming Makefile.PL too.
> > >
> > > C:\Users\val>mysql_config --libs
> > > "C:\soft\mariadb/lib/mysqlclient.lib" "wsock32.lib" "advapi32.lib"
> > > "user32.lib"
> >
> > First one is OK, it is file specified with full path without any
> > leading hyphen. gcc and gnu linker can handle it.
> >
> > But I doubt that other 3 files can be located properly with gcc or
> > gnu
> > linker, as it can search for libraries only with -l param (in this
> > case without "lib" prefix and ".lib" or ".a" suffix).
>
> Found
> G:\soft\mingw64\x86_64-w64-mingw32\lib\libwsock32.a
> G:\soft\mingw64\x86_64-w64-mingw32\lib\libadvapi32.a
> G:\soft\mingw64\x86_64-w64-mingw32\lib\libuser32.a
>
>
> > Which compiler and linker are you using for compiling DBD::mysql?
>
> x86_64-4.9.0-release-win32-seh-rt_v3-rev2.7z
So you are using gcc from 64bit mingw. In this case make sure that your libmysqlclient is also 64bit!
Show quoted text> > Looks like my patch really fix problem with determinating if output
> > from mysql_config --libs is library (either specified by -l syntax or
> > by full path) or ordinary flag. Now there are problems with undefined
> > references to internal windows symbols which are probably in those
> > not
> > found libraries...
>
> > If you want to compile DBD::mysql I would suggest you to manually
> > play
> > with "perl Makefile.PL --libs=...". And specify all needed libs
> > (ideally with full path). Maybe you need to link against some other
> > windows libraries... But I do not know, I do not use windows system.
>
> What's the syntax for few args for --libs?
> --libs="c:/full/path/lib1" --libs="c:/another/lib2"
> or
> --libs="c:/full/path/lib1 c:/another/lib2" ?
>
> is there a way to define few paths to lib dirs and provide to --libs
> only filenames (without common path)?
IIRC syntax is space separated arguments passed to gcc when linking. When specifying more libs do not forget to properly quote (and espace) params which is needed on windows.
If you have a library with full path G:\soft\mingw64\x86_64-w64-mingw32\lib\libwsock32.a then you can tell gcc to use it as:
-LG:\soft\mingw64\x86_64-w64-mingw32\lib -lwsock32
or
G:\soft\mingw64\x86_64-w64-mingw32\lib\libwsock32.a
(maybe backslash needs to be escaped... \ will probably be \\, but I'm not sure)
libsomething.a is specified by -lsomething
If you have more libraries in some path, then you just need to specify -Lpath only once.
try: --libs="\"C:\\soft\\mariadb/lib/mysqlclient.lib\" -L\"G:\\soft\\mingw64\\x86_64-w64-mingw32\\lib\" "-lwsock32" "-ladvapi32" "-luser32"
(and play with escaping with \ and quoting with ")
Show quoted text> I'm just surprised that with same perl, build system it's possible to
> compile DBD::mysql against mysql, but not mariadb. And even
> mysql_config.pl in mariadb needs small fix to get it working at all
> (in sub get_full_path).
If you have exactly same build system, then problem is only in mysql_config application. That one (which comes from either mysql or mariadb) is responsible for telling DBD::mysql where to find libmysqlclient and which flags needs to be passed to compiler and linker. Maybe you should report this problem to mariadb if with mysql you do not have any problem.