Linker: Unresolved externals

I am trying to use AngelScript into my project but i keep gettig this annoying linker error: error LNK2019: unresolved external symbol _asCreateScriptEngine referenced in function "public: __thiscall EEngine::ScriptAbstr::ScriptAbstr(class LogMgr *)" (??0ScriptAbstr@EEngine@@QAE@PAVLogMgr@@@Z)

And i KNOW that i have included the file. It is just an .h file so i dont see why i get this problem!

Here is the code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef _SCRIPT_ABSTR_H_
#define _SCRIPT_ABSTR_H_
#include <fstream>
#include "angelscript.h"
#include "LogMgr.h"
#include <vector>
#include <iostream>
using namespace std;

namespace EEngine
{
class ScriptAbstr
{
public:
	ScriptAbstr(LogMgr* mLog);
	~ScriptAbstr();

	int loadScript(const char *filename, const char * module);
	bool printRecentScript();
	bool compileScripts(string aScriptList[]);

private:
	asIScriptEngine* scriptEngine;
	LogMgr* log;
	string scriptContent;

};
}

#endif 


and the function i am using it in:
1
2
3
4
5
6
7
8
9
ScriptAbstr::ScriptAbstr(LogMgr* mLog)
{
	log = mLog;
	scriptEngine = asCreateScriptEngine( ANGELSCRIPT_VERSION );
	if( scriptEngine == 0 )
	{
		log->logMessage(log->CRITICAL, "Could not create script engine!");
	}
}


Thanks for help in advance!
And where is the function asCreateScriptEngine defined that you are using in the statement?

scriptEngine = asCreateScriptEngine( ANGELSCRIPT_VERSION );
Last edited on
In the "anglescript.h" file.

But now when i look in it. I see no decleration!
Ok i just fixed the problem, but another arises. I had to change one of my classes name to LogManager instead of LogMgr because angelscript uses that name. Now all hell broke loose and i cant even compile my code. I get tons of errors saying that LogManager doen't exist!
You should find all occurences of he name LogManager and change them to LogMgr.
You should use namespaces
No, i changed the name from LogMgr to LogManager on all places i could find.
Ok i changed the name back and i still get a linker error:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
ngelscript.lib(as_scriptengine.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>angelscript.lib(as_scriptengine.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_configgroup.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_thread.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_globalproperty.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_gc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_datatype.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_memory.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_string.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_callfunc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_objecttype.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_scriptobject.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_builder.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_tokenizer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_scriptfunction.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_atomic.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_generic.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_module.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_context.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_string_util.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_callfunc_x86.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_scriptnode.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_scriptcode.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_outputbuffer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_compiler.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_bytecode.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_parser.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_restore.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_typeinfo.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>angelscript.lib(as_variablescope.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LogManager.obj
1>     Creating library G:\EEngine\EEngine - Editor\Debug\EEngine - Editor.lib and object G:\EEngine\EEngine - Editor\Debug\EEngine - Editor.exp
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>G:\EEngine\EEngine - Editor\Debug\EEngine - Editor.exe : fatal error LNK1319: 29 mismatches detected
1> 
Nvm i solved the problem by switching the angelscript.lib to angelscriptd.lib
Topic archived. No new replies allowed.