Trying to compile a 32bit DLL in Windows 10 with swipl-ld (SWI-Prolog 8.0.2-1 32bit stable), there is an error with a reference to /usr/bin/i686-w64-mingw32-gcc (as reproduced below), which is not a usual path for Windows. The same procedure was working with SWI-Prolog 7.6.4. Do you have any hint what is happening? Thank you in advance.
mingw32-make[1]: Entering directory 'c:/Bousi-Prolog/extern'
swipl-ld -I"c:/program files (x86)/swi-prolog 8.0.2\include" -I"%GNUWIN32%\include" -Wno-incompatible-pointer-types -Wno-implicit-function-declaration -Wno-unused-result -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -shared -fPIC -pl swipl -o extern.dll closure.c fuzzysets.c array.c lexical.c tokenize.c blocks.c leditwin.c shell.c install.c
El sistema no puede encontrar la ruta especificada.
/usr/bin/i686-w64-mingw32-gcc returned code 1
*** swipl-ld exit status 1
P.S. The (Spanish) error message above says something like: "The system cannot find the given path"
I see. You can use swipl-ld -cc gcc ... as a work around. I think there is also an outstanding issue with the library directory it passes though
I start to have my doubt about the entire concept of swipl-ld We already have a swipl.pc for pkg-config. Now this doesn’t fit Windows very well (I think). We could add a FindSWI-Prolog.cmake to support CMake users. I have little clue about what Windows users expect for compiling against externally installed software.
Thanks. I have tried that flag and the reference to the same path still persists:
C:\Bousi-Prolog\extern>swipl-ld -cc gcc -I"c:/program files (x86)/swi-prolog 8.0.2\include" -I"%GNUWIN32%\include" -Wno-incompatible-pointer-types -Wno-implicit-function-declaration -Wno-unused-result -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -shared -fPIC -pl swipl -o extern.dll closure.c fuzzysets.c array.c lexical.c tokenize.c blocks.c leditwin.c shell.c install.c
closure.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/***********************************************************************
^
fuzzysets.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/***********************************************************************
^
array.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/***********************************************************************
^
lexical.c:1:0: warning: -fPIC ignored for target (all code is position independent)
#line 2 "lexical.c"
^
tokenize.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/***********************************************************************
^
blocks.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/***********************************************************************
^
leditwin.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/***********************************************************************
^
shell.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/***********************************************************************
^
install.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/***********************************************************************
^
El sistema no puede encontrar la ruta especificada.
/usr/bin/i686-w64-mingw32-gcc returned code 1
*** swipl-ld exit status 1
This is legacy code and I’m also not sure what expect for compiling such software.
C:\Bousi-Prolog\extern>dir "c:/program files (x86)/swi-prolog 8.0.2/lib"
El volumen de la unidad C es OS
El número de serie del volumen es: 388E-6F34
Directorio de c:\program files (x86)\swi-prolog 8.0.2\lib
05/03/2019 22:19 <DIR> .
05/03/2019 22:19 <DIR> ..
05/03/2019 13:07 32.035 jpl.jar
1 archivos 32.035 bytes
2 dirs 88.666.873.856 bytes libres
Just pushed 0195e496c8ea05c40e05b5bf13f00b9307ae9e1c and d46a4afe8c1593e0edd4f19d902ded77925d83eb to deal with setting the C compiler to gcc.exe and fixing the library directory. Should be in tomorrows daily build at http://www.swi-prolog.org/download/daily/bin/
We’ll see …
As a work-around you can add a -L pointing at the right directory. The value of swipl-ld.exe is small if you have to overrule all defaults though