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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:40:09+00:00 2026-06-15T08:40:09+00:00

My compiler issued the following error : matrix.o: In function `Matrix::modify_cell(unsigned int, unsigned int,

  • 0

My compiler issued the following error :

matrix.o: In function `Matrix::modify_cell(unsigned int, unsigned int, int)':
Matrix.cpp:(.text+0x5f): undefined reference to `operator!(Dim)'
Matrix.cpp:(.text+0xa3): undefined reference to `operator!(Dim)'
Matrix.cpp:(.text+0x178): undefined reference to `operator!(Dim)'
Matrix.cpp:(.text+0x1a0): undefined reference to `operator!(Dim)'
matrix.o: In function `List::nula(Dim) const':
Matrix.cpp:(.text._ZNK4List4nulaE3Dim[List::nula(Dim) const]+0x11): undefined reference to `operator!(Dim)'
list1.o:List - auxiliary methods.cpp:(.text+0x3b): more undefined references to `operator!(Dim)' follow
collect2: ld returned 1 exit status
make: *** [app] Error 1

Matrix is a class placed in file Matrix.h and Matrix.cpp that inherits from the class List, that in turn is placed in List.h and two other .cpp files. Type Dim (typedef) and operator! for it are declared globally (outside of any class) in aux.h included to List.h and the operator! is defined in aux.cpp. In Matrix.h I include List.h so I do not understand what is the problem. aux.cpp is indeed compiled in my makefile to .o and then joined into single app.

I know that it would be better to place my typedef Dim and its overloaded operator into a class, but it is used both in class List and class Matrix while typedefs are not inherited and I have no idea for any other workaround.

EDIT:

// aux.cpp
#include "aux.h"
Dim operator!(Dim dim) { return dim == COL ? ROW : COL; }

// aux.h
#ifndef AUX_H
#define AUX_H

/* (...) */

typedef enum { ROW, COL } Dim;
inline Dim operator!(Dim dim);

#endif
  • 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-15T08:40:10+00:00Added an answer on June 15, 2026 at 8:40 am

    You’ve declared operator!(Dim) as inline, so it isn’t available unless you also include the definition in the .h. Either move the definition or take out the inline.

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

Sidebar

Related Questions

Today I stumbled upon a rather interesting compiler error: int main() { int const
I incurred in a compiler dependent issue with the following code (stored in crtp.cc):
The compiler doesn't know where stat.h is? Error: c:\Projects\ADC_HCI\mongoose.c(745) : error C2079: 'st' uses
When installing rJava using the install.packages(rJava) command I get the following error: checking Java
I encountered the following error when installing Bugzilla in Solaris 10. Can anyone advise
On a web site I published (pre-compiled) last night, I get the following error.
The following code generates a compile error in Xcode: template <typename T> struct Foo
Okay, so I've been completely stumped by this compiler error for hours, and the
Look at the following infinite while loop in Java. It causes a compile-time error
I get the following error message while trying to publish my webservice in Vista

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.