Missing Type Specifier Error (I specified std::string_view, though)

Osman Zakir 121 Reputation points
2022-02-24T17:17:39.743+00:00

I have this project that I made following an example code listing in my C++20 book. I have a whole bunch of compiler errors, though, first of which is this:

1>E:\programming\visual_studio_2019\Projects\beginningcpp20\Ex13_01\Ex13_01\Ex13_01.cpp(17,20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

I don't have any missing type specifiers on that line, nor are there really any syntax errors anywhere in the file. How do I fix this error?

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,689 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 45,236 Reputation points
    2022-02-24T17:57:13.04+00:00

    A couple of typo errors where the class name box (lower case 'b') was used instead of Box in Ex13_01.cpp.

    void show(const box& box1, std::string_view relationship, const Box& box2);
    
    void show(const box& box1, std::string_view relationship, const Box& box2)
    {
    ...
    }
    

    also in Box.ixx

        bool operator==(const Box& other_box)
    
    instead of 
    
        bool operator==(const Box& other_box) const
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.