Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

C++ compiler for windows 7 64 bit ?

  • 10-02-2011 12:41pm
    #1
    Closed Accounts Posts: 6,556 ✭✭✭


    Hi ,
    can anyome recommend a good free compiler (command line would do but even better if it has a dev environment) for C++ on a 64 bit OS ? (win 7)

    Cheers


Comments

  • Closed Accounts Posts: 4,564 ✭✭✭Naikon


    the_monkey wrote: »
    Hi ,
    can anyome recommend a good free compiler (command line would do but even better if it has a dev environment) for C++ on a 64 bit OS ? (win 7)

    Cheers

    gcc compiler through Cygwin would fit the bill. Is the code you wish to write windows specific? If it is, sticking with Visual Studio may be the best bet. If not, Cygwin is quite decent. It's great to have a Unix enviroment within Windows imo.


  • Moderators, Education Moderators, Motoring & Transport Moderators Posts: 7,396 Mod ✭✭✭✭**Timbuk2**


    I haven't a clue about 64 bit, but I use the GCC Compiler through Codeblocks. I have 32-bit Windows 7.

    www.codeblocks.org


  • Registered Users, Registered Users 2 Posts: 14 blahound


    bloodshed dev C++?


  • Closed Accounts Posts: 6,556 ✭✭✭the_monkey


    <snip> ........


  • Closed Accounts Posts: 6,556 ✭✭✭the_monkey


    another thing, if i have a void main function, I get am error saying main needs to return an integer ????

    has c++ changed ??
    when I was in college a return; statement at the end of a main where main is void was fine -not even a warning - now i get an error cos of this.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    the_monkey wrote: »
    another thing, if i have a void main function, I get am error saying main needs to return an integer ????

    has c++ changed ??
    when I was in college a return; statement at the end of a main where main is void was fine -not even a warning - now i get an error cos of this.
    Can I write "void main()"?

    The definition
    void main() { /* ... */ }
    is not and never has been C++, nor has it even been C. See the ISO C++ standard 3.6.1[2] or the ISO C standard 5.1.2.2.1. A conforming implementation accepts
    int main() { /* ... */ }
    and
    int main(int argc, char* argv[]) { /* ... */ }
    A conforming implementation may provide more versions of main(), but they must all have return type int. The int returned by main() is a way for a program to return a value to "the system" that invokes it. On systems that doesn't provide such a facility the return value is ignored, but that doesn't make "void main()" legal C++ or legal C. Even if your compiler accepts "void main()" avoid it, or risk being considered ignorant by C and C++ programmers.
    In C++, main() need not contain an explicit return statement. In that case, the value returned is 0, meaning successful execution. For example:

    #include<iostream>

    int main()
    {
    std::cout << "This program returns the integer value 0\n";
    }
    Note also that neither ISO C++ nor C99 allows you to leave the type out of a declaration. That is, in contrast to C89 and ARM C++ ,"int" is not assumed where a type is missing in a declaration. Consequently:
    #include<iostream>

    main() { /* ... */ }
    is an error because the return type of main() is missing.
    http://www2.research.att.com/~bs/bs_faq2.html#void-main


Advertisement