Closed BT185070 closed 2 years ago
I'v just fixed this problem add adding "MINGW" macro in acl_mbox in order to support MSYS2 on Windows platform.
@zhengshuxin Found cast error this time
-> # make building src/init/acl_init.c building src/private/private_array.c building src/private/private_fifo.c building src/private/private_thread_mutex.c building src/private/private_vstream.c building src/private/sem.c building src/stdlib/acl_atomic.c building src/stdlib/acl_chunk_chain.c building src/stdlib/acl_debug.c building src/stdlib/acl_file.c building src/stdlib/acl_getopt.c building src/stdlib/acl_mbox.c building src/stdlib/acl_meter_time.c building src/stdlib/acl_msg.c building src/stdlib/acl_myflock.c building src/stdlib/acl_mylog.c src/stdlib/acl_mylog.c: In function ‘file_vsyslog’: src/stdlib/acl_mylog.c:818:25: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 818 | (unsigned int) acl_pthread_self(), info); | ^ src/stdlib/acl_mylog.c: In function ‘net_vsyslog’: src/stdlib/acl_mylog.c:869:25: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 869 | (unsigned int) acl_pthread_self(), info); | ^ cc1: all warnings being treated as errors make: *** [Makefile:395: debug/acl_mylog.o] Error 1
Added the below conversion instead of (unsigned int) to resolve the above cast error (unsigned long long int) acl_pthread_self()
Found another error in MSYS2 compilation. Please help to resolve this.
src/master/template/ifmonitor.c:10:10: fatal error: linux/netlink.h: No such file or directory
10 | #include <linux/netlink.h>
| ^~~~~
compilation terminated.
make: *** [Makefile:527: debug/ifmonitor.o] Error 1
Added "MINGW" macro in ifmonitor as well in order to support MSYS2 on Windows platform.
I downloaded and installed msys2-x86_64-20220603.exe, and got one error " #error Only Win32 target is supported!" that I don't know why. How did you make your msys2 working well?
I am using the msys2 console to compile the code.
Which version msys2 are you using? And can you tell me the process of installing msys2? I've spent many times according the msys2's official guidance, but got the same error.
I followed the below steps,
I've tried many times to install msys2, but still can't compile acl with gcc. The installing steps are below:
$ make
building src/init/acl_init.c
In file included from D:/msys64/mingw64/include/corecrt.h:10,
from D:/msys64/mingw64/include/crtdefs.h:10,
from D:/msys64/mingw64/include/stddef.h:7,
from D:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/12.1.0/include/stddef.h:1,
from ./include/stdlib/acl_define_linux.h:18,
from ./include/stdlib/acl_define_unix.h:4,
from ./include/stdlib/acl_define.h:10,
from ./StdAfx.h:6,
from src/init/acl_init.c:1:
D:/msys64/mingw64/include/_mingw.h:278:2: error: #error Only Win32 target is supported!
278 | #error Only Win32 target is supported!
| ^~~~~
./include/stdlib/acl_define_linux.h:62:18: error: conflicting types for 'ssize_t'; have 'long int'
62 | typedef long int ssize_t;
| ^~~~~~~
D:/msys64/mingw64/include/corecrt.h:47:13: note: previous declaration of 'ssize_t' with type 'ssize_t' {aka 'int'}
47 | typedef int ssize_t;
| ^~~~~~~
In file included from ./include/stdlib/acl_define_unix.h:42:
D:/msys64/mingw64/include/sys/types.h:10:2: error: #error Only Win32 target is supported!
10 | #error Only Win32 target is supported!
| ^~~~~
./include/stdlib/acl_define_unix.h:43:11: fatal error: net/if.h: No such file or directory
43 | # include <net/if.h>
| ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:385: debug/acl_init.o] Error 1
I've tried different msys2 versions, but got the same error. The install process is from the official website. Are there some differences between us? And can you give me the installing process with more details?
This is the folder structure I have. I have followed the same steps you mentioned. But I have opened mysys2.exe from the folder directly.
But gcc/g++ are not in mysys2.exe, and they're in mingw64.exe. Are you sure you can run gcc in mysys2.exe? I'll try the older version of mysys2 or cygwin later.
I have installed those packages using mysys2.exe. Try the same.
Yes, I also did it same as you: install those packages in mysys2.exe and run gcc/g++ in mingw64.exe, because gcc/g++ aren't in mysys2.exe.
I've downloaded Cygwin and built acl ok now, so I think acl should also be built ok on msys2. You can try again.
I able to compile using Msys2 now. I have tried compilation on QT mingw today. But facing the below error
You can add cflags += -DMINGW in your Makefile including acl's headers.
Gives the same error even after adding the CFLAG
You can try to compile the demo in acl/lib_acl/samples/vstream_server, if successfully, you can refer the Makefile.in acl/lib_acl/samples/.
Trying to build the libraries on windows using MSYS2 or MINGW64 terminals.
Installed all the dependencies on MSYS2 and MINGW64 but still no luck.
Below is the error I am facing when compiling
-># make building src/init/acl_init.c building src/private/private_array.c building src/private/private_fifo.c building src/private/private_thread_mutex.c building src/private/private_vstream.c building src/private/sem.c building src/stdlib/acl_atomic.c building src/stdlib/acl_chunk_chain.c building src/stdlib/acl_debug.c building src/stdlib/acl_file.c building src/stdlib/acl_getopt.c building src/stdlib/acl_mbox.c building src/stdlib/acl_mbox.c src/stdlib/acl_mbox.c:19:11: fatal error: linux/version.h: No such file or directory 19 | # include <linux/version.h> | ^
~~~~am I doing it right to compile the libraries on windows using MSYS2? Can you please shed some light on how to compile the libraries on windows using MSYS2 or MINGW64?