Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » "nice to meet you" program help(I think i either miscoded or my compiler is bad?)
"nice to meet you" program help [message #1783042] Wed, 07 March 2018 06:21 Go to next message
Bailey Johnston is currently offline Bailey JohnstonFriend
Messages: 15
Registered: February 2018
Junior Member
This is my code for the nice to meet you program and my compiler is cigwinn/mingw. I am taking a class basics of C++ programming, and i keep getting the error below. how do I fix this, and am I supposed to use an external console or the eclipse one? thanks

make: *** [src/subdir.mk:20: src/Udemy.o] Error 1

#include <iostream>
#include <string>
int main() {
std::string name;
std::cout << "what is your name?\n";
getline(std::cin, name);
std::cout << "nice to meet you";
std::cin.ignore();
return 0;
}
Re: "nice to meet you" program help [message #1783045 is a reply to message #1783042] Wed, 07 March 2018 07:01 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
make: *** [src/subdir.mk:20: src/Udemy.o] Error 1
simply means the recipe at line 20 of src/subdir.mk failed.

By itself, it means little.
You must have omitted all of the error messages that preceded it.

There doesn't seem to be anything wrong with your code.
It may be a CDT or installation configuration problem.
There isn't enough information to tell.

Please post the complete build log that you get from Project --> Build Project
Should look something like this:
01:56:50 **** Build of configuration Debug for project HelloWorldTest ****
make all 
Building file: ../src/HelloWorldTest.cpp
   :
   :
   :
Finished building target: HelloWorldTest

01:56:51 Build Finished (took 485ms) 
Re: "nice to meet you" program help [message #1783047 is a reply to message #1783045] Wed, 07 March 2018 07:32 Go to previous messageGo to next message
Bailey Johnston is currently offline Bailey JohnstonFriend
Messages: 15
Registered: February 2018
Junior Member
I can't even get the build log now because my editor keeps trying to build/run other projects in my workspace. do I need to put a new workspace every time?
Re: "nice to meet you" program help [message #1783048 is a reply to message #1783047] Wed, 07 March 2018 07:41 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
It should only try to build the current project with Project --> Build Project
Perhaps you selected Project --> Build All instead?
If you have any linked projects, unlink them until your issue is resolved.

Also: turn off Project --> Build Automatically for now.

[Updated on: Wed, 07 March 2018 07:44]

Report message to a moderator

Re: "nice to meet you" program help [message #1783190 is a reply to message #1783048] Thu, 08 March 2018 23:21 Go to previous messageGo to next message
Bailey Johnston is currently offline Bailey JohnstonFriend
Messages: 15
Registered: February 2018
Junior Member
what do you mean linked projects? and is the console supposed to appear as comand prompt, or just the console at the bottom of the page? these are all programs in the same worksapce, but with unrelated in wht they do code wise, so I assume they're not linked. sorry I am a fairly new programmer.
Re: "nice to meet you" program help [message #1783191 is a reply to message #1783190] Fri, 09 March 2018 00:39 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Yes, it is unlikely you have any.

Did you try Project --> Build Project
or did you actually select Project --> Build All instead?

You need to build the project to get the error messages that indicate why make failed.
The build console shows the build output results.
Probably it is where you saw the make error.

Looks like this
index.php/fa/32263/0/

Note that is starts "CDT Build Console".
If you don't see one, do Window --> Show View --> Console

There is also a Global Build Console selectable from a pull-down menu in the Console View.
Re: "nice to meet you" program help [message #1783261 is a reply to message #1783191] Sat, 10 March 2018 03:39 Go to previous messageGo to next message
Bailey Johnston is currently offline Bailey JohnstonFriend
Messages: 15
Registered: February 2018
Junior Member
I built the project alone in a new workspsace. this happened. compiler error?
  • Attachment: Bug.PNG
    (Size: 22.54KB, Downloaded 127 times)

[Updated on: Sat, 10 March 2018 05:16]

Report message to a moderator

Re: "nice to meet you" program help [message #1783264 is a reply to message #1783261] Sat, 10 March 2018 05:39 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Not a compilerr error. Your projet is misconfigured.
Read this on one way to resolve it:
https://www.eclipse.org/forums/index.php?t=msg&th=1092012&goto=1782973&#msg_1782973

Specifically,

    Create an HelloWorld project (with a different name);
    Delete the HelloWorld.cpp (which actually is <project name>.cpp);
    Copy your source into the src directory;
    Select a build configuration;
    Then build it.


You edited your post to say something about running your original project.
You posted an image of a build log that showed an incremental build was unnecessary.
I think you clicked "Run" and it ran a different project.
If so, you need to set up a launch configuration for your program.
https://help.eclipse.org/oxygen/topic/org.eclipse.cdt.doc.user/tasks/cdt_t_new_run_config.htm?cp=13_3_5_0_1
Actually, read the entire Running and debugging projects section.
NOTE: there is a documentation error.
To get to the configuration manager you should click on (pick one):
Run --> Run Congifurations ...
Run --> Debug Configurations ...

ALSO: there is no difference between the two except in the dialog presented.
They both use the same named launch configuration.



You seem quite confused about using the CDT framework.
Perhaps you should step back and read all of:
https://help.eclipse.org/oxygen/topic/org.eclipse.cdt.doc.user/concepts/cdt_o_home.htm?cp=13


[Updated on: Sat, 10 March 2018 14:49]

Report message to a moderator

Re: "nice to meet you" program help [message #1783397 is a reply to message #1783264] Mon, 12 March 2018 15:29 Go to previous messageGo to next message
Bailey Johnston is currently offline Bailey JohnstonFriend
Messages: 15
Registered: February 2018
Junior Member
is there a launch configuration section for the luna version?
Re: "nice to meet you" program help [message #1783411 is a reply to message #1783397] Mon, 12 March 2018 18:25 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
https://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Ftasks%2Fcdt_t_new_run_config.htm&cp=13_3_5_0_1

Suggest upgrading to Oxygen
Photon will be out soon, as well.
Previous Topic:Simple test case not finding include files
Next Topic:Breakpoint view does not update after deleting breakpoint in Debugger Console view
Goto Forum:
  


Current Time: Wed Apr 24 22:09:14 GMT 2024

Powered by FUDForum. Page generated in 0.03668 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top