-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installation fails on Msys2 / Windows 10 system due to libconfig.h not found #6
Comments
I will quickly add, I also tried using CPAN. bill.e.ghote@COMPUTER MSYS /c/Users/bill.e.ghote/Malware/source/repos/Conf-Libconfig bill.e.ghote@COMPUTER MSYS /c/Users/bill.e.ghote/Malware/source/repos/Conf-Libconfig |
I laboriously stepped through the code using Perl in debug mode, and have isolated the underlying problem. For whatever (yet for me to determine) reason, Msys2 environment does not like the includes that are pulled in by the test .c program. When I execute the same test gcc compile from a Cygwin terminal, all works as it should. So, this is specific to my (and perhaps every) Msys2 environment. I will dig further and attempt to resolve it. Thanks for tolerating. |
I think you can try to edit eval {
@inc_paths = map {s/-I//; $_} split(' ', ExtUtils::PkgConfig->cflags_only_I('libconfig'));
@lib_paths = map {s/-L//; $_} split(' ', ExtUtils::PkgConfig->libs_only_L('libconfig'));
}; like this: push @inc_paths, '-I/usr/local/include';
push @lib_paths, '-L/usr/local/lib'; Usually, you can get |
TL;DR: In my default Msys2 shell started with "C:\Users\USER\msys64\msys2_shell.cmd", the underlying call to test compile is (for this instance - the filenames are dynamically generated, as you know): This fails with errors such as: What is frustrating about this situation is that compiling the test C file without any includes works just fine. ... moving on... If I start Msys2 shell with: ... and then compile as one would do normally, everything works as expected: $ perl Makefile.PL
Bottom line: My own inexperience with Msys2 led to this "issue." Apologies for the noise, but perhaps this will help someone down the road. |
PS: To actually make the build with the resulting Makefile, I had to switch shells another time (back to msys shell), otherwise gcc could not load sys/wait.h. This is apparently a known issue, as Google pointed me to: msys2/MSYS2-packages#1086 |
Also, I think you meant: ...as otherwise I wind up with -I-I/usr/local/include in the internal call to gcc, the test compile fails for all Msys2 shells, even. |
So, I guess I'll just add this comment here. I thought everything had built correctly, but at run-time it's bombing with a segmentation fault. Here's my debug output. Any ideas? $ perl -d ./conf2struct eg_conf.cfg | tee -a trace.out Loading DB routines from perl5db.pl version 1.73 Enter h or 'h h' for help, or 'man perldebug' for more help. main::(./conf2struct:3): my $license = <<EOF; ...of course we could continue to step through it but that call to Carp means it's already dead, obviously. But, why? |
I think you should use 'n' for the next step, if you are familiar with gdb, 'c' means continue until the end of the program. |
I installed libconfig using pacman, I installed it again using sources taken from https://github.com/hyperrealm/libconfig. I've tried using symbolic links to the installed libconfig.h in the core, site, and vendor lib/share folders, and I've following your instructions with regard to passing the include path on the make command line, I even tried using Devel::Trace module to attempt to debug it but admit defeat there - I'm not knowledgeable enough in Perl. Nothing works for me - it is always the same error.
Can you offer some guidance?
bill.e.ghote@COMPUTER MSYS /c/Users/bill.e.ghote/Malware/source/repos/Conf-Libconfig
$ perl Makefile.PL LIBS=-L/usr/local/lib INC=-I/usr/local/include 2>&1 | tee -a err
Can't link/include 'libconfig.h', 'config'
bill.e.ghote@COMPUTER MSYS /c/Users/bill.e.ghote/Malware/source/repos/Conf-Libconfig
$ ls /usr/local/lib/libconfig*
/usr/local/lib/libconfig++.dll.a /usr/local/lib/libconfig.dll.a
bill.e.ghote@COMPUTER MSYS /c/Users/bill.e.ghote/Malware/source/repos/Conf-Libconfig
$ ls /usr/local/include/libconfig*
/usr/local/include/libconfig.h /usr/local/include/libconfig.h++ /usr/local/include/libconfig.hh
bill.e.ghote@COMPUTER MSYS /c/Users/bill.e.ghote/Malware/source/repos/Conf-Libconfig
$ perl -V
Summary of my perl5 (revision 5 version 36 subversion 0) configuration:
Platform:
osname=msys
osvers=3.3.6-341.x86_64
archname=x86_64-msys-thread-multi
uname='msys_nt-10.0-20348 fv-az449-938 3.3.6-341.x86_64 2022-10-24 08:25 utc x86_64 msys '
config_args='-des -Dusethreads -Doptimize=-march=x86-64 -mtune=generic -O2 -pipe -Dprefix=/usr -Dvendorprefix=/usr -Dprivlib=/usr/share/perl5/core_perl -Darchlib=/usr/lib/perl5/core_perl -Dsitelib=/usr/share/perl5/site_perl -Dsitearch=/usr/lib/perl5/site_perl -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib/perl5/vendor_perl -Dscriptdir=/usr/bin/core_perl -Dsitescript=/usr/bin/site_perl -Dvendorscript=/usr/bin/vendor_perl -Dinc_version_list=none -Dman1ext=1perl -Dman3ext=3perl -Darchname=-msys-threads -Dmyarchname=-msys -Dlibperl=msys-perl5_36.dll -Dcc=gcc -Dld=g++ -Accflags=-march=x86-64 -mtune=generic -O2 -pipe -fwrapv'
hint=recommended
useposix=true
d_sigaction=define
useithreads=define
usemultiplicity=define
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
Compiler:
cc='gcc'
ccflags ='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -march=x86-64 -mtune=generic -O2 -pipe -fwrapv -fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2'
optimize='-march=x86-64 -mtune=generic -O2 -pipe'
cppflags='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -march=x86-64 -mtune=generic -O2 -pipe -fwrapv -fno-strict-aliasing -fstack-protector-strong'
ccversion=''
gccversion='11.3.0'
gccosandvers=''
intsize=4
longsize=8
ptrsize=8
doublesize=8
byteorder=12345678
doublekind=3
d_longlong=define
longlongsize=8
d_longdbl=define
longdblsize=16
longdblkind=3
ivtype='long'
ivsize=8
nvtype='double'
nvsize=8
Off_t='off_t'
lseeksize=8
alignbytes=8
prototype=define
Linker and Libraries:
ld='g++'
ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong'
libpth=/usr/lib
libs=-lpthread -lgdbm -ldb -ldl -lcrypt -lgdbm_compat
perllibs=-lpthread -ldl -lcrypt
libc=/usr/lib/libmsys-2.0.a
so=dll
useshrplib=true
libperl=msys-perl5_36.dll
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=dll
d_dlsymun=undef
ccdlflags=' '
cccdlflags=' '
lddlflags=' --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_TIMES
MULTIPLICITY
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_OP_PARENT
PERL_PRESERVE_IVUV
PERL_USE_SAFE_PUTENV
USE_64_BIT_ALL
USE_64_BIT_INT
USE_ITHREADS
USE_LARGE_FILES
USE_LOCALE
USE_LOCALE_COLLATE
USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC
USE_LOCALE_TIME
USE_PERLIO
USE_PERL_ATOF
USE_REENTRANT_API
USE_THREAD_SAFE_LOCALE
Built under msys
Compiled at Oct 26 2022 09:46:57
@inc:
/usr/lib/perl5/site_perl
/usr/share/perl5/site_perl
/usr/lib/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib/perl5/core_perl
/usr/share/perl5/core_perl
bill.e.ghote@COMPUTER MSYS /c/Users/bill.e.ghote/Malware/source/repos/Conf-Libconfig
$
The text was updated successfully, but these errors were encountered: