compiler-errors

OpenGL ES Tutorial - 'Winmain': function cannot be overloaded

I'm trying to learn OpenGL ES with the "OpenGL ES Training Course" (An OpenGL ES tutorial). I use OPENGL-ES 1.1 WINDOWS PC EMULATION with visual studio 2010. I'm trying to compile the 'hello triangle' program and get an error: 'WinMain': function cannot be overloaded EDIT: I have only one definition of WinMain in the project: The o...

Really, why does XCode always report every compile error twice?

So, get this: Ever since I've started using XCode to handle my software development (Objective C), I've tolerated the fact that every compile error (every) is being reported twice. I've never had an error count that was an odd number! So, if I have one syntax error, Xcode reports it twice. This is the same for even the static analy...

TestNG works fine for me but throws com.google.inject.internal.asm.util.TraceClassVisitor classnotfoundexception for other engineer

My ANT script runs without issue on my linux machine and on some xp VMs. When another engineer tries to kick it off locally, TestNG throws [testng] Caused by: java.lang.ClassNotFoundException: com.google.inject.internal.asm.util.TraceClassVisitor not found in (my libraries are all in here) I've never seen this class before and don't kno...

C++ template compilation error: expected primary-expression before ‘>’ token

This code compiles and works as expected (it throws at runtime, but never mind): #include <iostream> #include <boost/property_tree/ptree.hpp> void foo(boost::property_tree::ptree &pt) { std::cout << pt.get<std::string>("path"); // <--- } int main() { boost::property_tree::ptree pt; foo(pt); return 0; } But as soon a...

GCC 4.5: "checking whether the C compiler works... no" error when CFLAGS="-arch x86_64"

I compiled and installed GCC 4.5.1 via MacPorts in my installation of Mac OS X 10.6.4. When trying to ./configure software (such as, but not limited to: Wine 1.3.0, libjpeg, etc.), I set the compiler flag to CFLAGS = "-arch x86_64 -m64" to make sure that the compiled program will be 64-bit enabled. But I got an error during configure say...

Implicit type conversions - Compiler error.

This question is related to this question. The following code compiles fine VC9 compiler but gives the error when compied with Comeau online. Can anybody tell me which one is correct and what is the meaning of the error? error: ambiguous "?" operation: second operand of type "TypesafeBool" can be converted to third operand type ...

How to resolve compilation error "cannot convert const to reference" in VC++9

Hi, I am working in migration project from VC6 to VC9. In VC9 (Visual Studio 2008), I got compilation error while passing const member to a method which is accepting reference. It is getting compiled without error in VC6. Sample Program: class A { }; typedef CList<A, A&> CAlist; class B { CAlist m_Alist; public: const B& op...

socklen_t undeclared when compiling .c code

I am trying to compile this .c code in windows using MinGW (gcc file.c -o compiled.exe): /***************************************************/ /* AUTHOR : LAW CHIU YUEN */ /* FILENAME : smtpr.c */ /***************************************************/ #ifdef WIN32 #include <windows...

sqrt() function not working with variable arguments

I don't know if I'm missing something obvious, but it appears that I'm unable to compute square roots of a variable in C; the sqrt() function only seems to work on constants. This is my code: #include <math.h> #include <stdio.h> int main() { double a = 2.0; double b = sqrt(a); printf("%f", b); return 0; } When I run t...

How to fix nAnt ASPPARSE type exists in both issue

Hello, When I use nAnt to build my app I get this error: [exec] error ASPPARSE: c:\temp\TheaterSalesOut\DemoSite\EmailInvoice.aspx(13): error CS0433: The type 'Controls_OrderView' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\ab87bc79\8d2820ab\App_Web_8z8vmqbs.dll' and 'c:\WINDOWS\Microsoft.N...

Why is GHC complaining about wrong type?

This little function checks a (finite) Brainfuck string for validity. It check's whether the [ and ] are balanced. The code is very straightforward and written to be tail-recursive: -- checks Brainfuck for validity. validateBrainfuck :: Monad m => String -> m String validateBrainfuck s = maybe (return s) (fail . fromJust) (validate s 0)...

Is it possible to create a static library (single .lib file) that can be later compiled with either /MT, /MTd, /MD or /MDd?

Instead of creating 4 different libs (one for MT, MTd, MD, MDd) I want to create a lib that does not specify its dependency on C runtime library (CRTs). I tried to pass "/c /Zl" option to vc10 compiler, then /NODEFAULTLIB to lib command. Later when I use such lib I still have errors when I compile my program with switch different than d...

Skipping incompatible error when linking

I am compiling on a 64 bit architecture with the intel C compiler. The same code built fine on a different 64 bit intel architecture. Now when I try to build the binaries, I get a message "Skipping incompatible ../../libtime.a" or some such thing, that is indicating the libtime.a that I archived (from some object files I compiled) is no...

Objective-C and C

Hi! I try to use the "libmsrp", but when I try to compile the library, I have the following error: $ make so gcc -ggdb -shared -Wl,-soname,libmsrp.so.0 -o libmsrp.so.0.0.2 msrp.o msrp_session.o msrp_message.o msrp_relay.o msrp_switch.o msrp_callback.o msrp_network.o msrp_utils.o -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-...

How to prevent hide or override on a public property

I have an abstract base class that has a Property on it that I would like to prevent both hiding, aka new, and override on. public abstract class DomainObject { public bool IsDeleted { get; set; } } public class BankAccount : DomainObject { public bool IsDeleted { get; set; } } The issue is: I need BankAccount to inherit from...

error: no matching function for call to 'make_pair(int&, Quest*)'

...

Baffling gcc complaint about usage of Qt4 setValidator

We're stumped as to why gcc complains about this line in our app: doubleFrom->setValidator(new QDoubleValidator(doubleFrom)); with these complaints: error: expected type-specifier before 'QDoubleValidator' error: expected `)' before 'QDoubleValidator' error: no matching function for call to 'QLineEdit::setValidator(int*)' candidates ...

java won't compile with RequestDispatcher, classpath set correctly

I'm using ubuntu and I've been trying to compile based on my research and my previous posting regarding to compilation issue. This time I suspect CLASSPATH but cannot figure out what is wrong really. (The java file I want to complie) /home/makun/tomcat/apache-tomcat-6.0.26/webapps/head_first /src/com/masatosan/registerservlet/RegisterS...

Using OpenGL glutDisplayFunc within class

I've created a C++ class (myPixmap) to encapsulate the work performed by the OpenGL GLUT toolkit. The display() member function of the class contains most of the code required to set up GLUT. void myPixmap::display() { // open an OpenGL window if it hasn't already been opened if (!openedWindow) { // command-line ar...

C# Windows API Code Pack

I'm using Visual Studio 2010 Express for C# and am having trouble installing the code pack. I downloaded the source from MSDN and don't know what to do with it? I opened the WindowsAPICodePack.sln and attempted to build the project and got: Error 16 The type or namespace name 'ContentPropertyAttribute' could not be found (are you m...