tagged [compiler-errors]

Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<AnonymousType#1>' to 'System.Collections.Generic.List<string>

Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.List I have the code below: But what about ``` List aa = (from char c1 in source from ch...

1 Aug at 10:30

Why can't I declare an enum inheriting from Byte but I can from byte?

Why can't I declare an enum inheriting from Byte but I can from byte? If I declare an enum like this ... ... it's working. If I declare an enum like this ... ... it's not working. The compiler throw :...

15 Feb at 15:6

Operator '??' cannot be applied to operands of type 'T' and 'T'

Operator '??' cannot be applied to operands of type 'T' and 'T' I have the following generic method, but VS gives me a compile error on that. (Operator '??' cannot be applied to operands of type 'T' a...

18 Jun at 22:32

What does "collect2: error: ld returned 1 exit status" mean?

What does "collect2: error: ld returned 1 exit status" mean? I see the error very often. For example, I was executing the following snippet of code: ``` void main() { char i; printf("ENTER i"); sca...

22 Jan at 01:57

C# Error: Parent does not contain a constructor that takes 0 arguments

C# Error: Parent does not contain a constructor that takes 0 arguments My code is I am getting the error: > Parent does not contain a constructor that takes 0 arguments. I understa

what does "error : a nonstatic member reference must be relative to a specific object" mean?

what does "error : a nonstatic member reference must be relative to a specific object" mean? ``` int CPMSifDlg::EncodeAndSend(char *firstName, char *lastName, char *roomNumber, char *userId, char *use...

What is the difference between warning codes cs0618 and cs0612

What is the difference between warning codes cs0618 and cs0612 I have seen both of the following warning codes being thrown for utilization of code marked obsolete. [cs0618](http://msdn.microsoft.com...

27 Apr at 23:23

cc1plus: error: unrecognized command line option "-std=c++11" with g++

cc1plus: error: unrecognized command line option "-std=c++11" with g++ I'm trying to compile using `g++` and either the `-std=c++11` or `c++0x` flags. However, I get this error ``` g++ (GCC) 4.1.2 200...

4 Jun at 18:20

ServiceStack: Error calling service

ServiceStack: Error calling service I have implemented the a ServiceStack sample service, just like in the documentation - github.com/ServiceStack/ServiceStack/wiki/Create-your-first-webservice The pr...

12 May at 00:25

Cannot resolve Assembly or Windows Metadata file 'System.Configuration.dll'

Cannot resolve Assembly or Windows Metadata file 'System.Configuration.dll' I am trying to compile a small test build (written in C#) in Visual Studio. However, I get two errors when trying so and can...

X11/Xlib.h not found in Ubuntu

X11/Xlib.h not found in Ubuntu I'm trying to write a rather trivial program using open gl on linux, but at a compile time it says: > Compile thumb : egl

8 Jun at 01:28

c++ compile error: ISO C++ forbids comparison between pointer and integer

c++ compile error: ISO C++ forbids comparison between pointer and integer I am trying an example from Bjarne Stroustrup's C++ book, third edition. While implementing a rather simple function, I get th...

9 Mar at 00:51

Compiler error "Default parameter specifiers are not permitted"

Compiler error "Default parameter specifiers are not permitted" Below is my code. ``` public class PItem { public String content; public int count; public int fee; public int amount; public ...

Cast null value to a type

Cast null value to a type If we cast some null variable to a type, I expect the compiler to throw some exception, but it doesn't. Why? I mean maybe in the first one, the `as` operator handles the exce...

Cannot assign void to an implicitly-typed local variable

Cannot assign void to an implicitly-typed local variable ``` var query = rep.GetIp() // in this line i have the error .Where(x => x.CITY == CITY) .GroupBy(y => o.Fam) .Select(z => new I...

How do I concatenate multiple C++ strings on one line?

How do I concatenate multiple C++ strings on one line? C# has a syntax feature where you can concatenate many data types together on 1 line. What would be the equivalent in C++? As far as I can see, y...

Duplicate AssemblyVersion Attribute

Duplicate AssemblyVersion Attribute I have a project that generates following error on compilation: > error CS0579: Duplicate 'AssemblyVersion' attribute I have checked the file `AssemblyInfo.cs` and ...

29 Oct at 12:36

Why is ;; allowed after a local variable declaration, but not after a field declaration?

Why is ;; allowed after a local variable declaration, but not after a field declaration? I saw this weird behaviour and I wonder if there's a reasonable explanation for this: When I put by ( by accide...

23 Dec at 01:18

Could not load file or assembly ... The parameter is incorrect

Could not load file or assembly ... The parameter is incorrect Recently I met the following exception at C# solution: > Error 2 Could not load file or assembly 'Newtonsoft.Json, Version=3.5.0.0, Cul...

"Non-static method cannot be referenced from a static context" error

"Non-static method cannot be referenced from a static context" error I have a class named `Media` which has a method named `setLoanItem`: I am trying to call this method from a class named `GUI` in th...

4 May at 11:32

Why can I pass 1 as a short, but not the int variable i?

Why can I pass 1 as a short, but not the int variable i? Why does the first and second Write work but not the last? Is there a way I can allow all 3 of them and detect if it was 1, (int)1 or i passed ...

Use Include() method in repository

Use Include() method in repository I have the following with EF 5: This works. Then I tried to replicate this in my generic repository: But in this case I am not

Compiler Error: "error CS0307: The variable 'int' cannot be used with type arguments"

Compiler Error: "error CS0307: The variable 'int' cannot be used with type arguments" If I have the following code: I get a compile-time error on the call to `Check(int, int)`: > error CS0307: The var...

23 Sep at 22:17

Static class declaring a protected member

Static class declaring a protected member I'm reading the book ["C# Language"](https://rads.stackoverflow.com/amzn/click/com/0321741765), and hit this note from Vladimir Reshetnikov: > If a static cla...

15 Feb at 16:6

error: expected primary-expression before ')' token (C)

error: expected primary-expression before ')' token (C) I am trying to call a function named `characterSelection(SDL_Surface *screen, struct SelectionneNonSelectionne sel)` which returns a `void` This...

27 Jul at 15:55