compiler-errors

How do I specify the include path when I build a program in VSCode?

别说谁变了你拦得住时间么 提交于 2020-05-14 10:26:41
问题 Let's say this is my project. file structure: project_root |-- inc | |-- header.h |-- src | |-- helpers.c | |-- main.c header.h #ifndef HEADER_H # define HEADER_H void func(void); #endif helpers.c void func() { /* do something */ } main.c #include "header.h" int main(void) { func(); return (0); } c_cpp_properties.json { "configurations": [ { "name": "Mac", "includePath": [ "${workspaceFolder}/inc", ], "defines": [], "macFrameworkPath": [ "/System/Library/Frameworks", "/Library/Frameworks" ],

How do I specify the include path when I build a program in VSCode?

我与影子孤独终老i 提交于 2020-05-14 10:25:49
问题 Let's say this is my project. file structure: project_root |-- inc | |-- header.h |-- src | |-- helpers.c | |-- main.c header.h #ifndef HEADER_H # define HEADER_H void func(void); #endif helpers.c void func() { /* do something */ } main.c #include "header.h" int main(void) { func(); return (0); } c_cpp_properties.json { "configurations": [ { "name": "Mac", "includePath": [ "${workspaceFolder}/inc", ], "defines": [], "macFrameworkPath": [ "/System/Library/Frameworks", "/Library/Frameworks" ],

node-gyp compile error c2240 cannot convert from 'v8::Value *' to 'v8:object *volatile'

时光怂恿深爱的人放手 提交于 2020-05-09 07:03:39
问题 The 2440 error point into the ".node-gyp\4.4.5\include\node\v8.h(221)", so I have no idea what's goes wrong. p.s. compiled on a windows machine. Is there any way to figure out which sentence is causing this error, it's my first time to use node-gyp, thanks. 回答1: Same issue here. Most probably because we use newer nodejs v4.4.5 version and it can no longer work with C++ Build Tools in Visual Studio 2012/2013. (someone else can clarify this?) You can try C++ Build Tools in Visual Studio 2015

Visual Studio Express: fatal error c1060, the compiler is out of heap space

做~自己de王妃 提交于 2020-05-09 02:19:30
问题 I'm trying to build a program from its source code with VC 11 and when the compiler is going to finish, it raises the error in title. As I've read here and in other forums, I've alteady tried both to close as many programs as possibile and to enlarge the size of the swap file in Windows...they don't work. I've read about a parameter called \Zm but I don't understand how to use it. Can you please help me? 回答1: Take a look at this documentation which gives possible solutions: I also had that

Error while compiling Octave with GCC

Deadly 提交于 2020-04-30 07:24:47
问题 While trying to compile Octave 4.0.3 using gcc 4.2.8 I get the following error make[2]: Entering directory `/local/home/qa/joseph/app_porting/octave-porting/try_gcc_5.4.0/build_octave/src' GEN mkoctfile.cc CXX mkoctfile.o CXXLD mkoctfile CC octave-display-available.o GEN main.cc CXX octave-main.o CXXLD octave CXX main-cli.o CXXLD octave-cli ../libinterp/.libs/liboctinterp.so: error: undefined reference to 'gzungetc' ../libinterp/.libs/liboctinterp.so: error: undefined reference to 'gzwrite' .

Error while compiling Octave with GCC

会有一股神秘感。 提交于 2020-04-30 07:24:21
问题 While trying to compile Octave 4.0.3 using gcc 4.2.8 I get the following error make[2]: Entering directory `/local/home/qa/joseph/app_porting/octave-porting/try_gcc_5.4.0/build_octave/src' GEN mkoctfile.cc CXX mkoctfile.o CXXLD mkoctfile CC octave-display-available.o GEN main.cc CXX octave-main.o CXXLD octave CXX main-cli.o CXXLD octave-cli ../libinterp/.libs/liboctinterp.so: error: undefined reference to 'gzungetc' ../libinterp/.libs/liboctinterp.so: error: undefined reference to 'gzwrite' .

Error while compiling Octave with GCC

▼魔方 西西 提交于 2020-04-30 07:24:20
问题 While trying to compile Octave 4.0.3 using gcc 4.2.8 I get the following error make[2]: Entering directory `/local/home/qa/joseph/app_porting/octave-porting/try_gcc_5.4.0/build_octave/src' GEN mkoctfile.cc CXX mkoctfile.o CXXLD mkoctfile CC octave-display-available.o GEN main.cc CXX octave-main.o CXXLD octave CXX main-cli.o CXXLD octave-cli ../libinterp/.libs/liboctinterp.so: error: undefined reference to 'gzungetc' ../libinterp/.libs/liboctinterp.so: error: undefined reference to 'gzwrite' .

“not all code path return a value” error occurs in a method, but I did use some if statements to cover all scenario

▼魔方 西西 提交于 2020-04-30 04:35:28
问题 This may be a stupid question, but I just want to somebody can give a better explanation. I have a method defined as below: private int Test(int i) { if (i < 0) return -1; if (i == 0) return 0; if (i > 0) return 1; //return 0; } It gives me this error "not all code path return a value". I thought I had 3 if statement , which could cover all the scenarios(i<0, i==0, i>0). So it should not show me this error. 回答1: The compiler just ain't that clever. Also, you're code is slightly inefficient in

“not all code path return a value” error occurs in a method, but I did use some if statements to cover all scenario

谁说我不能喝 提交于 2020-04-30 04:33:26
问题 This may be a stupid question, but I just want to somebody can give a better explanation. I have a method defined as below: private int Test(int i) { if (i < 0) return -1; if (i == 0) return 0; if (i > 0) return 1; //return 0; } It gives me this error "not all code path return a value". I thought I had 3 if statement , which could cover all the scenarios(i<0, i==0, i>0). So it should not show me this error. 回答1: The compiler just ain't that clever. Also, you're code is slightly inefficient in

How to disable/suppress errors from libraries in TypeScript?

白昼怎懂夜的黑 提交于 2020-04-10 03:18:38
问题 I have turned on some compiler switches to report more issues in code (e.g. strict null checks). But I get tens of errors in used libraries, e.g.: [default] xxx/node_modules/@angular/core/src/util/decorators.d.ts:11:5 Property 'extends' of type 'Type<any> | undefined' is not assignable to string index type 'Function | any[] | Type<any>'. Is there any way of suppressing/muting/disabling error checking in libraries (e.g. directory node_modules )? It can't be a duplicate of Allow implicit any