Function return type ambiguity on release and debug versions
I have two projects on one solution; say Project1 and Project2. Project1
includes only abstarct classes and their implementations, and it is added
as a referance to Project2. One of the functions, Connect() in Class1 in
Project1 is defined as follows;
public bool Connect() { ...TCP connection code }
On Project2, Connect function of Object1 is called as;
if (carlValentin.Connect() != false) {...}
Visual Studio 2010 is used as IDE. Here comes the oddness. When I choose
Debug as configuration, everything goes fine, compilation is done and
application runs. However, when I swtich the configuration to Release, I
get the following function return type error; Operator != cannot be
applied to the operands of type void and bool. Project1 does not include
any other overloaded methods for Connect function. As mentioned, Project2
is dependent into Project1. I suspect if it is a problem with the changes
I made, since previous definition of Connect had void as return type. But
I'm pretty sure that project build order is configured so that Project1 is
compiled first and then Project2 is built.
No comments:
Post a Comment