compiler-errors

Removing Code Linking for Different Targets in XCode - iAds

I have an app I am working on which has been split into two targets, one for the iPhone and one for the iPad. The iPhone side (w/iAds) runs perfectly, but the iPad target gives me errors. It basically boils down to the iPad target not recognizing the iAd framework. I've tried weak linking but I still get iAd/iAd.h: No such file or dire...

Is there a way to generate a compiler error?

I want to define a Nibble type. I want that if the user sets the value higher than 0xf, it should generate a compiler error. Is this possible? ...

' " ' and " ' " in Java .. How to deal with them ?

I'm writing this in JAVA : stmt.executeQuery("SELECT * FROM mytable INTO OUTFILE '/tmp/mytable.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' ;"); This is has to be written between " " as show because It has to be a String. However, when I run the code it says "Unclosed String and Cha...

g++ duplicate symbol error when working with templates (noob question)

Hi, So I'm trying to pick C++, and to do so I decided to write a generic Group class using templates, that takes a Type and size as template parameters: in group.h: #ifndef __GROUP_H #define __GROUP_H #define MAX_SIZE 10 /********************************************************** * Define a Group class that handles a collection of m...

Why can a Boost.Bind function be called with extra parameters?

#include <iostream> #include <string> #include <boost/bind.hpp> void foo(std::string const& dummy) { std::cout << "Yo: " << dummy << std::endl; } int main() { int* test; std::string bar("platypus"); (boost::bind(&foo, bar))(test, test, test, test, test, test, test, test); } When run, it prints out, "Yo: platypus." It...

Another 'x was not declared in this scope'

Hi to all, this is my first question here. Writing some code, i receive this error from g++: "Entity was not declared in this scope", in this context: #ifndef Psyco2D_GameManager_ #define Psyco2D_GameManager_ #include <vector> #include "Entity.h" namespace Psyco2D{ class GameManager{J private: std::vector<Entity> enti...

"Cannot find symbol" when testing Java code

I've started writing a class to model a matrix and the compiler gives me this message: Matrix.java:4: cannot find symbol symbol : constructor Matrix(int[][]) location: class Matrix Matrix y = new Matrix(x); This is the code that I was trying to compile: public class Matrix<E> { public static void main(String[] args) { i...

Header inclusion and compiler errors

In my CPP file I have a call that is: pt.x = mDownPoint.x + FSign(pt.x-mDownPoint.x) * FMax( FAbs(pt.x-mDownPoint.x), FAbs(pt.y-mDownPoint.y) ); I get compiler errors for FSign, FMax, FAbs, but I include the header file where they are at. So I don't see why it would not find it, unless I have done something wrong in the creat...

Set.size() doesn't match the number of elements in iterator

Why doesn't Set.size() match the number of elements in the set's iterator? I'm using a HashSet, and I added some duplicate values. Those duplicates were automatically eliminated since I used a set. Set.size() is returning 16. When I actually iterate over the elements, I get 13. What can be causing this difference? Am I doing it rig...

What is wrong the Java enum definition

I defined public enum ABC in ABC.java and then compiled it to ABC.class. In another XYZ.java, I use private ABC _abc. XYZ and ABC are in some package. But it tells cannot find symbol class ABC. What is wrong? package teacherII; public enum Semester { Fall1999, Spring2000, Fall2000, Spring2001, Fall2001, Spring2002,...

how to declare templated map::iterator within a templated class. following code Says ; expected when compiled

the following code says error: expected ‘;’ before ‘forwit’ error: expected ‘;’ before ‘revit’ template<class T> class mapping { public: map<T,int> forw; map<int,T> rev; int curr; //typeof(forw)::iterator temp; map<T,int>::iterator forwit; map<int,T>::iterator revit; }; // }; // JVC: This was present, bu...

C++: Error C2064 with STL

I'm trying to use STL, but the following doesn't compile. main.cpp: #include <set> #include <algorithm> using namespace std; class Odp { public: set<int> nums; bool IsOdd(int i) { return i % 2 != 0; } bool fAnyOddNums() { set<int>::iterator iter = find_if(nums.begin(), nums.end(), &Odp::IsOdd...

How to compile .c file with OpenSSL includes?

I am trying to compile a small .c file that has the following includes: #include <openssl/ssl.h> #include <openssl/rsa.h> #include <openssl/x509.h> #include <openssl/evp.h> In the same folder where i have the .c file I have a /openssl with all those files (and more), also in synaptic package manager I see OpenSSL installed, I am tryin...

Execute commands if compiling fails with Make

With GNU Make and one of the compilers in gcc: Is it possible to execute commands if (and only if) the compiling fails? ...

Why do I get this syntax error in my code generating program?

I want to generate some lines of Perl code by using file handling in Perl, for example: open(FILEHANDLE, ">ex.pl") or die "cannot open file for reading: $!"; print FILEHANDLE "use LWP::UserAgent;" .... .... some code is here .... print FILEHANDLE "my \$ua = new LWP::UserAgent(agent => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; r...

how to compile an expression blend solution in visual studio

weWithin our development environment we have VS2010 installed on my computer along with Expresison blend and silverlight4 tools. We have a separate build box where we compile and build the entire project. When running through the precompile I am receiving errors that references to the expression blend namespaces cannot be found. I assum...

Visual Studio gone bonkers: 'The directory name is invalid' error when trying to compile

For some very odd reason, my Visual Studio 2008, when trying to compile a C# project, tries to write the output of the executable to a directory with the same name as an executable, at least it seems that that's what the error message implies. After running Compile on any of my projects, CSC.EXE reports the following compiler error: ...

Why can't i get much info from this compiler error?

I have developed an aspx in .net 3.5 sp1 in my local system. But my server doesn't have .net 3.5 sp1 but it does has 3.5. Error in this page. ANy suggestion. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and mod...

Compiling old Flex 2 application with FlashDevelop

I am having trouble compiling a project built in TextMate on a Mac. I have Flash Builder 4 and FlashDevelop on PC, and I cannot seem to compile the project even when I've downloaded the Flex 2 Hotfix 3 SDK. Flash Builder cannot work with Flex versions prior to Flex 3, so I'm left with Flashdevelop. When I assign the SDK path to point t...

problem returning CArray

Hi, I am trying to return CArray from a function and trying to call the function from another class short ListMaker::RetArray(CString szName, CArray<CString, CString&> &szarr_Names) { szarr_Names.Add(szName); return 0; } //////////// main() { .. CArray<CString, CString&> myArray; ListMaker LM; short nCode = LM.Re...