compiler-errors

gfortran linking c libraries with conda

喜你入骨 提交于 2021-02-05 08:28:08
问题 I am trying to compile a C++/Fortran program using conda on an Ubuntu 18.04 server where I do not have superuser rights. I am able to compile correctly the program with the same source code on my Ubuntu 18.04 PC (using conda too), but on the server I get a bunch of errors. At the moment, I am stuck with a "library not found - undefined reference" error: gfortran -o glm -Wl,--export-dynamic obj/glm_globals.o obj/glm_util.o obj/glm_csv.o obj/glm_mobl.o obj/glm_mixu.o obj/glm_wqual.o obj/glm

Ternary Operator in C#

不打扰是莪最后的温柔 提交于 2021-02-05 06:50:53
问题 Can anyone please explain to me what happens behind the scenes when you use ternary operator? does this line of code: string str = 1 == 1 ? "abc" : "def"; is generated as a simple if / else statement? Consider the following: class A { } class B : A { } class C : A { } Now using ternary expression as follows: A a1 = 1 == 1 ? new B() : new C(); this doesn't even compile with this error: Type of conditional expression cannot be determined because there is no implicit conversion between

Ternary Operator in C#

夙愿已清 提交于 2021-02-05 06:50:26
问题 Can anyone please explain to me what happens behind the scenes when you use ternary operator? does this line of code: string str = 1 == 1 ? "abc" : "def"; is generated as a simple if / else statement? Consider the following: class A { } class B : A { } class C : A { } Now using ternary expression as follows: A a1 = 1 == 1 ? new B() : new C(); this doesn't even compile with this error: Type of conditional expression cannot be determined because there is no implicit conversion between

Overloading a method which takes in Generic type causes ambiguous method call compile error

家住魔仙堡 提交于 2021-02-05 06:21:08
问题 See below simple snippet: public class GenericsOverloadingDistinguish<T> { public void print1(T t) { System.out.println("t"); } public void print1(Integer i) { System.out.println("integer"); } } public static void main(String[] args) { new GenericsOverloadingDistinguish<Integer>().print1(new Integer(1)); } This would cause an ambiguous method call and will not compile. This is utterly confusing on the user of that class. It is not able to call neither print1(T t) nor print1(Integer i) simple

“Nested” class-template argument deduction with parentheses: GCC vs. clang

佐手、 提交于 2021-02-05 04:59:20
问题 Related, but (IMHO) different: Nested template argument deduction for class templates not working The following C++17 code is rejected from GCC 8, but clang compiles it without any issues. The GCC's error message is included as a comment just before the problematic line. Which compiler is correct here? https://godbolt.org/z/WG6f7G template<class T> struct Foo { Foo(T) {} }; template<class T> struct Bar { Bar(T) {}; }; void works() { Bar bar{1};// {} Foo foo(bar);// () } void works_too() { Foo

Upgrading VS2017 from 15.4.1 to 15.5.1 resulted in build error

混江龙づ霸主 提交于 2021-02-04 17:09:17
问题 I'm programming with the following tools/versions: Windows 10 / VS2017 Professional / C++ After I upgraded to 15.5.1 I got the following error: MIDL2338: switches are contradictory - no_robust vs. - target The Microsoft compiler error description list says: You cannot use both the /osf and /ms_ext command-line switches when you compile an IDL file. None of those switches are specified in my project properties. I tried to downgrade back to 15.4.1 but have found that it's impossible to revert

Undefined reference to 'main' when compiling a module

核能气质少年 提交于 2021-02-04 05:05:14
问题 I am learning Fortran, and I'm stuck trying to compile a module for later use. In the main program I have this, which asks for two numbers and then calls the function in the module: use exponentiate integer::a,b write *, 'A' read *, 'a write *, 'B' read *, 'b write *,expo(a,b) (I haven't tried that out because I need to compile the module first, but that's not the issue) Then, on another file I have this code, which (If I understood anything correctly) is just a standard module with a

compiling gpsim on macOS causes “error: 'long long type-name' is invalid”

旧时模样 提交于 2021-01-29 20:11:26
问题 Following this question, I'm trying to compile this code on macOS. I ran /System/Volumes/Data/usr/local/Cellar/qt/5.14.1/bin/qmake inside the build_XX folder successfully, and then make . However, I get the compiling error: ../src/gpsim/protocol.cc:79:8: error: 'long long type-name' is invalid uint long long i = ascii2uint64(buffer, digits); ^ 1 error generated. make: *** [build/release/protocol.o] Error 1 as suggested here, I added #ifdef __APPLE__ #include <sys/types.h> #endif // __APPLE__

'SmartyException' with message 'Missing template name' in Smarty

只愿长相守 提交于 2021-01-29 19:48:19
问题 I got the error saying "SmartyException' with message 'Missing template name...". I'd love to show the different page using display() in Smarty. I get the value from the url and deferenciate the page. I tried concatenate the single quote, but it doesn't really work. Any helps appreciate. index.html , confirm.html , finish.html exist in contact folder in a template directory. switch($_GET['param']) { case 1: confirmation(); break; case 2: send_email(); break; case 3: finish(); break; }

“Failed to run llvm optimizations” using clang++ for webassmebly

南笙酒味 提交于 2021-01-29 17:31:25
问题 I've installed emscripten-1.38.27 1 and fastcomp-clang-e1.38.27-64bit via the official emsdk tool. After running qmake and gettting no errors nor warnings,I ran make for my Qt project and that resulted in this(with EMCC_DEBUG=1 ): shared:DEBUG: executed emsdk-master/fastcomp-clang/e1.38.27_64bit/clang++ -target asmjs- unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=38 -D__EMSCRIPTEN_tiny__=27 -D_LIBCPP_ABI_VERSION=2 -Werror=implicit-function-declaration -nostdinc -Xclang