Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bii test with gtest conflicts with mains #29

Open
danimtb opened this issue May 29, 2015 · 2 comments
Open

bii test with gtest conflicts with mains #29

danimtb opened this issue May 29, 2015 · 2 comments

Comments

@danimtb
Copy link
Member

danimtb commented May 29, 2015

In this example: http://docs.biicode.com/c++/examples/google-test-tutorial.html

When creating main function in math_ext.cpp like this:

#include "math_ext.h"
#include "iostream"

int Factorial (int num)
{
    if (!num)return 1;
    if (num<0)return -1;
    return num*Factorial(num-1);
}

int main(int argc, char **argv)
{
    std::cout<<Factorial(7)<<std::endl;
}

and doing bii test it repoorts:

 multiple definition of `main'
@danimtb danimtb changed the title bii test conflict with mains bii test with gtest conflicts with mains May 29, 2015
@udit043
Copy link

udit043 commented Aug 8, 2015

It runs fine ! I don't get any error , code runs perfectly.

@Manu343726
Copy link
Contributor

Could you please post the complete bii output here? Also note include "iostream" in your example, system headers (STL ones included) should use <>. I think using "" for these invokes implementation defined behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants