compiler-errors

f951 error: unrecognized command line option

Deadly 提交于 2021-02-19 07:10:47
问题 I am on linux and I am compiling the following: mpif90 -shared source.F90 object1.o object2.o -L/some/path -Qoption,link,-rpath=/some/path -I/some/path -lhdf5 -lhdf5_fortran -fPIC -fpp -DDECDEC_ -DMSMS_ -cxxlib-gcc -o libhdfwrapper.so and I get f95: unrecognized option '-Qoption,link,-rpath=/some/path' f95: unrecognized option '-cxxlib-gcc' f951: error: unrecognized command line option "-fpp" can anybody tell me why fpp is not recognized? 回答1: -fpp is a flag used by some compilers, notably

c++: switch statement missing semicolon before close brace

拈花ヽ惹草 提交于 2021-02-16 19:36:11
问题 In the interest of future readers and my own sanity later, I like to make it absolutely clear that switch statements that do not have a default case (due to all cases being covered) or sequential if-elseif-else with a final else that should not do anything must not be omitted and a comment to that effect be included (see example). However, whenever I include the default case in the switch statement and leave it empty I must put a semicolon inside the default case or a compiler error: " Line

invalid types 'int[int]' for array subscript

不问归期 提交于 2021-02-13 12:09:41
问题 This code throws up the compile error given in the title, can anyone tell me what to change? #include <iostream> using namespace std; int main(){ int myArray[10][10][10]; for (int i = 0; i <= 9; ++i){ for (int t = 0; t <=9; ++t){ for (int x = 0; x <= 9; ++x){ for (int y = 0; y <= 9; ++y){ myArray[i][t][x][y] = i+t+x+y; //This will give each element a value } } } } for (int i = 0; i <= 9; ++i){ for (int t = 0; t <=9; ++t){ for (int x = 0; x <= 9; ++x){ for (int y = 0; y <= 9; ++y){ cout <<

invalid types 'int[int]' for array subscript

徘徊边缘 提交于 2021-02-13 12:08:22
问题 This code throws up the compile error given in the title, can anyone tell me what to change? #include <iostream> using namespace std; int main(){ int myArray[10][10][10]; for (int i = 0; i <= 9; ++i){ for (int t = 0; t <=9; ++t){ for (int x = 0; x <= 9; ++x){ for (int y = 0; y <= 9; ++y){ myArray[i][t][x][y] = i+t+x+y; //This will give each element a value } } } } for (int i = 0; i <= 9; ++i){ for (int t = 0; t <=9; ++t){ for (int x = 0; x <= 9; ++x){ for (int y = 0; y <= 9; ++y){ cout <<

C# compile errors in unsafe code

徘徊边缘 提交于 2021-02-11 15:52:08
问题 Compiling a VS 2010 c# project (.NET 4.0, any CPU, allow unsafe code = checked) we are getting a variety of compile errors as below: Operator '*' cannot be applied to operands of type 'System.IntPtr' and 'int' Constant value '325486741' cannot be converted to a 'int' (use 'unchecked' syntax to override) Cannot convert type 'string' to 'char*' Cannot implicitly convert type 'long' to 'byte*'. An explicit conversion exists (are you missing a cast?) Invalid expression term 'ref' All these are

C# compile errors in unsafe code

一曲冷凌霜 提交于 2021-02-11 15:51:09
问题 Compiling a VS 2010 c# project (.NET 4.0, any CPU, allow unsafe code = checked) we are getting a variety of compile errors as below: Operator '*' cannot be applied to operands of type 'System.IntPtr' and 'int' Constant value '325486741' cannot be converted to a 'int' (use 'unchecked' syntax to override) Cannot convert type 'string' to 'char*' Cannot implicitly convert type 'long' to 'byte*'. An explicit conversion exists (are you missing a cast?) Invalid expression term 'ref' All these are

C# compile errors in unsafe code

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-11 15:51:01
问题 Compiling a VS 2010 c# project (.NET 4.0, any CPU, allow unsafe code = checked) we are getting a variety of compile errors as below: Operator '*' cannot be applied to operands of type 'System.IntPtr' and 'int' Constant value '325486741' cannot be converted to a 'int' (use 'unchecked' syntax to override) Cannot convert type 'string' to 'char*' Cannot implicitly convert type 'long' to 'byte*'. An explicit conversion exists (are you missing a cast?) Invalid expression term 'ref' All these are

Naming a variable `current` in a kernel module leads to “function declaration isn’t a prototype” error

删除回忆录丶 提交于 2021-02-11 15:01:33
问题 I'm learning to write kernel modules for linux as a beginner. What I'm trying to do is to write every task and its child process into the kernel log using DFS algorithm. But when I compile the code using Makefile , it shows the above error: function declaration isn’t a prototype [-Werror=strict-prototypes] struct task_struct *current; It points out the task_struct keyword at the function DFS. Here's my code: # include <linux/init.h> # include <linux/kernel.h> # include <linux/module.h> #

Compiling Elmer FEM on macOS Mojave causes the fatal error: 'string.h' file not found

∥☆過路亽.° 提交于 2021-02-11 14:10:41
问题 I'm trying to follow these instructions to compile Elmer FEM on macOS Mojave Version 10.14.6 . However, when running the make install I get the error message: .../elmerfem/umfpack/src/umfpack/include/umf_internal.h:29:10: fatal error: 'string.h' file not found #include <string.h> ^~~~~~~~~~ 1 error generated. make[2]: *** [umfpack/src/umfpack/umfpack_zl_save_symbolic.c] Error 1 make[2]: *** Deleting file `umfpack/src/umfpack/umfpack_zl_save_symbolic.c' make[1]: *** [umfpack/src/umfpack

Compiling Elmer FEM on macOS Mojave causes the fatal error: 'string.h' file not found

筅森魡賤 提交于 2021-02-11 14:10:30
问题 I'm trying to follow these instructions to compile Elmer FEM on macOS Mojave Version 10.14.6 . However, when running the make install I get the error message: .../elmerfem/umfpack/src/umfpack/include/umf_internal.h:29:10: fatal error: 'string.h' file not found #include <string.h> ^~~~~~~~~~ 1 error generated. make[2]: *** [umfpack/src/umfpack/umfpack_zl_save_symbolic.c] Error 1 make[2]: *** Deleting file `umfpack/src/umfpack/umfpack_zl_save_symbolic.c' make[1]: *** [umfpack/src/umfpack