I want to check whether a value is equal to 1. Is there any difference in the following lines of code
Evaluated value == 1
1 == evaluated value
in terms of the compiler execution
So here's a snippet of my code:
struct dv_nexthop_cost_pair
{
unsigned short nexthop;
unsigned int cost;
};
map<unsigned short, vector<struct dv_nexthop_cost_pair> > dv;
I'm getting the following compiler error:
error: ISO C++ forbids declaration of `map' with no type
What's the proper way to declare this?
Hi, I've the Delphi Prism command line compiler... is there a free IDE that I can use? Must have intellisense etc just a plain editor no drag-drop required.
Hi,
I've got quite a large Xcode project that since an Xcode upgrade is giving me loads of
"'weak_import' attribute ignored"
warnings, they are coming from WebKit, and a bit of research suggests it's a compiler bug.
Is there anyway to suppress them, I'm getting thousands, making the 'real' warnings impossible to find.
Cheers
MT
Hello, when I get a compiler error (in my case gcc) in Emacs (version 23 for information) I use next-error Lisp function to jump to the next error :)
But when I do this the window is split vertically, but I want this to be done horizontally.
Anyone know how to modify this behavior?
Thanks
i have a program that receives data from a wireless device over bluetooth...i now need to do some operations in the data and then send it to the website (web server!!!) as a .csv file...i also need to authenticate the device itself from it hardware address which is also obtained in the program.i am coding this in gcc linux compiler using C...can anyone tell me how do i go about doing this?
I am writing a special-purpose mini-compiler and I often view disassembled CIL to figure out how to do things. But it's often not obvious how to translate the disassembled code to Reflection.Emit calls. Does a reference manual exist or any other source of information for doing this translation?
For this Java code:
String var;
clazz.doSomething(var);
Why does the compiler report this error:
Variable 'var' might not have been initialized
I thought all variables or references were initialized to null. Why do you need to do:
String var = null;
??
Most of the time, I prefer to write this :
if(isWelcome() == true){}
if(isWelcome() == false){}
instead of this
if(isWelcome()){}
if(!isWelcome()){}
Because I feel that it is easier to read (but I do understand that it doesn't make sense).
I would like to know if there is a common agreement about this practice. What most developer do? And I'm wondering if the compiler is doing the extra comparaison, or if it understand that it is useless.
First, my compiler and OS:
Qt Creator 1.3
Qt 4.6 (32 bit)
Windows 7 Ultimate
I want to learn how to create and import a dll in Qt. I've created a *.dll file using Qt Creator, called Shared1.dll which contains nothing but an empty class named Shared1. Now I'd like to use Shared1 class in another Qt project. How can I do that?
Thanks in advance.
Is there any way to write to the XCode build transcript? What i want to do, is throw a warning if a device is not attached to the computer instead of an assertion failure in my unit test cases (some cases rely on an attached ipod).
I thought of something like the standard compiler warnings (only with custom message).
Thanks.
I have a very simple DLL written in unmanaged C++ that I access from my application. I recently switch to Visual Studio 2010, and the DLL went from 55k down to 35k with no code changes, and now it will no longer load in Windows 2000. I didn't change any code or compiler settings. I have my defines setup for 0x0500, which should include Windows 2000 support. Has anyone else run into this, or have any ideas of what I can do?
I am curious as to why an implicit cast fails in...
int? someValue = SomeCondition ? ResultOfSomeCalc() : null;
and why I have to perform an explicit cast instead
int? someValue = SomeCondition ? ResultofSomeCalc() : (int?)null;
It seems to me that the compiler has all the information it need to make an implicit casting decision, no?
This new language called Vala, which is said to be C#-like and supposedly easier than C++ or C, compiles down into C on Linux with the GCC compiler.
Sounds great. Now I want to use it to make a PHP module so that slow PHP code can be made in Vala and imported into PHP as a function.
How do I accomplish this in Vala? Is it even possible?
I want to create a method sum that I can call on different types, specifically sum(1,2).
def sum[A](a1: A, a2: A) = a1 + a2
This fails because the compiler can't tell if A has a method '+'
I tried to define a structural type:
type Addable = {def +(a: Addable)}
This fails because of an illegal cyclic reference
How can I achieve this in a type safe way without requiring A to extend a specific trait?
Hi,
while(((long)(1000*ratio*((long)clock()-(long)t0))%100)/1000)<Data_Read_Rate);
The above line is generating the following error:
"Syntax Error before < token".
Why is this error coming up?
I use MINGW32 for development(GCC compiler).
Thanks...
I use Cmake with GNU Make and would like to see all commands exactly (for example how the compiler is executed, all the flags etc)
GNU make has --debug, but it does not seem to be that helpful are there any other options? Does Cmake provide additional flags in the generated Makefile for debugging purpose?
Hello.
Qt library includes advanced meta-programming capabilities using they own preprocessing moc compiler. Does anyone knows, is it possible to create some kind of mix-ins via it? For example, i have a QString and want to add a method to it without sub-classing and changing existing code. Does Qt have such solutions for that?
Hello,
In which case should you use primitive types(int) or complex types(Integer)?
Ex:
http://stackoverflow.com/questions/2508918/why-java-compiler-does-not-like-integer-as-type-for-values-in-hashmap this example works with Integer type. Should we always use Integer as a complex type?
Type mismatch. Expecting a LexBuffer but given a LexBuffer The type 'char' does not match the type 'byte'
This is the error message that I am getting while using fslex. I have tried manually checking every single occurrence of lexbuf and its type. It's LexBuffer everywhere. But still the compiler is giving me the above error. Can you please tell me why this error occurs and how to go about resolving it.
Thanks,
chandrasekhar
I have deployed successfully the dotnetopenid dll under IIS7 but on my shared hosting service it says:
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 modify your
source code appropriately.
Compiler Error Message: CS0246: The
type or namespace name 'DotNetOpenId'
could not be found (are you missing a
using directive or an assembly
reference?)
Why ?
I have gcc installed in c:/programfiles (also set as a path variable), and i have all the necessary files for gtk from http://www.gtk.org/download-windows.html, glib,gtk,pango,atk and cairo. Although I have no clue as to how to compile a c program using gtk with the gcc compiler. How do I set everything up so that it works?. (I don't know where each zip file goes.?) basically I don't really know where start.
When the c++ compiler generates very similar assembler code for a reference and pointer, why is using references preferred (and considered safer) compared to pointers?
I did see
Difference between pointer variable and reference variable in C++ which discusses the differences between them.
EDIT-1:
I was looking at the assembler code generated by g++ for this small program:
int main(int argc, char* argv[])
{
int a;
int &ra = a;
int *pa = &a;
}
I accidentally moved my Dynamic Data' folder into myImagesfolder. The project still compiles, but it's just not right. However, when I try to move it back to the root in Visual Studio, I get an error that the destination folder already exists. If I moveDynamic Data` back to the root outside of Visual Studio, the project no longer compiles because the compiler can't find any dynamic data files.
My infancy with git prompted me to ask here before embarking on an unpleasant 2am quest.
For example, let's use the Add method of the ArrayList class. If I am using the default compiler settings in Visual Studio C# project in which arithmetic overflow is not checked, would ArrayList.Add() throw an OverflowException if I added too many items? Would surrounding the method call with checked or unchecked make any difference?
BTW, I would write a test program to determine the answer to this question if I had Visual Studio available to me right now.