Msys compile of C code - c

I'm not very familiar with compiling C code, especially on Windows using MinGW/Msys. Here is my problem. I am attempting to compile an open-source M3u8-segmenter C code for Windows. The open-source examples all deal with linux, but I have successfully compiled the code on my Mac OSX machine without a problem.
In Msys on Windows, the ./configure is successful, but once I do the Make, I get the following error. It appears to related to the signal.h include, but I'm not sure. Any insight would be appreciated.
make[1]: Entering directory `/home/install/m3u8-segmenter-master/tests'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/install/m3u8-segmenter-master/tests'
make[1]: Entering directory `/home/install/m3u8-segmenter-master'
gcc -DPACKAGE_NAME=\"m3u8-segmenter\" -DPACKAGE_TARNAME=\"m3u8-segmenter\" -DPAC
KAGE_VERSION=\"0.3\" -DPACKAGE_STRING=\"m3u8-segmenter\ 0.3\" -DPACKAGE_BUGREPOR
T=\"http://github.com/johnf/m3u8-segmenter/issues\" -DPACKAGE_URL=\"http://m3u8-
segmenter.inodes.org\" -DPACKAGE=\"m3u8-segmenter\" -DVERSION=\"0.3\" -DSTDC_HEA
DERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_
H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -
DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_GETOPT_H=1 -DHAVE
_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_MEMMOVE=1 -DHAVE_MEMSET=1 -DHAVE_STRRCHR=1 -D
HAVE_STRTOL=1 -I. -Ic:/msys/1.0/local/include -g -O2 -Wall -Wextra -Wdeclar
ation-after-statement -Wpointer-arith -funsigned-char -Werror -Wall -Wstrict-pro
totypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wneste
d-externs -Wshadow -Wbad-function-cast -Wwrite-strings -MT m3u8_segmenter-m3u8-
segmenter.o -MD -MP -MF .deps/m3u8_segmenter-m3u8-segmenter.Tpo -c -o m3u8_segme
nter-m3u8-segmenter.o `test -f 'm3u8-segmenter.c' || echo './'`m3u8-segmenter.c
m3u8-segmenter.c: In function 'main':
m3u8-segmenter.c:212:22: error: storage size of 'act' isn't known
m3u8-segmenter.c:413:5: error: implicit declaration of function 'sigaction' [-We
rror=implicit-function-declaration]
m3u8-segmenter.c:413:5: error: nested extern declaration of 'sigaction' [-Werror
=nested-externs]
m3u8-segmenter.c:212:22: error: unused variable 'act' [-Werror=unused-variable]
cc1.exe: all warnings being treated as errors
make[1]: *** [m3u8_segmenter-m3u8-segmenter.o] Error 1
make[1]: Leaving directory `/home/install/m3u8-segmenter-master'
make: *** [all-recursive] Error 1

To emulate UNIX on Windows, Cygwin is more appropriate than MSys/MinGW as pointed by this post

Related

CSAPP archlab: Fail to compile the simulator

When I compile the simulator using 'make', it appears an error.
(cd misc; make all)
make[1]: Entering directory '/root/archlab-handout/sim/misc'
gcc -Wall -O1 -g -fcommon -c yis.c
gcc -Wall -O1 -g -fcommon -c isa.c
gcc -Wall -O1 -g -fcommon yis.o isa.o -o yis
gcc -Wall -O1 -g -fcommon -c yas.c
flex yas-grammar.lex
mv lex.yy.c yas-grammar.c
gcc -O1 -fcommon -c yas-grammar.c
gcc -Wall -O1 -g -fcommon yas-grammar.o yas.o isa.o -lfl -o yas
/usr/bin/ld: cannot find -lfl
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:32: yas] Error 1
make[1]: Leaving directory '/root/archlab-handout/sim/misc'
make: *** [Makefile:26: all] Error 2
It seems like 'ld' returned 1 exit status. Can anyone help me how to solve this problem?
I have just learning computer science systematically for a while, and I do lack the experience with solving these problems.

How to Compile Openssl for linux-mips32 on a windows machine?

I have been struggling to build openssl for linux-mips32 using VS2015x native Tools.
I have set up perl and use the following command to configure:
perl Configure linux-mips32
--prefix=C:\Users\srivaspr\Downloads\openssl-1.0.2k.tar\openssl\builder
--openssldir=C:\Users\srivaspr\Downloads\openssl-1.0.2k.tar\openssl\builder
The configuration command works fine.
But when I use make command it gives the following error:
making all in crypto...
make[1]: Entering directory 'C:/Users/srivaspr/Downloads/openssl-1.0.2k.tar/openssl/crypto'
gcc -I. -I.. -I../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -mips2 -mabi=32 -O3 -Wall -DBN_DIV3W -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DAES_ASM -c -o cryptlib.o cryptlib.c
gcc: error: unrecognized argument in option '-mabi=32'
gcc: note: valid arguments to '-mabi=' are: ms sysv
gcc: error: unrecognized command line option '-mips2'
make[1]: *** [<builtin>: cryptlib.o] Error 1
make[1]: Leaving directory 'C:/Users/srivaspr/Downloads/openssl-1.0.2k.tar/openssl/crypto'
make: *** [Makefile:287: build_crypto] Error 1
I have searched through the internet multiple times but could not find anything relevant. Any help would be appreciated.

installing libcerf throws error when entering make

I need to use the erfi function in my C program, so I tried to install the libcerf library, where it is supposed to be contained. I downloaded it, went to the directory and entered ./configure. So far so good. Now when I enter 'make' it gives me the following error:
`localhost:libcerf-1.3 NAME$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in lib
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -pedantic -Wall -Werror -g -O2 -MT w_of_z.lo -MD -MP -MF .deps/w_of_z.Tpo -c -o w_of_z.lo w_of_z.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -pedantic -Wall -Werror-g -O2 -MT w_of_z.lo -MD -MP -MF .deps/w_of_z.Tpo -c w_of_z.c -fno-common -DPIC -o .libs/w_of_z.o
w_of_z.c:79:21: error: unused function 'cpolar' [-Werror,-Wunused-function]
static inline cmplx cpolar(double r, double t)
^
1 error generated.
make[2]: *** [w_of_z.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
There seems to be some problem with an unused function. This confuses me since this is the only way known to me to install libraries and I did not really do anything but the ./configure command. Yet it doesnt work. Additionally, I can't help myself with the output I get. I have tried googling it but could not get any further. I am using a Mac. Any help is appreciated.
Thanks a lot!

Building GCC cross-compiler for PowerPC AIX 7.1

I'm just trying to build gcc cross-compiler for AIX7.1. Have successfully built binutils-2.25.1, but have problems with building gcc-6.3.0. It successfully compile target all-gcc but fails on compiling all-target-libgcc. I get this error:
In file included from /home/zakkurasov/aix-sysroot/usr/include/sys/inttypes.h:51:0,
from /home/zakkurasov/cross-aix/build-gcc/gcc/include-fixed/sys/types.h:70,
from /home/zakkurasov/cross-aix/build-gcc/gcc/include-fixed/stdio.h:489,
from ../../../../gcc-6.3.0/libgcc/../gcc/tsystem.h:87,
from ../../../../gcc-6.3.0/libgcc/libgcc2.c:27:
/home/zakkurasov/cross-aix/build-gcc/gcc/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
# include_next <stdint.h>
^
compilation terminated.
Makefile:467: recipe for target '_lshrdi3.o' failed
make[4]: *** [_lshrdi3.o] Error 1
make[4]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc/powerpc-ibm-aix7.1.0.0/pthread/libgcc'
Makefile:1161: recipe for target 'multi-do' failed
make[3]: *** [multi-do] Error 1
make[3]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc/powerpc-ibm-aix7.1.0.0/libgcc'
Makefile:118: recipe for target 'all-multi' failed
make[2]: *** [all-multi] Error 2
make[2]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc/powerpc-ibm-aix7.1.0.0/libgcc'
Makefile:12321: recipe for target 'all-target-libgcc' failed
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc'
Makefile:882: recipe for target 'all' failed
make: *** [all] Error 2
Configure with command:
../gcc-6.3.0/configure --prefix=$PREFIX --host=$MACHTYPE --build=$MACHTYPE --target=$TARGET --with-sysroot=$SYSROOT --with-gnu-as --with-gnu-ld --enable-multilib --enable-languages=c,c++ -v
where
$PREFIX=/opt/aix
$TARGET=powerpc-ibm-aix7.1.0.0
$MACHTYPE=x86_64-pc-linux-gnu
$SYSROOT contain includes and libs from AIX 7.1
Sorry, have checked and saw that files in $SYSROOT/usr just broken symbolic links. Replaced it with files, and get new error:
/home/zakkurasov/cross-aix/build-gcc/./gcc/xgcc -B/home/zakkurasov/cross-aix/build-gcc/./gcc/ -B/opt/aix/powerpc-ibm-aix7.1.0.0/bin/ -B/opt/aix/powerpc-ibm-aix7.1.0.0/lib/ -isystem /opt/aix/powerpc-ibm-aix7.1.0.0/include -isystem /opt/aix/powerpc-ibm-aix7.1.0.0/sys-include -g -O2 -maix64 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -mlong-double-128 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -mlong-double-128 -I. -I. -I../../.././gcc -I../../../../gcc-6.3.0/libgcc -I../../../../gcc-6.3.0/libgcc/. -I../../../../gcc-6.3.0/libgcc/../gcc -I../../../../gcc-6.3.0/libgcc/../include -DHAVE_CC_TLS -DUSE_EMUTLS -o _mulsc3.o -MT _mulsc3.o -MD -MP -MF _mulsc3.dep -DL_mulsc3 -c ../../../../gcc-6.3.0/libgcc/libgcc2.c
/tmp/ccuoaSIc.s: Assembler messages:
/tmp/ccuoaSIc.s:545: Error: junk at end of line: `4'
/tmp/ccuoaSIc.s:548: Error: junk at end of line: `1'
Makefile:467: recipe for target '_mulsc3.o' failed

Axis2/c error in instalaltion

My problem is the following one:
When installing Axis2/c under the guidance of http://petio.org/ws/web_services_page7.html , which seems to be an adjusted manual from the official site I have a problem right after executing the make command in terminal.
At exactly this point:
$ cd /tmp/axis/axis2c-src-1.6.0
$ ./configure --prefix=${AXIS2C_HOME} --enable-libxml2=yes
$ make
I get this error:
XXX#XXXPC:~/Tools/axis2c/axis2c-src-1.5.0$ make
make all-recursive
make[1]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0'
Making all in util
make[2]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
make all-recursive
make[3]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
Making all in src
make[4]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src'
Making all in platforms/unix
make[5]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src/platforms/unix'
/bin/bash ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Werror -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c -o uuid_gen_unix.lo uuid_gen_unix.c
gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Werror -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c uuid_gen_unix.c -fPIC -DPIC -o .libs/uuid_gen_unix.o
**uuid_gen_unix.c: In function ‘axutil_uuid_gen_v1’:
uuid_gen_unix.c:62:20: error: variable ‘tv’ set but not used [-Werror=unused-but-set-variable]**
cc1: all warnings being treated as errors
make[5]: *** [uuid_gen_unix.lo] Error 1
make[5]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src/platforms/unix'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0'
make: *** [all] Error 2
I am not able to understand the reason why this error is being produced.
Because 1.6.0 version is down, I am using the 1.5.0 source version of axis2/c from the official site : http://axis.apache.org/axis2/c/core/download.cgi .
I have additionally installed Apache2 and libxml2, OpenSSL, cURL, libiconv, and zlib.
libraries.
I need your help because I am trying to build a serious project.
Thanks in advance.
Link to mirror of original Axis2/C-1.6.0 source distribution is here.
The main problem is with -Werror flag.
To compile original Axis2/C with modern compiler you must remove -Werror string from build scripts. To do that run this command after unpacking tarball:
find -type f -name configure -exec sed -i '/CFLAGS/s/-Werror//g' {} \;
Then configure and make Axis2/C.
Note: Original Axis2/C-1.6.0 has many issues like memory leaks and crashes. Consider using Axis2/C unofficial project instead. Most critical Axis2/C-1.6.0's issues is fixed within that project.
Also it have additional features https://code.google.com/p/axis2c-unofficial/wiki/IssuesList like JSON support and enhanced CURL-based transport authentication (and some other features).
There is an manual on how to install Axis2/C unofficial on Linux.

Resources