Source Insight cannot find symbol

2.2k Views Asked by At
#include <iostream>
using namespace std;
template <class numtype>
class Compare
{
public:
    numtype* x;
};

class test
{
public:
    void fun(){
        std::cout << "fun" << std::endl;
    }
};

int main()
{
    Compare<test> a;
    a.x = new test();
    a.x->fun(); // <-- this line
    delete a.x;
    return 0;
}

The code is additionally in the picture just to show the problem clearly. I click fun() in main. I get an error saying "Symbol not found: fun". How do I fix it?

enter image description here

1

There are 1 best solutions below

1
Azeem On

Your code is okay and it ran successfully.
Here's the live run: https://ideone.com/JZmUvs

Maybe, you need to first clean and then build.