谁能告诉我是什么导致了这个错误?
/tmp/ccHWwGhh.o: In function `main': A2.cpp:(.text+0x407): undefined reference to `binarysearch(std::string, std::vector<std::string, std::allocator<std::string> >)' collect2: error: ld returned 1 exit status
这是我的代码:
//Located before main()
void binarysearch(string key, vector<string>& f2);
//Located in main()
binarysearch(key, file2);
//key is a string, file2 is a vector<string>
//Here is my code defining the function:
void binaraysearch(string key, vector<string> f2){
    sort_vector(f2);
    int mid = 0;
    int left = 0;
    int right = f2.size();
    bool found = false;
    while (left < right){
            mid = left + (left+right)/2;
            if (key > f2[mid]){
                    left = mid + 1;
            }
            else if(key < f2[mid]){
                    right = mid;
            }
            else{
                    found == true;
            }
    }
    if (found == true){
            cout << "YES: " << key << endl;
    }
    else{
            cout << " NO: " << key << endl;
    }
}