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 8629599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:50:59+00:00 2026-06-12T08:50:59+00:00

I am working on homework where I have to write a template and then

  • 0

I am working on homework where I have to write a template and then implement the template into a driver. Unfortunately, I’m receiving an error when compiling. I’m just beginning to learn the more complex aspects of C++, and I have no idea how to resolve this problem.

/tmp/ccdvvLpF.o:main.cpp: (.text$_ZN11LinkedQueueISsE7enqueueERKSs[LinkedQueue, std::allocator > >::enqueue(std::basic_string, std::allocator > const&)]+0x4a): undefined reference to LinkedQueue<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::number'
/tmp/ccdvvLpF.o:main.cpp:(.text$_ZN11LinkedQueueISsE7enqueueERKSs[LinkedQueue<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::enqueue(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x66): undefined reference to
LinkedQueue, std::allocator > >::number’
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: /tmp/ccdvvLpF.o: bad reloc address 0x66 in section `.text$_ZN11LinkedQueueISsE7enqueueERKSs[LinkedQueue, std::allocator > >::enqueue(std::basic_string, std::allocator > const&)]’
collect2: ld returned 1 exit status

Thanks.

  • 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-12T08:51:00+00:00Added an answer on June 12, 2026 at 8:51 am

    static int number is never defined. Add the following definition outside of your class.

    template <class T> int LinkedQueue<T>::number = 0;
    

    static members are special, static int number inside the class is only a declaration and not a definition. The reason for this is because headers are usually included in multiple translation units, so C++ forces you to define them outside of the class usually in a cpp file so that you do not get multiple definition errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on some homework and receiving the strangest error. Hoping you can help.
I am working on a homework assignment where I have to implement a MergeSort
I am working on a homework assignment, beginning C#. Have to accept input from
I have a homework problem here I've been working on; here is the description:
I am working on some homework here, but I have completely run out of
So I have been working on properly implementing a quicksort algorithm for a homework
Well, to be honest this is actually my homework where I have to implement
Good day, Stack Overflow. I have a homework assignment that I'm working on this
I'm working on some homework for my compiler class and I have the following
So I am working on some homework and I have to complete a size

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.