Less Inheritance Fails with "Undefined Class"

Less inheritance fails with undefined class

Since .dropdown-toggle is defined there inside .panel-heading class as part of the .dropdown .dropdown-toggle selector, it is not available as a standalone global scope mixin (like you try to invoke it). The .panel-heading and .dropdown classes work like namespaces in this case so to access .dropdown-toggle there you need to specify "complete path" to it, e.g.:

.my-toggle {
.panel-heading > .dropdown > .dropdown-toggle;
// or just:
.panel-heading.dropdown.dropdown-toggle;
// if you prefer shorter things
}

However this won't work the way you probably expect it to. Note that the .dropdown-toggle class is defined not only once inside .panel-heading but also several (~10) times inside other classes (e.g. .btn-group, .input-group-btn etc.). So if you need to get other .dropdown-toggle styles you also need to invoke these other .dropdown-toggle definitions.

Most likely extend will serve in this particular case better but it also has its limitations. Usually I imply that an approach to try to use Bootstrap as a CSS construction kit for your own semantic classes is a dead end. Some things are possible (using mixins, extend, referencing "bootstrap.css" and all of this all together) but many are just not (or at least are super-bloating both in coding (time) and in final CSS result). See my comments here, here and here for more details on this.

C++ class and inheritance error: undefined reference to derived class

Checking.cpp and Savings.cpp contain:

BankAccount::~BankAccount(){}

void BankAccount::setAccount(int account){
myAccount = account;
}

This causes undefined behaviour because you defined those functions in multiple files. You need to delete those lines from Checking.cpp and Savings.cpp, and instead put in definitions for the functions which are listed as being missing in the compiler output:

void Checking::setAccount(int account){
// code here
}

etc.

Undefined reference to, problem with inheritance - C++

The problem is here:

class Vessel{

...

public:

Vessel();

You'll need to provide a definition for the default ctor, for example Vessel() = default;

Note, you have a parameterized ctor for Vessel that's not utilized, at least not in your code snippet. Did you mean for that to be there? If so, did you mean to utilize it somehow? The way the code is written, you could just delete that.

C++ class inherance, undefined reference to base class member fuction

  1. ~LCD16x2() should be virtual.
  2. Do not redeclare methods in derived class, if you are not going to override them. Just remove their declaration from LCD16x2. If you are overriding, declare them as virtual in both base and derived class.

c++ class inheritance, undefined reference to 'Class::Constructor()'

Perhaps it's just me, but your Constructor here is a simple declration that's not been defined:

class StarSystem
{
public:
StarSystem(); // <--- Undefined!

You have a constructor declared, but there's no definition of what's actually going on in this constructor.

If it's a constructor that just does nothing, do

StarSystem () {} // Defined.
// Nothing happens inside, but everything gets default-constructed!

As a side note, when posting these kinds of things, it helps to post the error number and put a comment or some kind of indicator of where the error is happening (so we can see it in your giant blob of code).

EDIT:
As an important note, if you're not using that constructor at all, just delete it.



Related Topics



Leave a reply



Submit