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

  • SEARCH
  • Home
  • 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 8959863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:32:30+00:00 2026-06-15T15:32:30+00:00

I have three simple files: Header file for a class > cat myhh.hh #include<iostream>

  • 0

I have three simple files:

Header file for a class

> cat myhh.hh
#include<iostream>

class helloworld
{
string str;
public:
void start(string &);
void stop(string &);
};

its corresponding cc file

> cat myhh.cc
#include<iostream>
#include "myhh.hh"
using namespace std;

void helloworld::start(string &str1)
{
  cout<< ""function started"<<endl;
}
void helloworld::stop(string &str2)
{
cout<< ""function stopped"<<endl;
}

Now the main function:

> cat mymain.cc 
#include<iostream>

#include "myhh.hh" 

int main()
{

helloworld obj;
obj.start(std::string("XXXX"));
obj.stop(std::string("XXXX"));


}
>

My primary intension is to generate a.out with these 3 files and when i execute it it should print:

function started
function stopped

i tried to compile but i am getting below errors.

> CC mymain.cc
Undefined                       first referenced
 symbol                             in file
void helloworld::stop(std::basic_string<char,std::char_traits<char>,std::allocator<char> >&) mymain.o
void helloworld::start(std::basic_string<char,std::char_traits<char>,std::allocator<char> >&) mymain.o
ld: fatal: Symbol referencing errors. No output written to a.out
> 

I am sure i am not getting the basics right.but its just i am trying to learn things of compilation process.
Could anybody please help?

  • 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-15T15:32:32+00:00Added an answer on June 15, 2026 at 3:32 pm

    You need to compile myhh.cc and link generated object as well

    $CC -c myhh.cc -o myhh.o
    $CC -o mymain mymain.cc myhh.o
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple JavaScript file that has three jQuery $document.ready functions. All three
I have a simple file browser and there I display files and folders, obtained
I have a header file with some inline template methods. I added a class
I have a fairly simple method in a class in a separate file, which
I have three source files in a folder. I simply want to compile them
I have a simple three table reference. It looks plain enough. The associations there
suppose I have a simple container which have three element: <div> <span>hello world</span> <input
I have a simple object that allows you to assign three properties (x,y,z) (lets
I have a very simple Setup project that copies three dlls into the GAC.
so I have a simple example--a fully crossed three treatment three context experiment, where

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.