Linker Error Undefined Symbol Main
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn undefined symbol _main in module c0.asm c++ more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags linker error undefined symbol in module Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up undefined symbol _main in module c0.ASM up vote 0 down vote favorite This program is being compiled successfully but giving following linking error : undefined symbol _main in module c0.ASM My program is following : #include #include int main() { char input[] = "hello sumit kumar"; char *a; a = input; printf("%s", a); getch(); return 0; } ` c share|improve this question edited Nov 4 '14 at 6:28 asked Nov 4 '14 at 6:21 Girjesh Shakya 13 Remove the #include and replace getch to getchar. –Puvanarajan Nov 4 '14 at 6:48 This is a linker error, and depends on how you compile and link the program. The C code itself is correct, assuming you are using Windows. –Thomas Padron-McCarthy Nov 4 '14 at 6:57 1 Since the error seems not to be in the code you have shown, you need to give details about how you build and link the project. What environment, such as Visual Studio or GCC, are you using? What kind of project have you created? How do you build it? –Thomas Padron-McCarthy Nov 4 '14 at 7:21 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote Assuming you are on linux: The following program would work. #include int main() { char input[] = "hello sumit kumar"; //Removed stray marks at the beginning char *a; a = input; printf("%s", a); getchar(); //To use getch() have to include file return 0; //Removed stray marks at the end } share|improve this answer edited Nov 4 '14 at 7:13 answered Nov 4 '14 at 6:30 Santosh A 3,3421025 Given that he includes conio.h, it is probably the Windows getch he meant, not the curses one. –Thomas Padron-McCarthy Nov 4 '14 at 6:55 @ThomasPadron-McCarthy, thanks for the info. updated my answer –Santosh A Nov 4 '14 at 7:13 This code is not working..... –Girjesh Shakya Nov 5 '14 at 6:00 @GirjeshShakya Tes
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, http://stackoverflow.com/questions/26728897/undefined-symbol-main-in-module-c0-asm just like you, helping each other. Join them; it only takes a minute: Sign up Linker error in turboc++: undefined symbol up vote 1 down vote favorite I am trying the following program on TurboC. I am getting a linker error for one of the function prototypes. The error is: undefined symbol checkbranch(char near*) in module http://stackoverflow.com/questions/9356340/linker-error-in-turboc-undefined-symbol student.cpp where student.cpp is the name of the file. The code compiles with no errors and I am not able to detect the error here. Any help would be appreciated. #include #include #include #include #include #include #include void checkbranch(char string[]); void checkusn(char string[]); void checksem(char string[]); void checkname(char string[]); fstream file; class iobuffer { public: char maxbyte[120]; iobuffer(); }; iobuffer::iobuffer() { for(int i=0; i<120; i++) maxbyte[i]='\0'; } class student { public: char usn[20], name[25], sem[10], address[20], branch[10]; student() { strcpy(name,""); strcpy(usn, ""); strcpy(sem, ""); strcpy(branch, ""); strcpy(address, ""); } void read(); void display(); void rsem(); void rname(); void rusn(); void rbranch(); void raddress(); }; void student::rusn() { cout<<"\n\tEnter the new usn: "; gets(usn); checkusn(usn); } void student::rname() { cout<<"\n\tEnter the name: "; gets(name); checkname(name); } void student::rsem() { cout<<"\n\tEnter the sem: "; gets(sem); checksem(sem); } void checkbranch(char string[]); void student::rbranch() { cout<<"\n\tEnter the branch: "; gets(branch); checkbranch(branch); } void student::raddress() { cout<<"\n\tEnter the address: "; gets(address); } void checkname(char arr[]) { for(int j=0; arr[j]!='\0'; j++) if((!isalpha(arr[j]))&&(a
Forum Visual C++ & C++ Programming C++ (Non Visual C++ Issues) Please find and correct the error in my c++ program. "Linker http://forums.codeguru.com/showthread.php?471578-Please-find-and-correct-the-error-in-my-c-program-quot-Linker-Error-Undefined-symbol Error: Undefined symbol If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 15 of 15 Thread: undefined symbol Please find and correct the error in my c++ program. "Linker Error: Undefined symbol Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode February 24th, 2009,06:02 AM #1 tharun518 View Profile View Forum Posts Junior Member Join Date Feb 2009 Posts 8 Please find and correct the linker error undefined error in my c++ program. "Linker Error: Undefined symbol Please find and correct the error in my c++ program. "Linker Error: Undefined symbol _main in module c0.ASM" The program is for transfering content of one file to another. #include #include #include class student { int rollno; char name[20]; int tm; public: void input(); void transfer(); void output(); } obj; void student::input() { char ch='y'; ofstream outf; outf.open("mark.dat"); while(ch=='y') { cout<<"Enter rollno, name and mark"; cin>>rollno>>name>>tm; outf.write((char*)&obj,sizeof(obj)); cout<<"wish to enter more(Y/N)"; cin>>ch; } outf.close(); } void student::transfer() { ofstream outf; ifstream inf; inf.open("mark.dat"); inf.open("trans.dat"); while(inf) { inf.read((char*)&obj,sizeof(obj)); outf.write((char*)&obj,sizeof(obj)); } outf.close(); inf.close(); } void student:utput() { ifstream inf; inf.open("trans.dat"); while(inf) { inf.read((char*)&obj,sizeof(obj)); cout<<"Rollno"<