GNU Make “Abort trap: 6” after gcc call however call is valid when executed alone

淺唱寂寞╮ 提交于 2019-12-03 13:59:32

With help, answered my own question. SOLVED: First see @MadScientist's comment for what "Abort trap: 6" is.

Given that clue I realized I use a variable that could be confused with a system variable, $(PATH). It appears Make was not interpreting the following line how I expected it:

vpath %.c $(PATH) $(OBJ_DIR)                        <------ Bad

It looks like there is some interference with the system variable $(PATH) which may have been causing problems. Simply changing the vpath variable to $(SRC_PATH) eliminates the conflict with the system variable and any potential interference, thus fixing the problem.

vpath %.c $(SRC_PATH) $(OBJ_DIR)                    <------ Good

Lesson Learned: Be careful with variable names and know what your environment variables are.

Credit to @MadScientist for pointing out what "Abort trap: 6" means and suggesting environment issues.

if there is an assert method in your code you can get that error (abort trap : 6).

for example:

assert(numberOfItems >= 0);

and if the

numberOfItems < 0

you will get such an error when you call the makefile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!