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 <angelscript.h>#include <add_on/scriptstdstring/scriptstdstring.h>using namespace AngelScript;void test(){ asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); RegisterStdString(engine); RegisterStdStringUtils(engine);}[/source]
Compiles like a charm:
[source lang="cpp"]#include <angelscript.h>#include <add_on/scriptstdstring/scriptstdstring.h>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:
<angelscript.h>
<add_on/scriptstdstring/scriptstdstring.h>
Edit 2: Of course I'm compiling both scriptstdstring.cpp and scriptstdstring_utils.cpp.
Edited by thewavelength, 21 September 2012 - 09:23 AM.






