0

I am using Cygwin and makefile to complile multiple c files. The make file is

CC=gcc
INC_DIR=../include
LIBS=-lregex
ODIR=obj
_OBJ=main.o BVPA.o BVPA-cube.o BVPA-cif.o BVPA-hk.o BVPA-path.o BVPA-math.o BVPA-cmd.o BVPA-gui.o BVPA-vesta.o MT19937AR.o
OBJ=$(patsubst %,$(ODIR)/%,$(_OBJ))
TARGET=../bin/BVPA1.exe
CFLAGS=-I$(INC_DIR) -Wall -g

all: $(TARGET)
    rm -f $(ODIR)/*.o

$(TARGET): $(OBJ)
    $(CC) $(CFLAGS) -o $@ $^ $(LIBS)

$(ODIR)/%.o: %.c
    $(CC) $(CFLAGS) -c -o $@ $^

clean:
    rm -f $(ODIR)/*.o`

The outcome is

/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../libregex.dll when searching for -lregex

/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lregex
collect2: error: ld returned 1 exit status
make: *** [makefile:14: ../bin/BVPA1.exe] Error 1

I am not sure how to solve the problem. I have tried to download some libregex.dll and put them in the cygwin lib folder but they seem to be uncompatible.

Roy Dai
  • 483
  • 2
  • 5
  • 15
  • 1
    Possible duplicate of [/usr/bin/ld: skipping incompatible foo.so when searching for foo](https://stackoverflow.com/questions/16927885/usr-bin-ld-skipping-incompatible-foo-so-when-searching-for-foo) – ivan_pozdeev Sep 29 '18 at 05:12
  • Check if the DLL is a valid Cygwin x64 DLL: In `objdump --all-headers ` output, check `architecture:` (should be `i386:x86-64`), `MajorOSystemVersion`.`MinorOSystemVersion` & `MajorSubsystemVersion`.`MinorSubsystemVersion` (should both be less or equal to your [Windows version number](https://learn.microsoft.com/en-us/windows/desktop/sysinfo/operating-system-version)) and `The Import Tables` (should contain a section for `cygwin1.dll`). – ivan_pozdeev Sep 29 '18 at 05:37
  • @ivan_pozdeev do you know where i could find a possible valid regex.dll for x64? – Roy Dai Sep 29 '18 at 11:32
  • @ivan_pozdeev when I input $ objdump --all-headers -bash: syntax error near unexpected token `newline' – Roy Dai Sep 29 '18 at 11:34
  • full path to file, without angle brackets – ivan_pozdeev Sep 29 '18 at 11:59
  • https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libregex – ivan_pozdeev Sep 29 '18 at 12:00

0 Answers0