Why do I get "/bin/ld: cannot find -lws2_32" when making windows binary in RHEL?

53 views Asked by At

I want to compile the ASCO optimization software using supplied Makefile.win. (https://asco.sourceforge.net/downloads.html)

However, I am always getting the "/bin/ld: cannot find -lws2_32" error

I installed mingw64-gcc, mingw32-gcc at my RHEL8 machine. And still get the same.

The contents of Makefile.win are as follows

#
CC = gcc
CC_MPI = <FULL_PATH_TO_MPICH>/bin/mpicc
CFLAGS = -Os


#
all: asco asco-test alter log monte postp

asco-test:
    $(CC) $(CFLAGS) -DDEBUG -DASCO -o asco-test.exe auxfunc.c auxfunc_alter.c auxfunc_monte.c auxfunc_measurefromlis.c rfmodule.c initialize.c errfunc.c evaluate.c asco-test.c -lm -lws2_32

asco:
    $(CC) $(CFLAGS) -DASCO -o asco.exe auxfunc.c auxfunc_alter.c auxfunc_monte.c auxfunc_measurefromlis.c rfmodule.c initialize.c errfunc.c evaluate.c de36.c hooke.c nmlatest.c asco.c -lm -lws2_32

asco-mpi:
    $(CC_MPI) $(CFLAGS) -DASCO -DMPI -o asco-mpi.exe auxfunc.c auxfunc_alter.c auxfunc_monte.c auxfunc_measurefromlis.c rfmodule.c initialize.c errfunc.c evaluate.c de36.c hooke.c nmlatest.c asco.c -lm -lws2_32

alter::
    make -C tools/alter/ -f Makefile.win32

log::
    make -C tools/log/ -f Makefile.win32

monte::
    make -C tools/monte/ -f Makefile.win32

postp::
    make -C tools/postp/ -f Makefile.win32

clean::
    rm -f asco.exe asco-test.exe
    rm -f tols/alter/alter.exe
    rm -f tools/log/log.exe
    rm -f tools/monte/monte.exe
    rm -f tools/postp/postp.exe
0

There are 0 answers