FAQ Database Discussion Community

## 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...

## 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:...

## “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...

## 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",...

## 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...

## 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...

## 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>...

## 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>...

## 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...

## “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...

## 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:...

## 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++:...

## 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...

## 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...

## 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...

## 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...

## 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);...

## 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...

## 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...

## 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...

## 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...

## 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...

## 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...

## 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....

## 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’...

## 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...

## 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 ?...

## 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);...

## 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...

## 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...

## 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....

## 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:...

## 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...

## 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/...

## 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...

## 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...

## compile md5 checksum in C but got compile error

c,struct,compiler-errors,md5

## 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...

## 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...

## 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...

## 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 =...

## 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 ->...

## 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....

## 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...

## 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...

## 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...

## 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...

## Getting 'Missing Lifetime specifier' error

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...

## 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...

## 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) ) ...