The DLL which contains these functions looks like this:
1 2 3 4 5 6
// util.cpp
#define UTILDLL
#include "util.h"
// define the functions here
The executable which uses these functions looks like this:
1 2 3 4
// exec.cpp
#include "util.h"
// Do stuff involving those functions
When I compile this in VS 2010, I don't get any errors for the DLL, but the executable gives me:
util.h(13): error C2146: syntax error : missing ';' before identifier 'string'
util.h(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
util.h(14): error C2144: syntax error : 'int' should be preceded by ';'
util.h(14): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
util.h(14): error C2086: 'int utilityFunctions::UTILPART' : redefinition
util.h(13) : see declaration of 'utilityFunctions::UTILPART'
util.h(14): error C2086: 'string funcs::UTILPART' : redefinition
util.h(13) : see declaration of 'funcs::UTILPART'
it's a big file which is otherwise working properly, so i cut everything but the important bits (ie this namespace) and made it more readable. utilityFunctions is the implementation name for funcs
Have you removed usingnamespace std from your header file(s)?
If you really want to see what's going on, make the preprecessor write its output to a file and look at the file. Visual Studio will generate a .i file for preprocessor output.