Results 1 to 5 of 5

Thread: Getting Error in C++ code

  1. #1
    Join Date
    Oct 2010
    Posts
    87

    Getting Error in C++ code

    Hey friends I have recently joined the C++ classes. But yesterday when I was trying to compile this program at that time I was getting compile error. So in order to fix this I have tried to visit most of the site but I am not able to get the solution related to this. I am giving you my code over here so regarding this if you have any solution then please help me.
    Code:
    #include <iostream>
    
    
    int main()
    {
    
    	int number3;
         	int number4;
    	int sum;
    	
    	std::cout << "Enter first integer: ";
    	std::cin >> number3;
    		
    	std::cout << "Enter second integer: ";
    	std::cin >> number4;
    
    	sum = number1 + number2;
    
    	std::cout << "Sum is " << sum << std::end1;
    	
    	return 0;
    
    }
    And in this I have got this compile error so help me as soon as it is possible.
    Code:
    [abc@localhost ~]$ cd Desktop/C++
    [abc@localhost C++]$ make addition
    make: *** No rule to make target `addition'.  Stop.

  2. #2
    Join Date
    Jan 2010
    Posts
    325

    Re: Getting Error in C++ code

    Here I want to ask you that have you ever make in this a Make file which is created in ~/C++? I think if you make this your problem gets solved. Actually when I have started the c++ language at that time I have also faced this kind of error most of the time so I got this tips from my college sir. And after creating this my problem gets solved. So I hope you have to try this because it works in my case. But ya in this one more thing is there that I am not very much sure whether it will fully work in your case or not? But I will suggest you to give a try on this.

  3. #3
    Join Date
    Jan 2010
    Posts
    317

    Re: Getting Error in C++ code

    I also know this but in a very little amount but I think that information will help you so that is why I just want to share this information to you guys. A makefile is a type of a template. It informs gcc how to make a application. It informs gcc what type of command line alternatives to make use of, what type of objects to compile, and other belongings such as where to seem for headers files and shared libraries. If you do not wish for bother to learn 'make' you are able to do as many do, install an IDE such as Eclipse. That is what I did. So I hope this information will help you in order to get rid pof from the query which you are facing currently.

  4. #4
    Join Date
    Jan 2010
    Posts
    161

    Re: Getting Error in C++ code

    Here I agree with the previous replay. The reason behind this is that You do not actually have to have one in this it makes your program more easy if you use or if you have a lot of objects that are being compiled and connected into the concluding program. If you are just compiling single source file, you are able to make use of c++ on the command line if you make use of the correct options.

  5. #5
    Join Date
    Mar 2009
    Posts
    1,360

    Re: Getting Error in C++ code

    That is accurate, even though you almost or you can say that you never have to make use of a makefile and in this make is just used for expediency. So in this you just keep in mind lots of programs have hundreds of source files, and successively running "g++" and several other pieces of software, such as a linker on all of them would be fairly tiresome devoid of construct. And ya I am glad that on this I am able to help you.

Similar Threads

  1. startup error code:0x80090006 ,,unable to locate activation code
    By Mr.Walter in forum Windows XP Support
    Replies: 3
    Last Post: 04-01-2012, 06:08 PM
  2. Error Code 4400:011A and Error Code 0F00:133C
    By mkwn in forum Operating Systems
    Replies: 1
    Last Post: 14-10-2011, 12:39 PM
  3. Replies: 9
    Last Post: 10-04-2009, 01:51 AM
  4. Windows Update Error Code 80070422 and Error code 1058
    By CloudJames in forum Windows Update
    Replies: 4
    Last Post: 10-01-2009, 11:44 AM
  5. Replies: 2
    Last Post: 28-06-2007, 12:10 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,933,928.70826 seconds with 17 queries