0
#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 Answers1

0

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.

Azeem
  • 11,148
  • 4
  • 27
  • 40
  • Thank you for your reply,and you are right. I think may be the editor needs to be configured, but I find the configure for a long time. – yan zhilong Nov 12 '17 at 10:23