I am getting the following error when trying to compile my code: error LNK1561: entry point must be defined.
Background: I am trying to run a Win32 CONSOLE application and use the Google Tests framework.
I have my main function setup and I've already checked that my Linker
is set to Console (/SUBSYSTEM:CONSOLE)
per some other suggestions in many questions I've seen. I'm not sure why it doesn't like my main function, because that is defined as the entry point.
Here is my code:
bob.h
#ifndef BOB_BOB_H
#define BOB_BOB_H
#include <string>
using namespace std;
namespace bob {
string hey(const string&);
}
#endif
bob.cpp
#include "bob.h"
using namespace std;
namespace bob {
string hey(const string& theString)
{
return "Whatever."
}
}
bob_tests.cpp
// bob_tests.cpp : Defines the entry point for the console application
//
#include "bob.h"
#include <gtest/gtest.h>
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
TEST(Bob, stating_something)
{
EXPECT_STREQ("Whatever." bob::hey("Tom-ay-to, tom-aaaah-to."));
}