Extension methods must be defined in a non-generic static class

I’m getting the error: Extension methods must be defined in a non-generic static class On the line: public class LinqHelper Here is the helper class, based on Mark Gavells code. I’m really confused as to what this error means as I am sure it was working fine when I left it on Friday! using System; … Read more

Could not load file or assembly or one of its dependencies

I’m having another of these “Could not load file or assembly or one of its dependencies” problems. Additional information: Could not load file or assembly ‘Microsoft.Practices.Unity, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) I have no idea what is … Read more

No acceptable C compiler found in $PATH when installing python

I’m trying to install a new Python environment on my shared hosting. I follow the steps written in this post: mkdir ~/src wget http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tgz tar -zxvf Python-2.7.1.tar.gz cd Python-2.7.1 mkdir ~/.localpython ./configure –prefix=/home/<user>/.localpython make make install After coming to the ./configure –prefix=/home/<user>/.localpython command, I get the following output: checking for –enable-universalsdk… no checking for –with-universal-archs… … Read more

Non-static variable cannot be referenced from a static context

I’ve written this test code: class MyProgram { int count = 0; public static void main(String[] args) { System.out.println(count); } } But it gives the following error: Main.java:6: error: non-static variable count cannot be referenced from a static context System.out.println(count); ^ How do I get my methods to recognize my class variables? 15 Answers 15

Assign a variable inside a Block to a variable outside a Block

I’m getting an error Variable is not assignable (missing __block type specifier) on the line aPerson = participant;. How can I make sure the block can access the aPerson variable and the aPerson variable can be returned? Person *aPerson = nil; [participants enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { Person *participant = (Person*)obj; if ([participant.gender … Read more

Resolve build errors due to circular dependency amongst classes

I often find myself in a situation where I am facing multiple compilation/linker errors in a C++ project due to some bad design decisions (made by someone else 🙂 ) which lead to circular dependencies between C++ classes in different header files (can happen also in the same file). But fortunately(?) this doesn’t happen often … Read more

Why is this program erroneously rejected by three C++ compilers?

Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. I am having some difficulty compiling a C++ program that I’ve written. This program is very simple and, to the best of my knowledge, conforms to all the rules … Read more

What does a “Cannot find symbol” or “Cannot resolve symbol” error mean?

Please explain the following about “Cannot find symbol”, “Cannot resolve symbol” or “Symbol not found” errors (in Java): What do they mean? What things can cause them? How does the programmer go about fixing them? This question is designed to seed a comprehensive Q&A about these common compilation errors in Java. 17 s 17 0. … Read more

The located assembly’s manifest definition does not match the assembly reference

I am trying to run some unit tests in a C# Windows Forms application (Visual Studio 2005), and I get the following error: System.IO.FileLoadException: Could not load file or assembly ‘Utility, Version=1.2.0.200, Culture=neutral, PublicKeyToken=764d581291d764f7’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)** at … Read more

R cannot be resolved – Android error

I just downloaded and installed the new Android SDK. I wanted to create a simple application to test drive it. The wizard created this code: package eu.mauriziopz.gps; import android.app.Activity; import android.os.Bundle; public class ggps extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } … Read more