CoderRC / libmingw32_extended

A library for mingw32 that includes some POSIX functions but eventually all of the POSIX functions will be completed and right now the POSIX functions that are included in this repository are pipe, wait, mmap, munmap, msync, mlock, munlock, posix_madvise, madvise, shm_open, shm_unlink, readv, writev, process_vm_readv, process_vm_writev, dlopen, etc
MIT License
12 stars 1 forks source link

Problem compiling #19

Open Zibri opened 5 months ago

Zibri commented 5 months ago

both my MINGW both my MSYS systems are up to date.

I can't compile with neither.

# make

gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/mmap.c -o obj/mmap.o
source/mmap.c: In function ‘mmap’:
source/mmap.c:64:28: warning: implicit declaration of function ‘_get_osfhandle’ [-Wimplicit-function-declaration]
   64 |           hFile = (HANDLE) _get_osfhandle (__fd);
      |                            ^~~~~~~~~~~~~~
source/mmap.c:64:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   64 |           hFile = (HANDLE) _get_osfhandle (__fd);
      |                   ^
source/mmap.c:70:15: warning: implicit declaration of function ‘_set_errno’; did you mean ‘__errno’? [-Wimplicit-function-declaration]
   70 |               _set_errno (EBADF);
      |               ^~~~~~~~~~
      |               __errno
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/munmap.c -o obj/munmap.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/msync.c -o obj/msync.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/mlock.c -o obj/mlock.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/munlock.c -o obj/munlock.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/posix_madvise.c -o obj/posix_madvise.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/madvise.c -o obj/madvise.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/shm_open.c -o obj/shm_open.o
source/shm_open.c: In function ‘shm_open’:
source/shm_open.c:26:3: warning: implicit declaration of function ‘_get_errno’; did you mean ‘__errno’? [-Wimplicit-function-declaration]
   26 |   _get_errno (&error_value);
      |   ^~~~~~~~~~
      |   __errno
source/shm_open.c:28:3: warning: implicit declaration of function ‘_set_errno’; did you mean ‘__errno’? [-Wimplicit-function-declaration]
   28 |   _set_errno (error_value);
      |   ^~~~~~~~~~
      |   __errno
source/shm_open.c:39:5: warning: implicit declaration of function ‘_fullpath’; did you mean ‘FillPath’? [-Wimplicit-function-declaration]
   39 |     _fullpath (NULL, filename,
      |     ^~~~~~~~~
      |     FillPath
source/shm_open.c:39:5: warning: initialization of ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/shm_unlink.c -o obj/shm_unlink.o
source/shm_unlink.c: In function ‘shm_unlink’:
source/shm_unlink.c:34:5: warning: implicit declaration of function ‘_fullpath’; did you mean ‘FillPath’? [-Wimplicit-function-declaration]
   34 |     _fullpath (NULL, filename,
      |     ^~~~~~~~~
      |     FillPath
source/shm_unlink.c:34:5: warning: initialization of ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
source/shm_unlink.c:51:7: warning: implicit declaration of function ‘_set_errno’; did you mean ‘__errno’? [-Wimplicit-function-declaration]
   51 |       _set_errno (EINVAL);
      |       ^~~~~~~~~~
      |       __errno
source/shm_unlink.c:56:3: warning: implicit declaration of function ‘_get_errno’; did you mean ‘__errno’? [-Wimplicit-function-declaration]
   56 |   _get_errno (&error_value);
      |   ^~~~~~~~~~
      |   __errno
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/readv.c -o obj/readv.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/writev.c -o obj/writev.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/process_vm_readv.c -o obj/process_vm_readv.o
source/process_vm_readv.c: In function ‘process_vm_readv’:
source/process_vm_readv.c:21:7: warning: implicit declaration of function ‘_set_errno’; did you mean ‘__errno’? [-Wimplicit-function-declaration]
   21 |       _set_errno (EPERM);
      |       ^~~~~~~~~~
      |       __errno
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/process_vm_writev.c -o obj/process_vm_writev.o
source/process_vm_writev.c: In function ‘process_vm_writev’:
source/process_vm_writev.c:21:7: warning: implicit declaration of function ‘_set_errno’; did you mean ‘__errno’? [-Wimplicit-function-declaration]
   21 |       _set_errno (EPERM);
      |       ^~~~~~~~~~
      |       __errno
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/dlopen.c -o obj/dlopen.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/dlclose.c -o obj/dlclose.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/dlsym.c -o obj/dlsym.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/dlerror.c -o obj/dlerror.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/dladdr.c -o obj/dladdr.o
source/dladdr.c:15:27: error: unknown type name ‘Dl_info’
   15 | dladdr (const void *addr, Dl_info * info)
      |                           ^~~~~~~
make: *** [Makefile:94: dladdr.o] Error 1

MINGW:

Zibri@ZibriN MINGW64 ~/llama.cpp/libmingw32_extended
# CC=gcc CPP=g++ ./configure
configure: loading site script /etc/config.site
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking target system type... x86_64-w64-mingw32
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking how to run the C preprocessor... g++
checking for ar... ar
checking where to find the target ar... just compiled
checking where to find the target gcc... just compiled
checking for mkdir -p... mkdir -p
checking for cp -R... cp -R
checking fcntl.h usability... yes
checking fcntl.h presence... no
configure: WARNING: fcntl.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: fcntl.h: proceeding with the compiler's result
checking for fcntl.h... yes
checking windows.h usability... yes
checking windows.h presence... no
configure: WARNING: windows.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: windows.h: proceeding with the compiler's result
checking for windows.h... yes
checking sys/types.h usability... yes
checking sys/types.h presence... no
configure: WARNING: sys/types.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: sys/types.h: proceeding with the compiler's result
checking for sys/types.h... yes
checking errno.h usability... yes
checking errno.h presence... no
configure: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: errno.h: proceeding with the compiler's result
checking for errno.h... yes
checking unistd.h usability... yes
checking unistd.h presence... no
configure: WARNING: unistd.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: unistd.h: proceeding with the compiler's result
checking for unistd.h... yes
checking sys/stat.h usability... yes
checking sys/stat.h presence... no
configure: WARNING: sys/stat.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: sys/stat.h: proceeding with the compiler's result
checking for sys/stat.h... yes
checking stdio.h usability... yes
checking stdio.h presence... no
configure: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: stdio.h: proceeding with the compiler's result
checking for stdio.h... yes
checking tlhelp32.h usability... yes
checking tlhelp32.h presence... no
configure: WARNING: tlhelp32.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: tlhelp32.h: proceeding with the compiler's result
checking for tlhelp32.h... yes
checking psapi.h usability... yes
checking psapi.h presence... no
configure: WARNING: psapi.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: psapi.h: proceeding with the compiler's result
checking for psapi.h... yes
checking whether to enable maintainer-specific portions of Makefiles... no
configure: creating ./config.status
config.status: creating Makefile

Zibri@ZibriN MINGW64 ~/llama.cpp/libmingw32_extended
# CC=gcc CPP=g++ make
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_FCNTL_H=1 -DHAVE_WINDOWS_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TLHELP32_H=1 -DHAVE_PSAPI_H=1 -I../include    -c source/dladdr.c -o obj/dladdr.o
source/dladdr.c:1:10: fatal error: dlfcn.h: No such file or directory
    1 | #include <dlfcn.h>
      |          ^~~~~~~~~
compilation terminated.
make: *** [Makefile:94: dladdr.o] Error 1
CoderRC commented 5 months ago

As well look at -I../include and see that when you do ls .. you will not see the include directory. Well simple fix first create a build directory using mkdir build then cd build then do ../configure make make install Always when using unknown projects just follow the Build instructions provided in README file of the main project at least once Reply if you can run the make part of the setup after redoing all the steps again.