I would like some help with why I am getting this error message.
I am trying to create C++project.
My steps are taken from msdn walkthrough with certain modifications for me to practice.
My header code is as follows:
static _declspec(dllexport) char* PersonalInfo (char name , char age, char school, char address);
static _declspec(dllexport) double LPI (double MyVisits, double ofc);
static _declspec(dllexport) char* Options(int a);
I did not encounter any problem with the above code, until I wrote my cpp file, which is as follows:
#include "Practice.h" //Practice.h is header name for the code above
using namespace std;
using namespace Practice;
char* cppPractice::PersonalInfo(char name, char age, char school, char address)
Info = (name, age, school, address);
Now, my errors are:
error C2888: 'char *Practice::cppPractice::PersonalInfo(char ,char ,char ,char )' : symbol cannot be defined within namespace 'cppPrac'
IntelliSense: function "Practice::cppPractice::PersonalInfo" cannot be defined in the current scope
Why am I getting those errors? I believe I did exactly it shows on msdn site, with just different types and functions.
Thank you in advance for your answers, comments, etc.
You are mucking up your namespace names.
In your header the namespace is
In your cpp file the namespace is