I"m tho a beginner because that C programming. In mine assignment I"ve encountered this problem and also I understand is a linker problem but I"m not sure just how to solve it. I"m make the efforts to connect 3 documents which 2 .c files and also 1 .h file. Below are the codes because that my file:

/*File driver.c (main file)*/#include #include "MDAnalysis.h"#include "MDAnalysis.c"int main()printScreen();return 0;/*File MDAnalysis.c*/#include #include "MDAnalysis.h"#include void printScreen(void)printf("Help me");/*File: MDAnalysis.h*/#ifndef _MDAnalysis_h#define _MDAnalysis_h/*Function prototypes*/void printScreen(void);#endifThese 3 documents are my codings. Ns hope someone can assist me out. I"m grounding at his trouble for long time. Thanks in advance. Appreciate your help.

You are watching: C++ id returned 1 exit status


c
00
Share
5 Contributorsforum4 Replies13,458 Views5 Years discussion Span

Recommended Answers


Answered byBanfa597in apost from11 Years ago

I think you mean Ld reverted 1 exit status.

Do girlfriend really median you make the efforts to attach the 2 c files and also the h file or execute you average you compiled the c files and also tried to connect the resulting objects?

The processor of building a regimen is

… jump to Post

All 4 Replies


*

Banfa597Posting pro Featured Poster
11 year Ago

I think you mean Ld reverted 1 leave status.

Do girlfriend really mean you make the efforts to link the 2 c files and also the h record or carry out you median you compiled the c files and tried to attach the resulting objects?

The processor of structure a regime is

Compile each individual source (.c) file producing an object document (.o or .obj)Link every the thing files created in phase 1 with any kind of require libraries

NOTE 1: you no compile or connect header (.h) files, they are had into resource (.c) files and the password the save on computer is compiled in that manner.

NOTE 2: it is really poor exercise to #include source files (.c) into other source files (.c) as you have done in your driver.c listing. Yet if you must/do do that climate you have to not separately compile the source (.c) the you included.

Normally the ide handles the build process for friend so the would assist us to understand what tools, compiler tool-chain and/or principle you space using.


00
Share
*

N1GHTS102Posting Whiz in cultivate
11 years Ago

Why don"t you take the printScreen function out of MDAnalysis.c and also move it right into driver.c after the key function. It can fix your difficulty perhaps.


00
Share
*

胤泰0Newbie Poster
5 years Ago

Just want to offer one more perspective for you and also for those who space haunted by bug message " Id went back 1 exist status ".

So here it is:

If girlfriend compile a C/C++ source paper with no main role to execute,there will certainly be a an insect message saying: " Id changed 1 exist status".

In her case,the an insect reporting files are MDAnalysis.c (for that is a C source record with no key function)but neither MDAnalysis.h (for it is not a C/C++ source file but a Header file)nor driver.c (for it has main funcion come execute)

However,please carry out remember,when we simply don"t need main function in a C/C++ resource file, it"s totally fine to leaving main function absent.In together a case, pest message " Id reverted 1 exist status" means nothing.

See more: How To Zoom In On Snapchat Video, How To Zoom In On Snapchat

To sum up,whenever you check out " Id reverted 1 exist status",just ask yourself:1. Is the compiled file a C/C++ source file?2. Walk the paper have main function?3. Do I deliberately leave main role absent for some reason?

If the answers space Yes, No, and also Yes respectively,which means"Yes, that is a C/C++ resource file.","No, that does not have main function.",and "Yes, I do deliberately leaving main function absent for part reason."it will be 100% good to ignore the bug message " Id returned 1 exist status".