FAQ Database Discussion Community

## java compilation error when using reflection with templates

java,templates,reflection,compiler-errors
I have this code: private <D extends Object> void foo(D d) throws IllegalAccessException, InstantiationException { d = d.getClass().newInstance(); // Compilation error: "Incompatible types: Required D, Found: Object" } Why do I get this error? To my understanding, the compiler knows that d is D type (which extends Object)...?...

## Can someone help me fix this error in Swift "Apple Mach-O Linker Error?

ios,xcode,swift,compiler-errors
"Linker command failed with exit code 1(use -v to invocation)". I don't understand what that means and not sure where to go to fix it. I looked at solutions in stackoverflow but none of them are working for me. I cleaned the project also but still not getting rid...

## How to throw an error in the LESS compiler

css,compiler-errors,less,throw,less-mixins
Question Is there any way to (programmatically) throw an error in the LESS compiler? Why? I have been fiddling around with mixin guards today, because I wanted to generate my CSS margin based upon element size and element count. I thought it would be cool to directly throw an error...

## Array in for-loop is not working for some reason

c++,arrays,for-loop,compiler-errors
I don't see why this won't compile when the syntax is correct: int arrows[1] = {23}; for(arrows[1]; arrows[1] < 300; arrows[1]++) { cout << arrows[1]; } Errors: error: expected unqualified-id before 'for' !! error: 'arrows' does not name a type !! error: 'arrows' does not name a type I am...

## Swift - String substringWithRange - 'String' is not convertible to '()'

string,swift,compiler-errors
I am trying some simple code, which I found on natashatherobot.com. var str = "Hello, playground" let rangeOfHello = Range(start: str.startIndex, end: advance(str.startIndex, 5)) let helloStr = str.substringWithRange(rangeOfHello) return helloStr It works fine when I try it in Playgrounds: But when I try using it in my Xcode project it...

## Using Increment operator with de-referencing in C

c,pointers,compilation,compiler-errors,dereference
To my function i get a void pointer, I would like to point to the next location considering the incoming pointer is of char type. int doSomething( void * somePtr ) { ((char*)somePtr)++; // Gives Compilation error } I get the following compilation error: Error[Pe137]: expression must be a modifiable...

## The type 'System.Runtime.InteropServices.SafeHandle' exists in both 'System.Runtime.InteropServices.dll' and 'System.Runtime.Handles.dll'

c#,dll,reference,compiler-errors,interop

## C: Error in Using: “Compound Assignment” and “Prefix Decrement” together

c++,c,compiler-errors,compound-assignment,prefix-operator
Can someone please tell me why the C compiler outputs an error while using a Compound Assignment and a Prefix Dec/Inc together ? [ but C++ does not ] int myVar = 5; (--myVar) -= 4; // C : error C2106: '-=' : left operand must be l-value // C++:...

## output with lseek and open functions, keep getting compile or running time error

c,compiler-errors,fwrite,truncate,lseek
I'm trying to running this code in my eclipse but I keep getting errors, so if anyone can tell me how to change this code so I get the output that would be great! anyways I have some basic questions on this code, I hope you can help What does...

## C++ with Qt compile fail

c++,qt,compiler-errors

## How to compile MapReduce job source code on Hadoop 2.7.0?

I running Hadoop 2.7.0 on ubuntu 14.0.2 O.S., and I create wordcount.java with nano text editor which the source code is copy from Apache Hadoop 2.7.0 Document. After I compile wordcount.java with this command javac -classpath hadoop-2.7.0-core.jar -d MyJava wordcount.java, here are the error messages I got. public class WordCount2...

## MultipartEntityBuilder.create cannot be resolved to a type

java,eclipse,compiler-errors
I try to create a multipartEntityBuilder in oder to send an httpRequest. The code i found was using MultipartEntity, so i changed that to MultipartEntityBuilder. MultipartEntityBuilder reqEntity = new MultipartEntityBuilder.create(); This gives me an error MultipartEntityBuilder.create cannot be resolved to a type I have added the httpmime-4.5.jar file in my...

## Fortran compiler for mac to read program

compiler-errors,fortran,fortran77,g77
I'm using the g77 compiler (on terminal I just type g77 filename.for ) on a Mac. It can't read my fortran program and I can't modify the program (very old program, not mine, and I really just need the output from it). Any suggestion for another compiler to read the...

## Could not find member in Swift (multiple instances)

ios,swift,compiler-errors
I am trying to build my Xcode project however, I keep getting "Could not find member " build errors in three different instances from the code below. Please help. Instances: Could not find member 'dataSource' self.pageViewController.dataSource = self 2&3. Could not find member 'Forward' self.pageViewController.setViewControllers(viewControllers, direction: .Forward, animated: true, completion:...

## Why do I need to add const to the argument?

linux,compiler-errors,g++,gtkmm
I have this function : void SpookyBoy( bool Troublemaker, const Glib::ustring& name, HorrorPunkBand& band ); if I remove the word const I got this error : no known conversion for argument 2 from ‘const char [5]’ to ‘Glib::ustring&’ I just wonder what does the compiler, can someone explains to me...

## Problems with iostream library and gcc

c++,gcc,compiler-errors,iostream
I have tried to compile many times a small C++ program but it fails everytime I used gcc to compile. I'm using Cygwin64 and this is the code: #include <iostream> #include <string.h> using namespace std; #define MAX 100 using namespace std; #define MAX 100 int main(){ int n; cout<<"Caantidad de...

## Multi-case parameterized active patterns returning error FS0722 Only active patterns returning exactly one result may accept arguments

compiler-errors,f#,active-pattern
Since I only found Japanese pages about this error, I figured, let's log it and ask here, since my Japanese is kinda rusty. If I have the following FSharp active pattern (simplified example): let (|InRange|OutOfRange|) from too = function | input when input >= from && input <= too ->...

## Multiple definition and file management

c,arrays,compilation,compiler-errors,include
I'm writing a program for vocabulary training, for myself. And the program itself should be available in different languages, atm in German and English. What I want is to have a Main File which manage all and two separate files for the functions in the right language. I compile all...

## Build Failure on Android Studio

After updating all the Google support libraries to the latest versions, from v21 to v22.2.0 and Play Services to v7.5, my project no longer builds successfully. The log i get is as follows: app:preDexDebug AGPBI: {"kind":"simple","text":"Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar ","sources":[{}]} AGPBI: {"kind":"simple","text":"Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar ","sources":[{}]} AGPBI: {"kind":"simple","text":"Picked up JAVA_TOOL_OPTIONS:...

## Building in VC6, need unsigned long long

visual-c++,compiler-errors
I need to build a purchased library (with source) that was built in VC 2010. We have to build with VC6. I ran across signed and unsigned "long long". I am using "_int64" for the signed type but was unable to find anything for the unsigned type. Has anyone run...

## Dereferencing pointer to incomplete type error for a structure member

c,arrays,struct,compiler-errors,dynamic-memory-allocation
I have checked the other questions with similar problems, but none of the solutions worked for my case. The problem in hand is, I am trying to create a stack with dynamic memory, using this struct: struct stekas{ int content; struct stekas *link; } *top = NULL; However, I'm running...

## Generics error syntax Java 1.7 on generics function

java,generics,compiler-errors,syntax-error
Using Java 1.7 compiler, it is interesting to note that the syntax accepted to call generic functions is very particular. It forces you to use this to refer to the generic function. For example for a function defined as: private <T> Object genericFunction(T t){ //function code } When referring to...

## illegal start of expression and ';' expected error

java,compiler-errors,semicolon
I am getting the illegal start of expression and ';' expected errors. I searched for similar problems but I couldn't solve my problem. public int compare(Point point1, Point point2) Here is the full method. public static void sortByX(List<? extends Point> points) { Collections.sort(points, new Comparator<Point>() ); { public int compare(Point...

## Using ocamlbuild to build SDL and OpenGL application

opengl,compiler-errors,ocaml,sdl,ocamlbuild
I am trying to create an OCaml program utilizing both ocamlsdl and lablgl, but I can not figure out how to compile it. The relevant information is below: Note: ocamlsdl is not found by ocamlfind. When I go to the lib directory of .opam, I find an ocamlsdl folder, but...

## post and pre increment not working as expected for REPL variable in scala

java,scala,compiler-errors,integer,post-increment
I know that there is no ++ and -- in scala instead I have to use += and -= But when I try scala> var a=2 a: Int = 2 scala> a +=1 scala> a res11: Int = 3 the above works fine but not the below one scala> 5...

## Declaring pointer to a 3 by 3 array and using pointer to print it

c,arrays,pointers,multidimensional-array,compiler-errors
How can i declare a pointer to an array of 3 by 3 and use that pointer to print it.... The compiler is giving the error "[Error] subscripted value is neither array nor pointer nor vector " #include <stdio.h> int main(void) { int A[3][3][3]={0}; int *ptr=A; int i,j,k; for(i=0;i<3;i++) {...

## conflicting types for my function “inverse”, which is designed to return long long type

c,function,compiler-errors,inverse,modular
I try to figure out what I did wrong here, basically the function is for calculating the module inverse number to a-1 mod m. but program is getting errors. can somebody point out what is causing the errors? //calculating the inverse of the public key, for getting private key d....

## os kern error : “ld: symbol(s) not found for architecture x86_64”

c++,architecture,compiler-errors,x86-64,clang++
I have looked all over Stack Overflow and other websites about this famous error, and all of them are very specific, and in my case I cannot find a solution. I am making an ncurses application and when i try to compile it, it causes the following error: Undefined symbols...

## Why array indexing not showing commutative behavior in this program?

c++,arrays,templates,compiler-errors
I know that array indexing is commutative in both C & C++, so a[i] is same as i[a] and it would have same effect as i[a] and both are valid. But recently I wrote a following program that fails to compile when I use i[intob] instead of intob[i]. #include <iostream>...

## Variable repeat error?

java,android,compiler-errors
Why am I getting a compile-time error in the following code? private static void phi(int n){ if(n > 1000) for(int i = 3; i <= n; i += 2) //do something else for(int i = 35; i <= n; i += 90) //do something } The error says java:22: error:...

## Double templated function overload fails

c++,visual-studio-2010,templates,compiler-errors,c++03
I have a template class, having various template functions. One of them need to be overloaded (a couple of times). Basically - if my class would not be a template, these would be my function(s): class OtherClass { public: template<class T> T foo(T &t, const std::string &trash); }; template<class T>...

## Program not compiling after casting pointer

c,pointers,casting,compiler-errors,void-pointers
Here is my code: #include <stdio.h> #include <string.h> #include <stdlib.h> #include <netdb.h> #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> int main (void) { struct addrinfo hints; memset (&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; hints.ai_flags = AI_CANONNAME; struct addrinfo *res; getaddrinfo ("example.com", "http", &hints, &res); printf ("Host: %s\n",...

## Compilation error when typedef an std::array

c++,arrays,compiler-errors,stdarray
I define a type called inputTy using std::array (c++11) , the dimension of the array declared as an external constant integer d. namespace project { namespace types{ extern const int d; typedef std::array<double, d> inputTy; } } Why do I get such compilation error? ../../include/types.h:16:29: error: the value of ‘d’...

## How do you fix c++ expected primary expression error?

c++,compiler-errors
So, i'm new to c++ programming, and as a assignment my teacher is having us create an app. I started coding it and this is what i came up with. I tried to compile the code in CodeBlocks and it gave me quite a few errors: error: expected primary-expression before...

## “Identifier Expected” error?

c#,unity3d,compiler-errors,unityscript,identifier
using UnityEngine; using System.Collections; public class Sword : MonoBehaviour { var totalhealth = 100; function OnTriggerEnter(other : Collider){ if(other.tag == "angelic_sword_02"){ totalhealth -= 50; } } function Update(){ if(totalhealth <= 0){ Destroy(gameObject); } } } I get an "Identifier Expected" in the script where it says in the line function...

## Glibc Compilation Error

linux,compilation,compiler-errors,make,glibc
I'm compiling glibc-2.12.1 in Ubuntu 10.10 (32 bit in VirtualBox). Steps followed: configure --prefix=/usr --disable-asm make [I'm building it from a new directory] I'm getting the following errors on running make: gcc ../sysdeps/i386/fpu/s_frexp.S -c -D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES -I../include -I/home/l33thckr/Installations/glibc-build/math -I/home/l33thckr/Installations/glibc-build -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/unix/sysv/linux/i386/i686...

## How to abort or stop JavaScript execution?

javascript,jquery,error-handling,compiler-errors
I am working in one example and that at some point(when something specific happen) to stop the execution of javascript code. Here is the row where I detect the error(rows number 36 at the DEMO): if(error_print === null){ s += "errors+='"+"You have error in row :" + (i+1) + "';";...

## Argument Type Problems

casting,compiler-errors,fortran
Why am I getting the following error d = Atan ( 1_Real32 / 110443_Real32 ) 1 Error: 'x' argument of 'atan' intrinsic at (1) must be REAL or COMPLEX The funny thing is that I get no problems when I use d = Atan ( Real(1,Real32) / Real(110443,Real32) ) ...

## Error : Expected expression before 'DATA /* : typedef struct DATA DATA */

I don't know what's the problem here my code. I read some questions of others that had the same problem , but I didn't found an answer. When I try to compile I get this errors : ||In function 'main':| |35|error: expected expression before 'DATA'| ||In function 'lecture_data':| |59|error: expected...

## setting objects equal to eachother (java)

java,methods,compiler-errors,equals
So I have a class called Person which looks like this public class Person { private String personName; public String toString(){ return personName; } public Person(String personName){ this.personName = personName; } } and another class in which I am creating the object(s) person public class IdanJavaTask { public static void...

## Deserialize JSON with Jackson into Polymorphic Types - A Complete Example is giving me a compile error

java,json,compiler-errors,polymorphism,jackson
I am attempting to work through a tutorial from Programmer Bruce that is supposed to allow the deserialization of polymorphic JSON. The complete list can be found here Programmer Bruce tutorials (Great stuff btw) I have worked through the first five with no problems but I have hit a snag...

## Implementing swift equatable protocol gives me bad access error. why?

ios,swift,compiler-errors,protocols
here is my code. it seems that when i subclass UIColor to make it equatable i get a memory error. why is that? class MyColor: UIColor, Equatable { var name: String init(name: String, r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat = 1.0) { self.name = name super.init(red: r, green:...