Skip to content

Compilation fails with error: no match for ‘operator==’  #1

Description

@aravindprasad

The system is Ubuntu 20.04; GCC version: 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

Here is a more detailed error. Happy to provide any more details.

g++ -o ../../bin/proflex main.cpp -lm -g -Wall -Wundef -Wshadow
In file included from main.cpp:52:
makechem.cpp: In member function ‘void list::add_record(int)’:
makechem.cpp:327:9: error: no match for ‘operator==’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream’} and ‘long int’)
327 | if( fp == NULL)
| ^
makechem.cpp:327:9: note: candidate: ‘operator==(int, long int)’
makechem.cpp:327:9: note: no known conversion for argument 1 from ‘std::ifstream’ {aka ‘std::basic_ifstream’} to ‘int’
In file included from /usr/include/c++/9/bits/stl_algobase.h:64,
from /usr/include/c++/9/vector:60,
from main.cpp:47:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions