Search Results

Search found 535 results on 22 pages for 'compilers'.

Page 4/22 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Something is wrong with my C++ compilers [on hold]

    - by Karol Turbiarz
    WARNING!!! IT IS C++ but it uses domath ant rootBase LIBRARY, SOE I CAN MAKE SQARE ROOTS, AND OTHEr STUFF LIKE SIN, COS!!!!!! #include <iostream> #include <cstdio> #include <h.2> #include <time> #include <math> #include <domath> #include <rootBase> Then my code doesn't have any error (by the way I'm doing scientific calculator with squared root, line graphing, sin, cos, etc..) but then ... My debbuger finds problem here: if(math1 !== math2); MathCouldNotReadVoid2(); Which goes to void: void MathCouldNotReadVoid2(); { if(math1 ==! (math3 - math2)) { float decimalpoint(); using namespace std; using namespace fc; SquaredRoot(); float SquaredRootExponents(0.07839947388); float SquaredRootExponentFormForRootFormula((SquaredRootExponents *==)+ PiV); float SqRootFormulaStepOnePISHORTCUT(>=3.14'>DoMath<'<=7.2 * FgYt2 + 7.1107); } else main(); } That's the only one of my couple steps, for SquaredRoot, but it doesn't define the "=3.14'DoMath<'<=7.2*FgYt2+7.1107" step. I know some people may not know this type of "command" from the 'rootBase' library, but maybe some of you may know... Please help...Thanks.

    Read the article

  • How do C++ compilers actually pass reference parameters?

    - by T.E.D.
    This question came about as a result of some mixed-langauge programming. I had a Fortran routine I wanted to call from C++ code. Fortran passes all its parameters by reference (unless you tell it otherwise). So I thought I'd be clever (bad start right there) in my C++ code and define the Fortran routine something like this: extern "C" void FORTRAN_ROUTINE (unsigned & flag); This code worked for a while but (of course right when I needed to leave) suddenly started blowing up on a return call. Clear indication of a munged call stack. Another engineer came behind me and fixed the problem, declaring that the routine had to be deinfed in C++ as extern "C" void FORTRAN_ROUTINE (unsigned * flag); I'd accept that except for two things. One is that it seems rather counter-intuitive for the compiler to not pass reference parameters by reference, and I can find no documentation anywhere that says that. The other is that he changed a whole raft of other code in there at the same time, so it theoretically could have been another change that fixed whatever the issue was. So the question is, how does C++ actually pass reference parameters? Is it perhaps free to do copy-in, copy-out for small values or something? In other words, are reference parameters utterly useless in mixed-language programming? I'd like to know so I don't make this same code-killing mistake ever again.

    Read the article

  • Alternative C++ Compilers?

    - by Dr Hydralisk
    I want to start learning C++, so I downloaded Microsoft Visual Studio 2010 Express, and the entire application freezes and crashes every time I try to compile (debug and release build) something (I have tried running it in Admin Mode). Is there a good alternative compiler that I could still use VS 2010 as the IDE?

    Read the article

  • How a JIT compiler helps performance of applications?

    - by igorgue
    I just read that Android has a 450% performance improvement because it added a JIT compiler, I know what JIT is, but I don't really understand why is it faster than normal compiled code? or what's the difference with the older approach from the Android platform (the Java like run compiled bytecode). Thanks!

    Read the article

  • Invalid function declaration. DevC++

    - by user69514
    Why do I get invalid function declaration when I compile the code in DevC++ in Windows, but when I compile it in CodeBlocks on Linux it works fine. #include <iostream> #include <vector> using namespace std; //structure to hold item information struct item{ string name; double price; }; //define sandwich, chips, and drink struct item sandwich{"Sandwich", 3.00}; **** error is here ***** struct item chips{"Chips", 1.50}; **** error is here ***** struct item drink{"Large Drink", 2.00}; **** error is here ***** vector<item> cart; //vector to hold the items double total = 0.0; //total const double tax = 0.0825; //tax //gets item choice from user char getChoice(){ cout << "Select an item:" << endl; cout << "S: Sandwich. $3.00" << endl; cout << "C: Chips. $1.50" << endl; cout << "D: Drink. $2.00" << endl; cout << "X: Cancel. Start over" << endl; cout << "T: Total" << endl; char choice; cin >> choice; return choice; } //displays current items in cart and total void displayCart(){ cout << "\nCart:" << endl; for(unsigned int i=0; i<cart.size(); i++){ cout << cart.at(i).name << ". $" << cart.at(i).price << endl; } cout << "Total: $" << total << endl << endl; } //adds item to the cart void addItem(struct item bought){ cart.push_back(bought); total += bought.price; displayCart(); } //displays the receipt, items, prices, subtotal, taxes, and total void displayReceipt(){ cout << "\nReceipt:" << endl; cout << "Items: " << cart.size() << endl; for(unsigned int i=0; i<cart.size(); i++){ cout << (i+1) << ". " << cart.at(i).name << ". $" << cart.at(i).price << endl; } cout << "----------------------------" << endl; cout << "Subtotal: $" << total << endl; double taxes = total*tax; cout << "Tax: $" << taxes << endl; cout << "Total: $" << (total + taxes) << endl; } int main(){ //sentinel to stop the loop bool stop = false; char choice; while (stop == false ){ choice = getChoice(); //add sandwich if( choice == 's' || choice == 'S' ){ addItem(sandwich); } //add chips else if( choice == 'c' || choice == 'C' ){ addItem(chips); } //add drink else if( choice == 'd' || choice == 'D' ){ addItem(drink); } //remove everything from cart else if( choice == 'x' || choice == 'X' ){ cart.clear(); total = 0.0; cout << "\n***** Transcation Canceled *****\n" << endl; } //calcualte total else if( choice == 't' || choice == 'T' ){ displayReceipt(); stop = true; } //or wront item picked else{ cout << choice << " is not a valid choice. Try again\n" << endl; } }//end while loop return 0; //end of program }

    Read the article

  • How to create a language these days?

    - by Mike
    I need to get around to writing that programming language I've been meaning to write. How do you kids do it these days? I've been out of the loop for over a decade; are you doing it any differently now than we did back in the pre-internet, pre-windows days? You know, back when "real" coders coded in C, used the command line, and quibbled over which shell was superior? Just to clarify, I mean, not how do you DESIGN a language (that I can figure out fairly easily) but how do you build the compiler and standard libraries and so forth? What tools do you kids use these days?

    Read the article

  • Is there a g++ equivalent to Visual Studio's __declspec(novtable)?

    - by ceretullis
    Is there a g++ equivalent to Visual Studio's __declspec(novtable) argument? Basically, in a pure virtual base class the __declspec(novtable) argument can be used to suppress the creation of a vtable for the base class as well as vtable initialization/deinitialization code in the contstructor/destructor respectively. E.g., class __declspec(novtable) PureVirtualBaseClass { public: PureVirtualBaseClass(){} virtual ~PureVirtualBaseClass() = 0; }; See Paul DiLascia's article for more info. Also see my related question.

    Read the article

  • Is it possible to share a C struct in shared memory between apps compiled with different compilers?

    - by Joseph Garvin
    I realize that in general the C and C++ standards gives compiler writers a lot of latitude. But in particular it guarantees that POD types like C struct members have to be laid out in memory the same order that they're listed in the structs definition, and most compilers provide extensions letting you fix the alignment of members. So if you had a header that defined a struct and manually specified the alignment of its members, then compiled two apps with different compilers using the header, shouldn't one app be able to write an instance of the struct into shared memory and the other app be able to read it without errors? I am assuming though that the size of the types contained is consistent across two compilers on the same architecture (it has to be the same platform already since we're talking about shared memory). I realize that this is not always true for some types (e.g. long vs. long long in GCC and MSVC 64-bit) but nowadays there are uint16_t, uint32_t, etc. types, and float and double are specified by IEEE standards.

    Read the article

  • Aren't there compilers better at telling the programmer what's wrong in a code ?

    - by jokoon
    I have worked a little while with the Microsoft compiler from Visual C++ but I worked a long time with G++, and I remember often having bad times understanding what was wrong in my code with the former. Beside binary code generation and optimisation, I think this is a very important feature of a C++ compiler: giving the programmer a clue that makes him understand as fast as possible what is wrong with his/her code. I can understand some programmers understand programming as some sort of "competition" to make less errors, but to me that's a counter productive opinion. I once tried Clang compiler for C from the LLVM thingie, I didn't use it for a long time, but I was impressed on how explicit and easy to understand the error messages were. What are your experiences, and how do you think this matters ? Some WIP of C++ Clang: http://clang.llvm.org/cxx_status.html

    Read the article

  • How compilers know about other classes and their properties?

    - by OnResolve
    I'm writing my first programming language that is object orientated and so far so good with create a single 'class'. But, let's say I want to have to classes, say ClassA and ClassB. Provided these two have nothing to do with each other then all is good. However, say ClassA creates a ClassB--this poses 2 related questions: -How would the compiler know when compiling ClassA that ClassB even exists, and, if it does, how does it know it's properties? My thoughts thus far had been: instead of compiling each class at a time (i.e scan, parse and generate code) each "file (not really file, per se, but a "class") do I need to scan + parse each first, then generate code for all?

    Read the article

  • Why do C compilers prepend underscores to external names?

    - by Michael Burr
    I've been working in C for so long that the fact that compilers typically add an underscore to the start of an extern is just understood... However, another SO question today got me wondering about the real reason why the underscore is added. A wikipedia article claims that a reason is: It was common practice for C compilers to prepend a leading underscore to all external scope program identifiers to avert clashes with contributions from runtime language support I think there's at least a kernel of truth to this, but also it seems to no really answer the question, since if the underscore is added to all externs it won't help much with preventing clashes. Does anyone have good information on the rationale for the leading underscore? Is the added underscore part of the reason that the Unix creat() system call doesn't end with an 'e'? I've heard that early linkers on some platforms had a limit of 6 characters for names. If that's the case, then prepending an underscore to external names would seem to be a downright crazy idea (now I only have 5 characters to play with...).

    Read the article

  • Instance where embedded C++ compilers don't support multiple inheritance?

    - by Nathan
    I read a bit about a previous attempt to make a C++ standard for embedded platforms where they specifically said multiple inheritance was bad and thus not supported. From what I understand, this was never implemented as a mainstream thing and most embedded C++ compilers support most standard C++ constructs. Are there cases where a compiler on a current embedded platform (i.e. something not more than a few years old) absolutely does not support multiple inheritance? I don't really want to do multiple inheritance in a sense where I have a child with two full implementations of a class. What I am most interested in is inheriting from a single implementation of a class and then also inheriting one or more pure virtual classes as interfaces only. This is roughly equivalent to Java/.Net where I can extend only one class but implement as many interfaces as I need. In C++ this is all done through multiple inheritance rather than being able to specifically define an interface and declare a class implements it.

    Read the article

  • Are Fortran control characters (carriage control) still implemented in compilers?

    - by CmdrGuard
    In the book Fortran 95/2003 for Scientists and Engineers, there is much talk given to the importance of recognizing that the first column in a format statement is reserved for control characters. I've also seen control characters referred to as carriage control on the internet. To avoid confusion, by control characters, I refer to the characters "1, a blank (i.e. \s), 0, and +" as having an effect on the vertical spacing of output when placed in the first column (character) of a FORMAT statement. Also, see this text-only web page written entirely in fixed-width typeface : Fortran carriage-control (because nothing screams accuracy and antiquity better than prose in monospaced font). I found this page and others like it to be not quite clear. According to Fortran 95/2003 for Scientists and Engineers, failure to recall that the first column is reserved for carriage control can lead to horrible unintended output. Paraphrasing Dave Barry, type the wrong character, and nuclear missiles get fired at Norway. However, when I attempt to adhere to this stern warning, I find that gfortran has no idea what I'm talking about. Allow me to illustrate my point with some example code. I am trying to print out the number Pi: PROGRAM test_format IMPLICIT NONE REAL :: PI = 2 * ACOS(0.0) WRITE (*, 100) PI WRITE (*, 200) PI WRITE (*, 300) PI 100 FORMAT ('1', "New page: ", F11.9) 200 FORMAT (' ', "Single Space: ", F11.9) 300 FORMAT ('0', "Double Space: ", F11.9) END PROGRAM test_format This is the output: 1New page: 3.141592741 Single Space: 3.141592741 0Double Space: 3.141592741 The "1" and "0" are not typos. It appears that gfortran is completely ignoring the control character column. My question, then, is this: Are control characters still implemented in standards compliant compilers or is gfortran simply not standards compliant? For clarity, here is the output of my gfortran -v Using built-in specs. Target: powerpc-apple-darwin9 Configured with: ../gcc-4.4.0/configure --prefix=/sw --prefix=/sw/lib/gcc4.4 --mandir=/sw/share/man --infodir=/sw/share/info --enable-languages=c,c++,fortran,objc,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --disable-libjava-multilib --build=powerpc-apple-darwin9 --host=powerpc-apple-darwin9 --target=powerpc-apple-darwin9 Thread model: posix gcc version 4.4.0 (GCC)

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >