Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8062349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:38:19+00:00 2026-06-05T10:38:19+00:00

main.cpp #include <iostream> #include Burrito.h using namespace std; int main(){ Burrito b; return 0;

  • 0

main.cpp

#include <iostream>
#include "Burrito.h"

using namespace std;

int main(){
  Burrito b;
  return 0;
}

Burrito.h

#ifndef BURRITO_H
#define BURRITO_H

class Burrito{
    public:
      Burrito();
};

#endif

Burrito.cpp

#include "Burrito.h"
#include <iostream>

Burrito::Burrito(){

}

Compile & Link :

lzsb$ g++ main.cpp -o main
Undefined symbols for architecture x86_64:
  "Burrito::Burrito()", referenced from:
      _main in ccVpCr0z.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
lzsb$ 

Platform:

Mac OS 10.6.8

G++ : i686-apple-darwin10 --with-gxx-include-dir=/usr/include/c++/4.2.1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:38:21+00:00Added an answer on June 5, 2026 at 10:38 am

    You need to compile the Burrito.cpp file as well. The compiler creates object files from each .cpp file and links them afterwards. This is where your call fails, because the linker can’t find the referenced Burrito class in any of your object files. To fix your compiler call just add Burrito.cpp

    g++ main.cpp Burrito.cpp -o main
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

main.cpp #include <vector> #include <iostream> #include normal.h using namespace std; int main() { return
I have this code main.cpp #include <iostream> #include functs.h using namespace std; int main()
I have simple Hello World C++ program (main.cpp): #include <iostream> using namespace std; int
How print format string passed as argument ? example.cpp: #include <iostream> int main(int ac,
I have 4 files: shared.h main.cpp something.h something.cpp shared.h: #ifndef SHARED_H #define SHARED_H int*
Given this code sample: complex.h : #ifndef COMPLEX_H #define COMPLEX_H #include <iostream> class Complex
These are my files: --------[ c.hpp ]-------- #ifndef _C #define _C #include<iostream> class C
I have the following source code in main.cpp: #include <iostream> #include <iomanip> int main()
// Penguin.h #include <map> #include <iostream> class Penguin { typedef void (Penguin::*PenguinMet)(); std::map<int, PenguinMet>
I have a code like this below in /root_project/main.cpp : #include theoraplayer/TheoraVideoClip.h unsigned int

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.