1

When I run my Makefile, it gives me the following error:

E:/Cygwin/lib/gcc/x86_64-pc-cygwin/11/cc1plus.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

It doesn't specify which library is missing?

This is my Makefile:

CC:= E:\Cygwin\bin\gcc.exe
CXX:= E:\Cygwin\bin\g++.exe
CFLAGS=-O3 -fopenmp -std=c99
CXXFLAGS=-O3 -fopenmp

all: daxpy

daxpy: daxpy.cpp
    $(CXX) $(CFLAGS) -o daxpy daxpy.cpp $(CXXFLAGS)

clean:
    rm -f $(EXECS) *.o

I had to specify my compiler path, because otherwise it couldn't find it.

(It gave me the error make: g++: No such file or directory until I changed it this way)

Does anyone have any ideas? It seems to not be able to find certain things, because I also get an undefined reference to 'omp_get_wtime' error when I run my main function.

HeaTHeR
  • 31
  • 4
  • Is there a specific reason why you are using Makefiles over a build system like CMake? CMake will generate Makefiles more systematically for you. – joergbrech Dec 06 '22 at 21:28
  • Similar side note: Unless you need Cygwin's POSIX compatibility layer, it's usually an unnecessary complication vs a modern mingw distribution like [MSYS2](https://stackoverflow.com/q/30069830/4581301). – user4581301 Dec 06 '22 at 21:33
  • This Makefile was already prepared for us students. I created a CMakeLists.txt and built it with Cygwin, but when I build it in CLion, the same error occurs (undefined reference to...) – HeaTHeR Dec 06 '22 at 22:01
  • I am having the same issue here, but it's a Delphi project: No Cygwin, no cmake, no makefile, no c++ – Adrian Maire Dec 07 '22 at 10:38

0 Answers0