compiler-errors

Getting the errors for code in unopened .aspx pages

Is there a way to check for errors in unopened *.ASPX pages. For example, if you change the name of a function Visual Studio will catch the error on the page and list it in the "Error List" only if the page is opened and being validated? I guess the question could be is there a validation option opposed to the compile option to check f...

Error CS0117: Namespace.A does not contain definition for Interface..

I'm getting the error: 'Namespace.A' does not contain a definition for 'MyObjectInterface' and no extension method 'MyObjectInterface' accepting a first argument of type ... I've looked at this and this and neither seems to apply. The code looks like: public abstract class Base { public IObject MyObjectInterface { get; set; }...

Using generics in F# to create an EnumArray type

I've created an F# class to represent an array that allocates one element for each value of a specific enum. I'm using an explicit constructor that creates a dictionary from enum values to array indices, and an Item property so that you can write expressions like: let my_array = new EnumArray<EnumType, int> my_array.[EnumType.enum_value...

Java Newbie can't do simple Math, operator error

Trying to do some really basic math here, but my lack of understanding of Java is causing some problems for me. double[][] handProbability = new double[][] {{0,0,0},{0,0,0},{0,0,0}}; double[] handProbabilityTotal = new double[] {0,0,0}; double positivePot = 0; double negativePot = 0; int localAhead = 0; int localTied = 1; int localBehi...

'Lexical' scoping of type parameters in C#

I have 2 scenarios. This fails: class F<X> { public X X { get; set; } } error CS0102: The type 'F<X>' already contains a definition for 'X' This works: class F<X> { class G { public X X { get; set; } } } The only logical explanation is that in the second snippet the type parameter X is out of scope, which is not true...

C++ (g++) Compile Error, Expected "="/etc. Before 'MyWindow" (my class name)

Hi all, I have a very strange problem and the following code wont compile: #ifndef MYWINDOW_HPP_INCLUDED #define MYWINDOW_HPP_INCLUDED class MyWindow{ private: WNDCLASSEX window_class; HWND window_handle; HDC device_context_handle; HGLRC open_gl_render_context; MSG message; BOOL quit...

What C++ templates issue is going on with this error?

Running gcc v3.4.6 on the Botan v1.8.8 I get the following compile time error building my application after successfully building Botan and running its self test: ../../src/Botan-1.8.8/build/include/botan/secmem.h: In member function `Botan::MemoryVector<T>& Botan::MemoryVector<T>::operator=(const Botan::MemoryRegion<T>&)': ../../src/Bo...

C header file won't compile with C, but will with C++.

I have the following chunk of a header file BKE_mesh.h: /* Connectivity data */ typedef struct IndexNode { struct IndexNode *next, *prev; int index; } IndexNode; void create_vert_face_map(ListBase **map, IndexNode **mem, const struct MFace *mface, const int totvert, const int totface); void create_vert_edge_map(ListBas...

Avoid compiling when using Decimal.Round() method (C#/CF)

Is there a way to tell to VS2005 to get compiler error when using "some defined" method? It probably sounds strange, but I do not want to compile when using Decimal.Round(). Reason: CF does not round by "awayfromzero", so I created a method to do this job. But sometimes I (and team) forget that is not to use Decimal.Round. So I'd lik...

Partial specialization with reference template parameter fails to compile in VS2005

I have code that boils down to the following: template <typename T> struct Foo {}; template <typename T, const Foo<T>& I> struct FooBar {}; //////// template <typename T> struct Baz {}; template <typename T, const Foo<T>& I> struct Baz< FooBar<T,I> > { static void func(FooBar<T,I>& value); }; //////// struct MyStruct { static con...

Visual Studio has stopped working - on Win 7

Hi I have Win 7 Enterprise. If i open any .cs file on VS 2008/2010 it gives a message " Visual Studio has stopped working" on a dialog box. There are two buttons "Debug" and "close program". Debug button starts devenv in debug mode with assembly code as i do not have the pdb file for the same. There is another machine with same configu...

Erroneous/Incorrect C2248 error using Visual Studio 2010

I'm seeing what I believe to be an erroneous/incorrect compiler error using the Visual Studio 2010 compiler. I'm in the process of up-porting our codebase from Visual Studio 2005 and I ran across a construct that was building correctly before but now generates a C2248 compiler error. Obviously, the code snippet below has been generic-i...

Visual C++ doesn't see operator<< overload

I have a vector class that I want to be able to input/output from a QTextStream object. The forward declaration of my vector class is: namespace util { template <size_t dim, typename T> class Vector; } I define the operator<< as: namespace util { template <size_t dim, typename T> QTextStream& operator<<(QTextStream& out, const ut...

Need help figuring out scala compiler errors.

Hello all, I have been working on a project in scala, but I am getting some error messages that I don't quite understand. The classes that I am working with are relatively simple. For example: abstract class Shape case class Point(x: Int, y: Int) extends Shape case class Polygon(points: Point*) extends Shape Now suppose that I create...

qt moc.exe error

i'm using QT Creator 1.3.1 and trying to compile, but get this error... please help me get rid of it mingw32-make[1]: Leaving directory `C:/Documents and Settings/eyalk/My Documents/My QT Projects/XML' mingw32-make: Leaving directory `C:/Documents and Settings/eyalk/My Documents/My QT Projects/XML' 'C:/Qt/2010.02.1/qt/bin\moc.exe' is no...

That darn C2679 error again VC++

Hi, Have a Day class that contains members to hold data. I have a RedBlackTree class that contains an array of Day objects. Day m_list[MAX_LIST]; This code above causes this error: Error 3 error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const Month' (or there is no acceptable conversion) ...

which RDBMS or other tool provides good SQL syntax error messages?

I use MySQL and it gives no meaningful error messages beyond "syntax wrong close to something or other". This is in sharp contrast to the sort of nice, clear error messages we are used to getting from java compiler and similar. So, are there RDBMS or sql validation tools that provide clearer, meaningful error messages? ...

compiling on Snow Leopard: i686-apple-darwin10-g++-4.0.1: language library.a not recognized

I'm compiling and linking against a library in Snow Leopard. I have never seen an error like it: i686-apple-darwin10-g++-4.2.1: language library.a not recognized I'm compiling an application to link statically with a proprietary library and wxWidget 2.9. Have anyone seen something like this before? ...

Xcode compile error: Can't find an (old) file I used to have

This is what happens when I try to compile my iPhone app with Xcode v3.1.4 What in the world does it all mean? (And how do I fix it?) Processing /Users/carol/Documents/MyApp/build/Release-iphonesimulator/MyApp.app/Info.plist TabBarDemo2-Info.plist cd /Users/carol/Documents/MyApp setenv PATH "/Developer/Platforms/iPhoneSimulator.pl...

Java multiple generic collection parameters compile error

So strange! Please have a look the code first: public class A { } public class B extends A { } public class C extends A { } public class TestMain { public <T extends A> void test(T a, T b) { } public <T extends A> void test(List<T> a, List<T> b) { } public void test1(List<? extends A> a, List<? extends A> b) { } public ...