An error that is generated during the compilation phase, often due to problems with invalid syntax and/or types. Compare to [runtime-error].
141
votes
21answers
210k views
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, ...
16
votes
3answers
3k views
Generics compiles and runs in Eclipse, but doesn't compile in javac
Note: This is a spin-off from Comparable and Comparator contract with regards to null
This code compiles and runs fine in Eclipse (20090920-1017)
import java.util.*;
public class SortNull {
...
40
votes
6answers
31k views
Anonymous method in Invoke call
Having a bit of trouble with the syntax where we want to call a delegate anonymously within a Control.Invoke.
We have tried a number of different approaches, all to no avail.
For example:
...
43
votes
4answers
21k views
Resolve circular dependencies in c++
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 ...
28
votes
5answers
2k views
Why vector<bool>::reference doesn't return reference to bool?
#include <vector>
struct A
{
void foo(){}
};
template< typename T >
void callIfToggled( bool v1, bool &v2, T & t )
{
if ( v1 != v2 )
{
v2 = v1;
...
10
votes
3answers
5k views
“Undefined reference to” template class constructor
I have no idea why this is happenning, since I think I have everything properly declared and defined.
I have the following program, designed with templates. It's a simple implementation of a queue, ...
17
votes
4answers
1k views
Public operator new, private operator delete: getting C2248 “can not access private member” when using new
A class has overloaded operators new and delete. new is public, delete is private.
When constructing an instance of this class, I get the following error:
pFoo = new Foo(bar)
example.cpp(1): error ...
42
votes
15answers
9k views
Recommended gcc warning options for C
Other than -Wall what other warnings have people found useful?
http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Warning-Options.html
14
votes
7answers
7k views
“code too large” compilation error in java
Is there any maximum size for code in java.. i wrote a function with more than 10,000 lines. Actually , each line assigns a value to an array variable..
arts_bag[10792]="newyorkartworld";
...
26
votes
4answers
5k views
Compiler error “expected method not found” when using subscript on NSArray
I wrote this simple code to try out the new Objective-C literal syntax for NSArrays:
NSArray *array = @[@"foo"];
NSLog(@"%@", array[0]);
The first line works fine, but the subscripting results in ...
16
votes
5answers
3k views
Deciphering C++ template error messages
I'm really beginning to understand what people mean when they say that C++'s error messages are pretty terrible in regards to templates. I've seen horrendously long errors for things as simple as a ...
32
votes
3answers
5k views
'Delegate 'System.Action' does not take 0 arguments.' Is this a C# compiler bug (lambdas + two projects)?
Consider the code below. Looks like perfectly valid C# code right?
//Project B
using System;
public delegate void ActionSurrogate(Action addEvent);
//public delegate void ActionSurrogate2();
// Using ...
10
votes
4answers
15k views
Compiler error: “initializer element is not a compile-time constant”
When compiling this code, I get the error "initializer element is not a compile-time constant". Can anyone explain why?
#import "PreferencesController.h"
@implementation PreferencesController
- ...
8
votes
3answers
3k views
Objective-C header file not recognizing custom object as a type
I'm working on a game for iPad using cocos2d which involves a board filled with different types of tiles. I've created a custom class called Tile as a general template for tiles and a few subclasses ...
21
votes
5answers
970 views
Why can't I declare an enum inheriting from Byte but I can from byte?
If I declare an enum like this ...
public enum MyEnum : byte {
Val1,
Val2
}
... it's working.
If I declare an enum like this ...
public enum MyEnum : System.Byte {
Val1,
Val2
}
...