simple dll help

Hello people,
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:

============================================================================
namespace Practice
{
class cppPractice
{
public:
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
#include <stdexcept>

using namespace std;
using namespace Practice;
namespace cppPrac
{
char* cppPractice::PersonalInfo(char name[], char age[], char school[], char address[])
{
char* Info;
Info = (name, age, school, address);
return Info;
}

}
========================================================================

Now, my errors are:

1.
error C2888: 'char *Practice::cppPractice::PersonalInfo(char [],char [],char [],char [])' : symbol cannot be defined within namespace 'cppPrac'


2.
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.

Please help!!
Thank you in advance for your answers, comments, etc.
You are mucking up your namespace names.

In your header the namespace is Practice

In your cpp file the namespace is cppPrac
Topic archived. No new replies allowed.