Implementing ERC2981.sol in an ERC721 contract

Hey folks,

I'm learning and experimenting with NFT royalties, for example, something like this:

    // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/common/ERC2981.sol";

contract MyToken is ERC721, Ownable, ERC2981 {
    constructor() ERC721("MyToken", "MTK") {}

    function safeMint(address to, uint256 tokenId) public onlyOwner {
        _safeMint(to, tokenId);
    }
}

this does not work though, I get:

Derived contract must override function "supportsInterface". Two or more base classes define function with same name and parameter types.

What would that function look like?

Thanks!

There is an implementation of ERC2981 on a ERC721, in there you can see that you would just need to override it like this:

/**
 * @dev See {IERC165-supportsInterface}.
 */
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC2981) returns (bool) {
    return super.supportsInterface(interfaceId);
}

oh great!
How did I miss that? lol
Thanks!