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
I'm currently porting a Windows 8.1 app to a Windows 10 UAP app which uses interop to communicate between C++ and C# and I'm having the following error popping up : $(ProjectName).Interop.g.cs : error CS0433: The type 'System.Runtime.InteropServices.SafeHandle' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5.1\System.Runtime.InteropServices.dll' and 'c:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\lib\McgDependencies\System.Runtime.Handles.dll' From...

Undefined reference to pico_dhcp_server_initiate when compiling PicoTCP for ARM mbed

c++,c,compiler-errors,makefile,embedded
I'm working on a project where I have to work with PicoTCP (see https://developer.mbed.org/users/daniele/code/PicoTCP/, I'm using an older version of this library). In my main.cpp file, I have the following code: #include "pico_stack.h" #include "pico_dhcp_server.h" int main(void) { // create DHCP server struct pico_dhcpd_settings s = { }; s.my_ip.addr =...

Typescript internal modules - unable to reference exported class within same module

javascript,compilation,compiler-errors,typescript,tsc
Hi! First off, sorry if this has been asked before, I tried some Googling but wasn't able to find anything (at least nothing that I recognised as being the same problem). I'm new to Typescript so still getting to grips! I'm making a little game as a project to brush...

Compass error: File to import not found or unreadable

css3,compiler-errors,compass
Just added Compass filters to my code base. // This file is main.scss @import "breakpoint"; @import "compass/css3"; @import "compass/css3/user-interface"; @import "compass/css3/transform"; // Just added filters. @import "compass/css3/filters"; @import "compass/utilities/general/clearfix"; @import "base/base"; @import "views/views"; Now the Compass compile task is failing and giving the following error: error wp-content/themes/example/styles/main.scss (Line 5: File...

Why does this compile under Java 7 but not under Java 8?

java,scala,compiler-errors,java-8,scala-collections
This seems to compile fine with Java 7, and any version of the Scala libraries: public static void main(String[] args) { scala.collection.immutable.Set<String> set = new scala.collection.immutable.HashSet<String>(); Iterator<String> iterator = set.iterator(); } It also compiles fine with Java 8 and Scala 2.11.5+. But with Java 8 and Scala 2.11.4, Eclipse complains:...

Cannot create a generic method: “T” not found

c#,generics,compiler-errors,ado.net
I am trying to implement a method that returns a generic list (List), but I keep getting this error message: The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?) This is my method code: public static List<T> doQuery(string query)...

iOS inline if else compile error: “Expected : ”; “Expected expression”

ios,objective-c,if-statement,compiler-errors
I am learning iOS programming (I come from Android) and I am looking for get Strings more easy. With this propose I define the next macro and use it in some code fragment: #define STRING_BASE @"InfoPlist" #define getString(string) NSLocalizedStringFromTable(string, STRING_BASE, @""); ... BOOL isSomething = YES; //or NO _label.text =...

Compile-time method call validation for multiple parameters of the same type

c#,methods,compiler-errors
Here is demonstration of the problem: class Program { static double Func(double a, double b) { return a * 1000 + b * b; } static void Main(string[] args) { var a = 1.1d; var b = 2.2d; Console.WriteLine(Func(a, b)); // this is the problem, function doesn't recognize when a...

C# - How to handle empty user input?

c#,compiler-errors
Hello everyone i'm still a beginner in programming in general. So my question is how to handle empty user input in my simple code?, it give's me error every time i press enter with out a value. My code: //Program to find the number is even or odd. using System;...

Unable to Access Anonymous Class Method in Java

java,compiler-errors,anonymous-class,anonymous-inner-class
I receive a compiler error whenever I attempt to invoke a method belonging to an anonymous class from the outer class. Example: public class Test { public static void main(String[] args) { Test testObj = new Test(){ public void doStuff(){ System.out.println("Test"); } }; testObj.doStuff(); } } The error the compiler...

Class Array usage generates the error “NullReferenceException: Object reference not set to an instance of an object”

c#,arrays,class,compiler-errors
I am currently working on a server system for a game called Reign of Kings. I am using hooks and commands given by the Oxide developers to make my server system. Back in the PAWN Language, we could do something like enumeration of player data inside an array, which converts...

“Generics add stability to your code by making more of your bugs detectable at compile time.” - Explained in laymen's terms?

debugging,generics,types,compiler-errors
"Generics add stability to your code by making more of your bugs detectable at compile time." I keep reading this everywhere, but I can't seem to find an explanation for why generics help make errors more detectable in compile time rather then run time. Maybe this might be answered somewhere...

Unhandled Exception when calling SipProfile.Builder from Android SIP Class

java,android,object,android-studio,compiler-errors
There is an error when creating a Builder object. This is my code: SipProfile.Builder builder = new SipProfile.Builder("address","username"); The error:: unhandled exception: java.text.ParseException This is a sample from Android Reference.: public SipProfile mSipProfile = null; ... SipProfile.Builder builder = new SipProfile.Builder(username, domain); builder.setPassword(password); mSipProfile = builder.build(); http://developer.android.com/guide/topics/connectivity/sip.html#manager...

Compile error when trying to print an integer in Rust v0.13.0

compiler-errors,rust
I thought this would work: let x = 5; println!("x = {}", x); But it gives the following compile error: main.rs:3:24: 3:25 error: unable to infer enough type information to locate the impl of the trait `core::fmt::Show` fo r the type `_`; type annotations required main.rs:3 println!("x = {}", x);...

Access to reference in member variable discards constness

c++,c++11,reference,compiler-errors,const
I made a wrapper around an object in my code that should modify accesses to the object. I choose to use an object here for testing instead of a functor that would have the same functionality. Basically: The wrapper receives a reference to the object and forwards all indexed accesses...

java parseint - Exception in thread “AWT-EventQueue-0” java.lang.NumberFormatException: For input string: “”

java,compiler-errors
I am writing a sudoku program in netbeans and heres the code: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { int[][] sudoku = new int [4][4]; sudoku[0][0] = Integer.parseInt(t1.getText()); sudoku[1][0] = Integer.parseInt(t2.getText()); sudoku[2][0] = Integer.parseInt(t5.getText()); sudoku[3][0] = Integer.parseInt(t6.getText()); sudoku[0][1] = Integer.parseInt(t3.getText()); sudoku[1][1] = Integer.parseInt(t4.getText()); sudoku[2][1] = Integer.parseInt(t7.getText()); sudoku[3][1] = Integer.parseInt(t8.getText());...

syntax error : missing ')' before 'constant'

c,compiler-errors,macros,syntax-error,c-preprocessor
I have some syntax problems that I don't know how to fix. I'm trying to build some functions to matrix, can someone help me resolve those problems? 1>c:\documents and settings\one\my documents\visual studio 2010\projects\hw3\hw3\q2.c(11): error C2143: syntax error : missing ')' before 'constant' 1>c:\documents and settings\one\my documents\visual studio 2010\projects\hw3\hw3\q2.c(11): error C2143:...

malloc doesn't allocate 3d array properly

c,arrays,pointers,compiler-errors,malloc
I am writing a program in c that would read the ppm input file and convert it to ASCII art. In the program, I alllocated a 3d array that would store the height and width of the input file and the RGB components. The array elements (pixels) would then be...

tcc: error: undefined symbol '[email protected]'

c++,c,compiler-errors
I'm making a program in C/C++ which must run hidden using this code: #define _WIN32_WINNT 0x0500 #include <windows.h> int main(){ HWND hWnd = GetConsoleWindow(); ShowWindow(hWnd, SW_HIDE); . . . } I really want to use tinyc to compile it because it's much better than gcc (almost, the final executable is...

Error: expected constructor, destructor, or type conversion before '=' toke

c++,compiler-errors,arduino
Not too sure why I am getting an error here. Working with an Arduino, and it's compiler. If anyone can help clear this up for me that would be greatly appreciated. unsigned char topState, leftState, rightState, fwdState, bwdState; topState = leftState = rightState = fwdState = bwdState = 1; Error:...

error: 'wxGraphicsContext' was not declared in this scope

c++,compiler-errors,wxwidgets
#include <wx/graphics.h> file included, wxWidgets 3.0.2 on Windows 7 compiled with USE_GDIPLUS=1 flag. and still I get this error error: 'wxGraphicsContext' was not declared in this scope What might be causing this? Thanks....

why is this code giving me “expected unqualified-id” error [closed]

c++,compiler-errors
here is the ideone link: https://ideone.com/0fqnCG #include <iostream> #include <string> using namespace std; int main() { string cases[8] = {"TTT", "TTH", "THT", "THH", "HTT", "HTH", "HHT", "HHH"}; int p, j, i; cin >> p; int sets[p]; string toss[p]; string new; for (i = 0; i < p; i++) { cin...

Compile error “No global operator found” for templated overloaded operator

c++,templates,compiler-errors
I've defined a template class and overloaded operators. When compiling, I get the following error message: error C2677: binary '+=' : no global operator found which takes type 'Class' (or there is no acceptable conversion) Here is the relevant code of the class: template<int foo> class Class { private: int...

Ternary operator in Java 8, compilation with Maven

java,maven,nullpointerexception,compiler-errors,primitive-types
Consider this class: package be.duo.test; public class Main { public static void main(String[] args) { Main main = new Main(); main.execute(); } private void execute() { for(int i = 0; i < 10; i++) { System.out.println("" + method()); } } private int method() { return (Math.random() > 0.5d) ? 1...

Implicit declaration of function and conflicting type - AVR

c++,c,compiler-errors,avr,atmega16
This is my first program for AVR. While building, the code is showing error: conflicting types for 'Encode' implicit declaration of 'Encode' I have written the following code: #include <avr/io.h> #include <util/delay.h> #include <stdlib.h> #define SegDataPort PORTC #define SegDataPin PINC #define SegDataDDR DDRC #define SegCntrlPort PORTD #define SegCntrlPin PIND #define...

cannot find symbol method get(int)

java,compiler-errors
For a game i'm making I need to place a tetris-like piece on a 10x10 game board. I want to return "occupied" if the player tries to put the piece on an occupied square on my board. For this, I've made an initial method that returns true if the square...

Visual Studio 2013: Error MSB4014: The build was aborted because of an internal failure

c++,visual-studio-2008,visual-studio-2013,compiler-errors
After using VS08 without any problem for several months, I've decided to install VS2013. Unfortunately, VS won't stop crashing after Building/Rebuilding/Cleaning a simple project. I have just created an empty project with a main.cpp file outputing "Test", but it keep posting this error. I have seen some posts about it...

ActionListener of JComboBox and initialize JPanel

java,swing,compiler-errors,actionlistener,jcombobox
I want to write program in which you can chance scene (JPanel) thanks to JComboBox. I used ActionListener, but it doesn't work. At the beginning of constructor I defined panel as final, but it didn't help. scene.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String choice = String.valueOf(scene.getSelectedItem()); if(choice=="Sceneria"||choice=="Scene"){ slider.setEnabled(false);...

Brace-or-equal initializer causing C2098 and C2059 in Visual Studio 2015 RC [duplicate]

c++,visual-studio,c++11,compiler-errors,visual-studio-2015
This question already has an answer here: non-static data member initialization with new expression 2 answers The following, seemingly correct looking, code does not compile in Visual Studio 2015 RC, with errors like this: test.cpp(6): error C2098: unexpected token after data member 'T' test.cpp(11): note: see reference to class...

what is the compile error in this code [closed]

c,linux,compiler-errors,fwrite,pid
I'm trying to get this output of this code in linux, but I get the following error: quiz5.c: In function ‘main’: quiz5.c:19:35: error: expected ‘)’ before ‘abcdefghi’ write(p[1], "abcdefghi', sizeof("abcdefghi")); ^ quiz5.c:19:44: warning: missing terminating " character [enabled by default] write(p[1], "abcdefghi', sizeof("abcdefghi")); ^ quiz5.c:19:35: error: missing terminating " character...

C++ - stoi() was not declared in this scope

c++,c++11,gcc,compiler-errors,codeblocks
I'm practicing my C++ by coding simple input/ouput from user. I have now been searching for over an hour on how to convert a string to an int. Every answer is different, and require something else. I'm using Code::Blocks v.13.12. MingW32 folder is added to environment variables. I ended up...

Float comparision in C [duplicate]

c,if-statement,compiler-errors,floating-point,floating-point-precision
This question already has an answer here: How dangerous is it to compare floating point values? 8 answers #include<stdio.h> int main() { float x = 0.6; if (x == 0.6) printf("IF"); else if (x == 0.6f) printf("ELSE IF"); else printf("ELSE"); } This code gives output ELSE IF #include<stdio.h> int...

Android findViewById(), getComponentName() and getSystemService(): Cannot make a static reference to a nonstatic field from type Activity

java,android,android-activity,compiler-errors
In the following class, I am getting the following three compiler errors in the enableAssistedSearch method. Cannot make a static reference to the non-static method getSystemService(String) from the type Activity Cannot make a static reference to the non-static method getComponentName() from the type Activity Cannot make a static reference to...

gcc compile multiple files

c++,c,gcc,compiler-errors
I have these five source main.c src_print1.c src_print2.c header_print1.h header_print2.h the contents are simple and are as following for respective files: main.c #include "header_print1.h" #include "header_print2.h" int main(int argc, char** argv) { print1(); print2(); return 0; } header_print1.h #ifndef PRINT_1 #define PRINT_1 #include <stdio.h> #include <stdlib.h> void print1(); #endif header_print2.h...

Dereferencing pointer to incomplete type error for struct member access in Python swig C wrapper

python,c,gcc,compiler-errors,swig
What is the error while compiling swig Python wrapper under GCC 4.8.2? wfdb_python_wrap.c:3967:11: error: dereferencing pointer to incomplete type if (arg1->fname) free((char*)arg1->fname); ^ wfdb_python_wrap.c:3967:36: error: dereferencing pointer to incomplete type if (arg1->fname) free((char*)arg1->fname); source code from wfdb_python_wrap.c: ... #include <wfdb/wfdb.h> ... #ifdef __cplusplus extern "C" { #endif SWIGINTERN PyObject *_wrap_WFDB_Siginfo_fname_set(PyObject...

C# - Not being able to use list.Count() in this scenario

c#,list,count,compiler-errors,protection
I've been getting this error during compile: System.Collections.Generic.List<string>.Count is inaccessible due to its protection level about trying to use the method Count() on a list I created that represents an inventory in my project. The list itself is public so I can't get my head around as to why this...

TreeMap Compile Error

java,compiler-errors
This is my code: import java.util.*; public class TreeMap { public static void main(String[] args) { Map<String,Integer> treemap = new TreeMap<String,Integer>(); Some code to fill the treemap ie treemap.put("Kevin", 36); } } And I am getting this compiler error: TreeMap.java:5: error: type TreeMap does not take parameters Map<String,Integer> treemap =...

Xcode : Compiler error Dictionary is not convertible to hashable

ios,xcode,dictionary,compiler-errors
I'm making an app in Xcode and the build fails even though there seem to be no errors in the code. I do, however, get this error: Compiler error Dictionary <>key, value <> is not convertible to hashable. How can I fix this? I have searched this but found nothing...

compile md5 checksum in C but got compile error

c,struct,compiler-errors,md5
Tried to follow the example in SO example, but when compiling the following, got error: $ gcc te.c te.c: In function ‘main’: te.c:10:17: error: storage size of ‘context’ isn’t known Here is the code: #include <string.h> #include <stdio.h> #include <openssl/md5.h> //#include <md5.h> int main(int argc, char *argv[]) { unsigned char...

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
I'm trying to compile the following short C++ program (not written by me) in Debian: $ cat checksig.cpp #include <QByteArray> #include <QDebug> #include <openssl/ec.h> #include <openssl/evp.h> #include <openssl/ecdsa.h> #include <openssl/sha.h> static EC_KEY* EC_KEY_pub_key ( const QByteArray& pub ) { static EC_KEY* eckey = EC_KEY_new_by_curve_name ( NID_secp256k1 ); const quint8* ppub...

No resource found that matches the given name (at 'label' with value)

android,xml,compiler-errors
So I ran into this problem trying to get my signed APK, I have referenced it in my strings.xml and have tried deleting it and rewriting it nothing seems to work this is my Manifest.XML. I am sort of a noob at coding and stuff so a simple and thorough...

Will Roslyn be part of the .NET framework?

c#,.net,github,compiler-errors,roslyn
Will Roslyn be part of the .NET framework? Which version and when? It is actually available at GitHub but it is fairly big and I'm not able to load it in Visual Studio 2013 on Windows 7 without errors....

Haskell: `==' is not a (visible) method of class

haskell,compiler-errors,instance,equality,typeclass
So, when I compile the following piece of code edited: instance (Eq a) => PartOrd a where [] == [] = True (x:xs) == (y:ys) = x==y && xs==ys _==_ = False xs /= ys = not (xs == ys) I get: `==' is not a (visible) method of class...

Getting 'Missing Lifetime specifier' error

compiler-errors,rust,lifetime
This is my code: use std::ptr; struct Query<T>{ data: T, prev: & Query<T>, next: & Query<T>, } impl<T> Query<T>{ fn new(name: T) -> Query<T>{ Query{ data: name, prev: ptr::null(), next: ptr::null(), } } } I keep getting 'missing lifetime specifier' where I am referencing &Query<T>. How do I fix this...

Compiling issue with ifort composer_xe_2015.3.187

compiler-errors,fortran
I am compiling my Fortran code with the latest Fortran compiler composer_xe_2015.3.187 on Ubuntu 14.04 64 bit system. I am using this compiler flag: -fp-model precise The error message is: f95: error: precise: No such file or directory f95: error: unrecognized command line option ‘-fp-model’ The same code does not...

split an equation with multicols on

compiler-errors,latex,equation,multicol
I would like to split my large equation in two column. But my file fails to compile when I try to use \{amsmath} and then split, multline, etc... The error says: Package amsmath Error: \begin{multline} allowed only in paragraph mode. \begin{multline} Does someone knows how to split a large equation...

Why this code got “unreachable statement” error?

java,compiler-errors,unreachable-code
I have the following method : char getChar(int I) { if (I<65+26) return (char)(I); switch (I) { case 91 : return '?';break; case 92 : return '#';break; default : return ' '; } } Why does it get "unreachable statement" error ?...

Why would a program compile for me, but not for another person?

java,compiler-errors,final
My code is below. It compiles fine for me, however my professor is saying he's getting an error because I don't have a few variables in my class declared final. Eclipse doesn't seem to have a problem with this on my machine so I don't know how to fix what...

bad operand types for binary operator compiling error

java,arrays,multidimensional-array,compiler-errors,operators
for a game i'm making I need to place a tetris-like piece on a 10x10 game board. I want to return "offboard" if the player tries to put the piece on a cell that is outside the board For this, I've made an initial method that returns true if the...

App crashing after pushing button, but the action is working

android,button,android-studio,compiler-errors
Maybe someone sees an error, the problem is that when i push btn2 (button 2) and btn3 (button 3) app crashes, but action still works, i.e video is running and PDF opens, while button 1 is working correctly... @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); configureImageButton(); mCamera = getCameraInstance();...

VS2008 Build C++ Project on Network Drive

c++,networking,visual-studio-2008,compiler-errors,virtual-machine
The short of it is, I have VMs for building different scenarios of software. I do not wish to snapshot the code as it is backup elsewhere so I am storing all my code on the host PC and only building/testing in VMs to save space. Unfortunately I am receiving...

unrecognized debugging option: 1 [enabled by default]

c,gcc,compiler-errors,makefile,cross-platform
I am writing a cross-platform gtk application for Windows and linux in C. Today I came across the strange compiler error in the title (which I have never seen before). This happens when I build my program in Windows, but not in Linux. When I build it in Windows via...

Call to implicitly-deleted copy constructor in LLVM(Porting code from windows to mac)

c++,osx,c++11,compiler-errors,llvm
We are in the process of porting some c++ code from windows to mac and are having issues compiling it with LLVM 6.1 using c++11. We are encountering errors all over the place of "Call to implicitly-deleted copy contructor" Some of these errors are popping up in our code. for...

Error when overwriting value in unsigned char array [closed]

c++,arrays,compiler-errors
Why do I get the error message error: invalid conversion from ‘const char*’ to ‘unsigned char’ [-fpermissive] if I try to overwrite a certain value in an array of data type unsigned char? The data type I want to overwrite the value is also a unsigend char....

Why does gcc search header files from non-exist folders?

c,linux,gcc,compiler-errors,make
I am trying to build an open source project shark on CentOS 7, and get very weird build errors: make: *** No rule to make target `/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdarg.h', needed by `core/luv/luv.o'. make: *** No rule to make target `/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h', needed by `core/luv/luv.o'. make: *** No rule to make target `/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/limits.h', needed...

Trying programming with C, Getting Expected x before Y type error

c,if-statement,compiler-errors
Trying my hand at C (Self teaching and using The New Boston guides) but trying to make a simple ask these questions and then if the answer matches then print X or Y. I have commented out yourAge as for what I'm doing i dont need it, It works if...

Can't reference a variable from App.config

c#,compiler-errors,app-config
I'm trying to reference a variable from App.config in my C# file. Here's a sample of my code. App.config: <appSettings> <add key="ErrorEmails" value="[email protected]"/> </appSettings> Code: SettingsIO setIO = new SettingsIO(); public static string To = setIO.ReadSetting("ErrorEmails"); The error reads: A field initializer cannot reference the non-static field, method, or preperty...

C++ template class compilation error message: error: expected a qualified name after 'typename'

c++,templates,compiler-errors,llvm,em++
I am trying to compile code from https://github.com/Sami-Vuorela/aatc I am compiling using LLVMs em++ compiler: em++: version 1.3.2 clang: vesion 3.6.0 Here is the console error message: /opt/emsdk_portable/emscripten/master/em++ -Qunused-arguments -U__STRICT_ANSI__ -Wall -fno-strict-aliasing -std=c++11 -DAS_WRITE_OPS=0 -DAS_USE_STLNAMES=1 -DAS_USE_FLOAT=0 -Iinclude/ -Iangelscript/sdk/angelscript/include/ -Iangelscript/sdk/add_on/scriptbuilder/ -Iangelscript/sdk/add_on/contextmgr/ -Iangelscript/sdk/add_on/scripthelper/...

LINQ to Entities does not recognize the method 'System.String ToString(Int32)'

c#,.net,linq,entity-framework,compiler-errors
Hi I am using a linq query which is throwing the error LINQ to Entities does not recognize the method 'System.String ToString(Int32)' method, and this method cannot be translated into a store expression. List<string> resultMap = (from item in mapResult select Convert.ToString(item.ResultDE)).ToList(); Error is throwing in this below statement List<Result_DE>...

Scala project won't compile with Bouncy Castle as dependency

java,scala,intellij-idea,compiler-errors,bouncycastle
I'm trying to use Bouncy Castle in my Scala project but for some reason it won't compile. I keep getting this error: Error:scalac: Error: object java.lang.Object in compiler mirror not found. scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found. at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17) at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18) at...

How to compile MapReduce job source code on Hadoop 2.7.0?

java,hadoop,compiler-errors,mapreduce
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

android,compilation,compiler-errors,android-gradle,build.gradle
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 */

c,struct,compiler-errors,linked-list,typedef
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:...