Open Tracker647 opened 4 years ago
Does this issue occur if you run make clean
then have it recompile as .cpp
files?
Does this issue occur if you run
make clean
then have it recompile as.cpp
files?
I type command in bin file and the project root file but not success message,I used to delete the main.exe
and rebuild it but the breakpoint is still become grey.
the message when I type make clean
in:
PS D:\myprogramming\C\Chapter17\TREE__> mingw32-make clean
rm -f bin/main.exe
process_begin: CreateProcess(NULL, rm -f bin/main.exe, ...) failed.
make (e=2): 系统找不到指定的文件。(No such file or directory)
mingw32-make: [Makefile:33: clean] Error 2 (ignored)
rm -f src/tree.o src/petclub.o
process_begin: CreateProcess(NULL, rm -f src/tree.o src/petclub.o, ...) failed.
make (e=2): 系统找不到指定的文件。(No such file or directory)
mingw32-make: [Makefile:34: clean] Error 2 (ignored)
PS D:\myprogramming\C\Chapter17\TREE__\bin> mingw32-make clean
mingw32-make: *** No rule to make target 'clean'. Stop.
can you clean up all .exe
and .o
files and try to rebuild? it seems like it is trying to use the old .o
's to rebuild and that has the file name with .c
in it that is causing it to find the wrong file to bind the breakpoint.
can you clean up all
.exe
and.o
files and try to rebuild? it seems like it is trying to use the old.o
's to rebuild and that has the file name with.c
in it that is causing it to find the wrong file to bind the breakpoint.
You mean delete all .o files and .exe files? I try it,still failed.https://imgchr.com/i/dCtzS1
Can you add the following to your launch.json and share the output from the debug console?
"logging": {
"engineLogging": true
}
Type: Debugger
my debugger:GNU gdb (GDB) 8.1
Describe the bug:
OS and Version: Windows 10 x64 10.0.18363
VS Code Version: 1.47.3
C/C++ Extension Version: v0.30.0-insiders
Other extensions you installed (and if the issue persists after disabling them): Bracket Pair Colorizer 2 C/C++ Project Generator(I use its to create makefile for project) Code Runner Debug Visualizer
A clear and concise description of what the bug is. The debugging can see the yellow director normally when I debug my C projects(2 c files,1 head files),for some reasons I need get my c files change into cpp files and make and debug again,then I find the director is disappeared and the red break dot become grey,I try to change my compiler from gcc to g++ to solve its but it's not work.
To Reproduce Please include a code sample and
launch.json
configuration. Steps to reproduce the behavior:rename all c files as cpp files,and change complier command in makefile from gcc to g++.
Click on Ctrl+F5 for debugging.
Termiral:'.
the director is disappeared and the red break dot become grey.
my C++ project structure: D:. │ Makefile │ ├─.vscode │ launch.json │ tasks.json │ ├─bin │ main.exe │ ├─include ├─lib └─src petclub.cpp petclub.o tree.cpp tree.h tree.o
launch.json
{ "version": "0.2.0", "configurations": [ { "name": "Debug", "type": "cppdbg", "request": "launch", "args": [], "stopAtEntry": true, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "linux": { "MIMode": "gdb", "miDebuggerPath": "gdb", "program": "${workspaceFolder}/bin/main" }, "osx": { "MIMode": "lldb", "miDebuggerPath": "lldb-mi", "program": "${workspaceFolder}/bin/main" }, "windows": { "MIMode": "gdb", "miDebuggerPath": "gdb.exe", "program": "${workspaceFolder}/bin/main.exe" }, "preLaunchTask": "build" } ] }
makefile `CC := g++ CFLAGS := -std=c++17 -Wall -Wextra -g
BIN := bin SRC := src INCLUDE := include LIB := lib
LIBRARIES :=
ifeq ($(OS),Windows_NT) EXECUTABLE := main.exe SOURCEDIRS := $(SRC) INCLUDEDIRS := $(INCLUDE) LIBDIRS := $(LIB) else EXECUTABLE := main SOURCEDIRS := $(shell find $(SRC) -type d) INCLUDEDIRS := $(shell find $(INCLUDE) -type d) LIBDIRS := $(shell find $(LIB) -type d) endif
CINCLUDES := $(patsubst %,-I%, $(INCLUDEDIRS:%/=%)) CLIBS := $(patsubst %,-L%, $(LIBDIRS:%/=%))
SOURCES := $(wildcard $(patsubst %,%/*.cpp, $(SOURCEDIRS))) OBJECTS := $(SOURCES:.cpp=.o)
all: $(BIN)/$(EXECUTABLE)
.PHONY: clean clean: -$(RM) $(BIN)/$(EXECUTABLE) -$(RM) $(OBJECTS)
run: all ./$(BIN)/$(EXECUTABLE)
$(BIN)/$(EXECUTABLE): $(OBJECTS) $(CC) $(CFLAGS) $(CINCLUDES) $(CLIBS) $^ -o $@ $(LIBRARIES)`