Я хочу выучить C и C ++, правда, но я изо всех сил пытаюсь даже заставить простой компилятор работать правильно, что я делаю не так?
Это мои задачи. json
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "C/C++: g++.exe build active file",
"command": "C:\\MinGW\\bin\\g++.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "C:\\MinGW\\bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Это вывод, когда я набираю "g cc helloworld.exe" в терминале
> C:\Users\Administrator\projects\helloworld>gcc helloworld.exe
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: DWARF error: could not find abbrev number 3874
helloworld.exe:cygming-crtbegin.c:(.text+0x290): multiple definition of `_mingw32_init_mainargs'; c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../crt2.o:(.text+0x290): first defined here
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: helloworld.exe:cygming-crtbegin.c:(.text+0x2d0): multiple definition of `mainCRTStartup'; c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../crt2.o:(.text+0x2d0): first defined here
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: helloworld.exe:cygming-crtbegin.c:(.text+0x2f0): multiple definition of `WinMainCRTStartup'; c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../crt2.o:(.text+0x2f0): first defined here
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: helloworld.exe:cygming-crtbegin.c:(.text+0x310): multiple definition of `atexit'; c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../crt2.o:(.text+0x310): first defined here
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: helloworld.exe:cygming-crtbegin.c:(.text+0x320): multiple definition of `_onexit'; c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../crt2.o:(.text+0x320): first defined here
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: helloworld.exe:cygming-crtbegin.c:(.text+0x330): multiple definition of `__gcc_register_frame'; c:/mingw/bin/../lib/gcc/mingw32/9.2.0/crtbegin.o:cygming-crtbegin.c:(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: helloworld.exe:cygming-crtbegin.c:(.text+0x3e0): multiple definition of `__gcc_deregister_frame'; c:/mingw/bin/../lib/gcc/mingw32/9.2.0/crtbegin.o:cygming-crtbegin.c:(.text+0xb0): first defined here
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: helloworld.exe:cygming-crtbegin.c:(.bss+0x4): multiple definition of `_argc'; c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../crt2.o:(.bss+0x4): first defined here
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: helloworld.exe:cygming-crtbegin.c:(.bss+0x0): multiple definition of `_argv'; c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../crt2.o:(.bss+0x0): first defined here
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: helloworld.exe:cygming-crtbegin.c:(.eh_frame+0xc8): multiple definition of `__EH_FRAME_BEGIN__'; c:/mingw/bin/../lib/gcc/mingw32/9.2.0/crtbegin.o:cygming-crtbegin.c:(.eh_frame+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Решение в комментариях, спасибо всем за помощь!