Original Post
Hello,
I'm using Visual Studio 2012 and MSVC11 and get linker errors when using RegisterStdString function from the string addon when I enable namespaces.
I don't know if this is also the case for older compiler versions.
Fails with two linker errors (RegisterStdString and RegisterStdStringUtils):
[source lang="cpp"]#define AS_USE_NAMESPACE
#include
#include
using namespace AngelScript;
void test()
{
asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
RegisterStdString(engine);
RegisterStdStringUtils(engine);
}[/source]
Compiles like a charm:
[source lang="cpp"]#include
#include
void test()
{
asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
RegisterStdString(engine);
RegisterStdStringUtils(engine);
}[/source]
Is this a bug or am I doing something wrong?
Thanks in advance!
Edit: The forum removes include paths for some reason.
These are the files included:
Edit 2: Of course I'm compiling both scriptstdstring.cpp and scriptstdstring_utils.cpp.
I'm using Visual Studio 2012 and MSVC11 and get linker errors when using RegisterStdString function from the string addon when I enable namespaces.
I don't know if this is also the case for older compiler versions.
Fails with two linker errors (RegisterStdString and RegisterStdStringUtils):
[source lang="cpp"]#define AS_USE_NAMESPACE
#include
#include
using namespace AngelScript;
void test()
{
asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
RegisterStdString(engine);
RegisterStdStringUtils(engine);
}[/source]
Compiles like a charm:
[source lang="cpp"]#include
#include
void test()
{
asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
RegisterStdString(engine);
RegisterStdStringUtils(engine);
}[/source]
Is this a bug or am I doing something wrong?
Thanks in advance!
Edit: The forum removes include paths for some reason.
These are the files included:
Edit 2: Of course I'm compiling both scriptstdstring.cpp and scriptstdstring_utils.cpp.