简体   繁体   中英

Makefile Mingw32-make Interrupt/Exception

Why do I get error message when using mingw32-make on Win10 cmd. here is my Makefile code

all: compile link

compile:
    g++ -I src/include -c main.cpp
link:
    g++ main.o -o main -L src/lib -l sfml-graphics -l sfml-window -l sfml-system

here is the output on cmd

D:\Devs\C++\T2>mingw32-make
g++ -I src/include -c main.cpp
mingw32-make: Interrupt/Exception caught (code = 0xc0000005, addr = 0x00007FF89CC5F398)

but if run it manually and individually it compiles properly?

D:\Devs\C++\T2>g++ -I src/include -c main.cpp

D:\Devs\C++\T2>g++ main.o -o main -L src/lib -l sfml-graphics -l sfml-window -l sfml-system

No error, and when I run the the main.exe file, the updated code applies.

For further information, here the libraries version I'm using:

D:\Devs\C++\T2>g++ --version
g++ (GCC) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

D:\Devs\C++\T2>cmake --version
cmake version 3.20.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Any tips? Thank you.

0xc0000005 is an Access Violation. It's coming from mingw32-make. I had hoped it might be a configuration error, or you might be able to fix it simply by reinstalling. That appears not to be the case.

Look here or here .

The answer in both cases was related to the Windows %PATH% string. Specifically:

https://superuser.com/questions/375029/make-interrupt-exception-caught

this problem is apparently caused when the PATH variable contains parentheses (, ), as it does on Win Vista/7. Unfortunately, the available GNU for Windows is hopelessly outdated.

My problem was fixed by forcing make use the correct shell: insert the following line at the beginning of your makefile.

SHELL=C:/Windows/System32/cmd.exe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM