CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2012
    Location
    Slovenia
    Posts
    259

    C++ program will not compile in Eclipse

    This is my problem. What should I do to be able to compile this program?


  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,627

    Re: C++ program will not compile in Eclipse

    What are we supposed to do with that. You show the errors and you didn't post any code we can compile.

    Post real code using code tags.

    You may want to #include<iostream>

  3. #3
    Join Date
    Apr 2012
    Location
    Slovenia
    Posts
    259

    Re: C++ program will not compile in Eclipse

    I managed to create a hello wold program by now but it still wont run. After build i try to run it and i get this error. What is the problem?

    Last edited by flex567; September 19th, 2014 at 04:17 AM.

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,627

    Re: C++ program will not compile in Eclipse

    Is there some part of "Post real code using code tags" that is unclear to you?

    http://stackoverflow.com/questions/9...en-eclipse-for

  5. #5
    Join Date
    Apr 2012
    Location
    Slovenia
    Posts
    259

    Re: C++ program will not compile in Eclipse

    [code]#include <iostream>
    #include <typeinfo>
    using namespace std;

    int func() {
    return 42;
    }

    int main ( int argc, char ** argv ) {
    auto x = func();
    cout << x << endl;
    cout << typeid(x).name() << endl;
    return 0;
    }[\code]

  6. #6
    Join Date
    Apr 2012
    Location
    Slovenia
    Posts
    259

    Re: C++ program will not compile in Eclipse

    #include <iostream>
    using namespace std;

    int main() {
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    return 0;
    }

  7. #7
    Join Date
    Apr 2012
    Location
    Slovenia
    Posts
    259

    Re: C++ program will not compile in Eclipse

    your link doesn't help because it is for Android

  8. #8
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,627

    Re: C++ program will not compile in Eclipse

    Quote Originally Posted by flex567 View Post
    your link doesn't help because it is for Android
    But it's still Eclipse. I would imagine the problem is the same and the Android solution can be adapted to C++.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured