error LNK2001: unresolved external symbol in cocos2d-x lua support - c++

I have created a cpp cocos2d-x project, and manually add lua support(import the liblua project in my solution). I want to run lua code in my cocos2d-x project. But I met these errors. I cannot use any functions in "CCLuaEngine.h". When I try to write some lua api code , there still unresolved external symbol errors.
my cocos2d-x version is 2.1.5 , and I use visual studio 2012 under Windows 7
following picture is my project.
1>liblua.lib(tolua_to.obj) : error LNK2001: unresolved external symbol _lua_pushnumber
1>liblua.lib(CCLuaEngine.obj) : error LNK2019: unresolved external symbol _lua_pushnumber referenced in function "public: virtual int __thiscall cocos2d::CCLuaEngine::executeLayerTouchesEvent(class cocos2d::CCLayer *,int,class cocos2d::CCSet *)" (?executeLayerTouchesEvent#CCLuaEngine#cocos2d##UAEHPAVCCLayer#2#HPAVCCSet#2##Z)
1>liblua.lib(CCLuaStack.obj) : error LNK2001: unresolved external symbol _lua_pushnumber
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_pushnumber
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_pushnumber
1>liblua.lib(CCLuaEngine.obj) : error LNK2019: unresolved external symbol _lua_pushinteger referenced in function "public: virtual int __thiscall cocos2d::CCLuaEngine::executeLayerTouchesEvent(class cocos2d::CCLayer *,int,class cocos2d::CCSet *)" (?executeLayerTouchesEvent#CCLuaEngine#cocos2d##UAEHPAVCCLayer#2#HPAVCCSet#2##Z)
1>liblua.lib(CCLuaStack.obj) : error LNK2001: unresolved external symbol _lua_pushinteger
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_pushinteger
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_createtable
1>liblua.lib(CCLuaEngine.obj) : error LNK2019: unresolved external symbol _lua_createtable referenced in function "public: virtual int __thiscall cocos2d::CCLuaEngine::executeLayerTouchesEvent(class cocos2d::CCLayer *,int,class cocos2d::CCSet *)" (?executeLayerTouchesEvent#CCLuaEngine#cocos2d##UAEHPAVCCLayer#2#HPAVCCSet#2##Z)
1>liblua.lib(CCLuaStack.obj) : error LNK2001: unresolved external symbol _lua_createtable
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_createtable
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_createtable
1>liblua.lib(CCLuaEngine.obj) : error LNK2019: unresolved external symbol _lua_rawseti referenced in function "public: virtual int __thiscall cocos2d::CCLuaEngine::executeLayerTouchesEvent(class cocos2d::CCLayer *,int,class cocos2d::CCSet *)" (?executeLayerTouchesEvent#CCLuaEngine#cocos2d##UAEHPAVCCLayer#2#HPAVCCSet#2##Z)
1>liblua.lib(CCLuaStack.obj) : error LNK2001: unresolved external symbol _lua_rawseti
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_gettop
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_gettop
1>liblua.lib(tolua_to.obj) : error LNK2001: unresolved external symbol _lua_gettop
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_gettop
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_gettop referenced in function "int __cdecl `anonymous namespace'::lua_print(struct lua_State *)" (?lua_print#?A0x5bb22735##YAHPAUlua_State###Z)
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_gettop
1>liblua.lib(LuaCocos2d.obj) : error LNK2001: unresolved external symbol _lua_gettop
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_gettop
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_settop
1>liblua.lib(tolua_to.obj) : error LNK2001: unresolved external symbol _lua_settop
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_settop
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_settop referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::addLuaLoader(int (__cdecl*)(struct lua_State *))" (?addLuaLoader#CCLuaStack#cocos2d##UAEXP6AHPAUlua_State###Z#Z)
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_settop
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_settop
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_settop
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_insert
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_insert referenced in function "public: virtual int __thiscall cocos2d::CCLuaStack::executeFunction(int)" (?executeFunction#CCLuaStack#cocos2d##UAEHH#Z)
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_insert
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_insert
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_insert
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_isnumber referenced in function "public: virtual int __thiscall cocos2d::CCLuaStack::executeFunction(int)" (?executeFunction#CCLuaStack#cocos2d##UAEHH#Z)
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_isnumber
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_isnumber
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_type
1>liblua.lib(tolua_to.obj) : error LNK2001: unresolved external symbol _lua_type
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_type
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_type referenced in function "public: virtual int __thiscall cocos2d::CCLuaStack::executeFunction(int)" (?executeFunction#CCLuaStack#cocos2d##UAEHH#Z)
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_type
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_type
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_type
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_typename referenced in function "int __cdecl `anonymous namespace'::lua_print(struct lua_State *)" (?lua_print#?A0x5bb22735##YAHPAUlua_State###Z)
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_typename
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_typename
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_tointeger referenced in function "public: virtual int __thiscall cocos2d::CCLuaStack::executeFunction(int)" (?executeFunction#CCLuaStack#cocos2d##UAEHH#Z)
1>liblua.lib(tolua_to.obj) : error LNK2001: unresolved external symbol _lua_toboolean
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_toboolean referenced in function "public: virtual int __thiscall cocos2d::CCLuaStack::executeFunction(int)" (?executeFunction#CCLuaStack#cocos2d##UAEHH#Z)
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_toboolean
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_toboolean
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_toboolean
1>liblua.lib(tolua_to.obj) : error LNK2001: unresolved external symbol _lua_tolstring
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_tolstring referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::addSearchPath(char const *)" (?addSearchPath#CCLuaStack#cocos2d##UAEXPBD#Z)
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_tolstring
1>liblua.lib(Cocos2dxLuaLoader.obj) : error LNK2001: unresolved external symbol _lua_tolstring
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_tolstring
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_objlen referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::addLuaLoader(int (__cdecl*)(struct lua_State *))" (?addLuaLoader#CCLuaStack#cocos2d##UAEXP6AHPAUlua_State###Z#Z)
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_pushnil
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_pushnil referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::pushNil(void)" (?pushNil#CCLuaStack#cocos2d##UAEXXZ)
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_pushnil
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_pushnil
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_pushnil
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_pushlstring referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::pushString(char const *,int)" (?pushString#CCLuaStack#cocos2d##UAEXPBDH#Z)
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_pushlstring
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_pushlstring
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_pushlstring
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_pushstring
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_pushstring
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_pushstring
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_pushstring referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::pushCCLuaValueDict(class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class cocos2d::CCLuaValue,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class cocos2d::CCLuaValue> > > const &)" (?pushCCLuaValueDict#CCLuaStack#cocos2d##UAEXABV?$map#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##VCCLuaValue#cocos2d##U?$less#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2#V?$allocator#U?$pair#$$CBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##VCCLuaValue#cocos2d###std###2##std###Z)
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_pushstring
1>liblua.lib(LuaCocos2d.obj) : error LNK2001: unresolved external symbol _lua_pushstring
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_pushstring
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_pushfstring referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::addSearchPath(char const *)" (?addSearchPath#CCLuaStack#cocos2d##UAEXPBD#Z)
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_pushcclosure referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::addLuaLoader(int (__cdecl*)(struct lua_State *))" (?addLuaLoader#CCLuaStack#cocos2d##UAEXP6AHPAUlua_State###Z#Z)
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_pushcclosure
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_pushcclosure
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_pushboolean referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::pushBoolean(bool)" (?pushBoolean#CCLuaStack#cocos2d##UAEX_N#Z)
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_pushboolean
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_pushboolean
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_pushboolean
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_getfield referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::addLuaLoader(int (__cdecl*)(struct lua_State *))" (?addLuaLoader#CCLuaStack#cocos2d##UAEXP6AHPAUlua_State###Z#Z)
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_getfield
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_getfield
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_getfield
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_rawgeti referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::addLuaLoader(int (__cdecl*)(struct lua_State *))" (?addLuaLoader#CCLuaStack#cocos2d##UAEXP6AHPAUlua_State###Z#Z)
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_setfield referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::addLuaLoader(int (__cdecl*)(struct lua_State *))" (?addLuaLoader#CCLuaStack#cocos2d##UAEXP6AHPAUlua_State###Z#Z)
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_rawset
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_rawset referenced in function "public: virtual void __thiscall cocos2d::CCLuaStack::pushCCLuaValueDict(class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class cocos2d::CCLuaValue,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class cocos2d::CCLuaValue> > > const &)" (?pushCCLuaValueDict#CCLuaStack#cocos2d##UAEXABV?$map#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##VCCLuaValue#cocos2d##U?$less#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2#V?$allocator#U?$pair#$$CBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##VCCLuaValue#cocos2d###std###2##std###Z)
1>liblua.lib(tolua_fix.obj) : error LNK2001: unresolved external symbol _lua_rawset
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_rawset
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_rawset
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_pcall referenced in function "public: virtual int __thiscall cocos2d::CCLuaStack::executeFunction(int)" (?executeFunction#CCLuaStack#cocos2d##UAEHH#Z)
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_pcall
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _lua_error referenced in function "public: virtual bool __thiscall cocos2d::CCLuaStack::handleAssert(char const *)" (?handleAssert#CCLuaStack#cocos2d##UAE_NPBD#Z)
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_error
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _luaL_register referenced in function "protected: bool __thiscall cocos2d::CCLuaStack::init(void)" (?init#CCLuaStack#cocos2d##IAE_NXZ)
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _luaL_loadfile referenced in function "public: virtual int __thiscall cocos2d::CCLuaStack::executeScriptFile(char const *)" (?executeScriptFile#CCLuaStack#cocos2d##UAEHPBD#Z)
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _luaL_loadstring referenced in function "public: virtual int __thiscall cocos2d::CCLuaStack::executeString(char const *)" (?executeString#CCLuaStack#cocos2d##UAEHPBD#Z)
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _luaL_newstate referenced in function "protected: bool __thiscall cocos2d::CCLuaStack::init(void)" (?init#CCLuaStack#cocos2d##IAE_NXZ)
1>liblua.lib(CCLuaStack.obj) : error LNK2019: unresolved external symbol _luaL_openlibs referenced in function "protected: bool __thiscall cocos2d::CCLuaStack::init(void)" (?init#CCLuaStack#cocos2d##IAE_NXZ)
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_pushvalue
1>liblua.lib(tolua_fix.obj) : error LNK2019: unresolved external symbol _lua_pushvalue referenced in function _toluafix_ref_function
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_pushvalue
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_pushvalue
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_pushvalue
1>liblua.lib(tolua_fix.obj) : error LNK2019: unresolved external symbol _lua_remove referenced in function _toluafix_get_function_by_refid
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_remove
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_remove
1>liblua.lib(tolua_fix.obj) : error LNK2019: unresolved external symbol _lua_tonumber referenced in function _toluafix_stack_dump
1>liblua.lib(tolua_to.obj) : error LNK2001: unresolved external symbol _lua_tonumber
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_touserdata
1>liblua.lib(tolua_fix.obj) : error LNK2019: unresolved external symbol _lua_touserdata referenced in function _toluafix_remove_ccobject_by_refid
1>liblua.lib(LuaCocos2d.obj) : error LNK2001: unresolved external symbol _lua_touserdata
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_touserdata
1>liblua.lib(tolua_to.obj) : error LNK2001: unresolved external symbol _lua_touserdata
1>liblua.lib(tolua_fix.obj) : error LNK2019: unresolved external symbol _lua_pushlightuserdata referenced in function _toluafix_pushusertype_ccobject
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_pushlightuserdata
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_pushlightuserdata
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_pushlightuserdata
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_rawget
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_rawget
1>liblua.lib(tolua_fix.obj) : error LNK2019: unresolved external symbol _lua_rawget referenced in function _toluafix_get_function_by_refid
1>liblua.lib(LuaCocos2d.obj) : error LNK2001: unresolved external symbol _lua_rawget
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _lua_rawget
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_rawget
1>liblua.lib(Cocos2dxLuaLoader.obj) : error LNK2019: unresolved external symbol _luaL_checklstring referenced in function _cocos2dx_lua_loader
1>liblua.lib(Cocos2dxLuaLoader.obj) : error LNK2019: unresolved external symbol _luaL_error referenced in function _cocos2dx_lua_loader
1>liblua.lib(tolua_is.obj) : error LNK2001: unresolved external symbol _luaL_error
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _luaL_error
1>liblua.lib(Cocos2dxLuaLoader.obj) : error LNK2019: unresolved external symbol _luaL_loadbuffer referenced in function _cocos2dx_lua_loader
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _luaL_loadbuffer
1>liblua.lib(tolua_is.obj) : error LNK2019: unresolved external symbol _lua_replace referenced in function _push_table_instance
1>liblua.lib(tolua_is.obj) : error LNK2019: unresolved external symbol _lua_isstring referenced in function _lua_isusertable
1>liblua.lib(tolua_is.obj) : error LNK2019: unresolved external symbol _lua_isuserdata referenced in function _lua_isusertype
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_isuserdata
1>liblua.lib(tolua_to.obj) : error LNK2001: unresolved external symbol _lua_isuserdata
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_isuserdata
1>liblua.lib(tolua_is.obj) : error LNK2019: unresolved external symbol _lua_rawequal referenced in function _tolua_fast_isa
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_rawequal
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_rawequal
1>liblua.lib(tolua_is.obj) : error LNK2019: unresolved external symbol _lua_gettable referenced in function _push_table_instance
1>liblua.lib(tolua_to.obj) : error LNK2001: unresolved external symbol _lua_gettable
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_gettable
1>liblua.lib(tolua_is.obj) : error LNK2019: unresolved external symbol _lua_getmetatable referenced in function _lua_isusertype
1>liblua.lib(tolua_push.obj) : error LNK2001: unresolved external symbol _lua_getmetatable
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_getmetatable
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_getmetatable
1>liblua.lib(tolua_is.obj) : error LNK2019: unresolved external symbol _lua_concat referenced in function _lua_isusertable
1>liblua.lib(tolua_push.obj) : error LNK2019: unresolved external symbol _lua_newuserdata referenced in function _tolua_pushusertype
1>liblua.lib(tolua_push.obj) : error LNK2019: unresolved external symbol _lua_settable referenced in function _tolua_pushfieldboolean
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_settable
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_settable
1>liblua.lib(tolua_push.obj) : error LNK2019: unresolved external symbol _lua_setmetatable referenced in function _tolua_pushusertype
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_setmetatable
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_setmetatable
1>liblua.lib(tolua_push.obj) : error LNK2019: unresolved external symbol _lua_setfenv referenced in function _tolua_pushusertype
1>liblua.lib(tolua_map.obj) : error LNK2001: unresolved external symbol _lua_setfenv
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_setfenv
1>liblua.lib(tolua_map.obj) : error LNK2019: unresolved external symbol _lua_getfenv referenced in function _tolua_bnd_getpeer
1>liblua.lib(tolua_event.obj) : error LNK2001: unresolved external symbol _lua_getfenv
1>liblua.lib(tolua_map.obj) : error LNK2019: unresolved external symbol _lua_gc referenced in function _tolua_bnd_releaseownership
1>liblua.lib(tolua_map.obj) : error LNK2019: unresolved external symbol _lua_next referenced in function _mapsuper
1>liblua.lib(tolua_map.obj) : error LNK2019: unresolved external symbol _luaL_newmetatable referenced in function _tolua_newmetatable
1>liblua.lib(tolua_event.obj) : error LNK2019: unresolved external symbol _lua_iscfunction referenced in function _class_index_event
1>liblua.lib(tolua_event.obj) : error LNK2019: unresolved external symbol _lua_tocfunction referenced in function _tolua_ismodulemetatable
1>liblua.lib(tolua_event.obj) : error LNK2019: unresolved external symbol _lua_call referenced in function _class_call_event

Add the liblua.lib and lua51.lib in the text field.
Project Properties -> Linker -> Input -> Additional Dependencies.
When you click in the field, you get a ... key. Click on this key and add one library name per line. Alternatively you can write the names in the field. Separate all entries with space characters.
verify that it's on the command line in
Project Properties -> Linker -> Comamnd Line.

I finally get it, in case anyone encounters a similar problem. To get lua to work with cocos2d-x, you need the following
add libluacocos2d project to your solution. (its found in [cocos2dx-root-folder]/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj)
Go to your project properties>Common Properties>References>click add New Reference and add the libluacocos2d
Go to your project properties>Configuration Properties>C/C++>General>Additional Include Directories and add these folders $(EngineRoot)cocos\scripting\lua-bindings\auto , $(EngineRoot)cocos\scripting\lua-bindings\manual , $(EngineRoot)external\lua\lua , $(EngineRoot)external\lua\tolua
Go to your project properties>Configuration Properties>C/C++>Preprocessor>Preprocessor Definitions and add _USRLUASTATIC or else you get errors like error LNK2019: unresolved external symbol "_declspec(dllimport) public: static class cocos2d::LuaEngine * __cdecl cocos2d::LuaEngine::getInstance(void)" (__imp?getInstance#LuaEngine#cocos2d##SAPAV12#XZ)
Go to your project properties>Configuration Properties>Linker>input>additional Dependencies and add lua51.lib
By now every thing should compile and work.My cocos2d setup is cocos2d-x 3.10, Android NDK r9b ,visual studio 2013, python 2.7, android sdk 19
Ps: I got the answer on a Chinese forum http://m.blog.csdn.net/j0903/article/details/73289291

Related

Still linker errors in VisualStudio for grpc despite AutoLink (vcpkg) enabled

I ran as suggested in https://stackoverflow.com/a/67875527/433718
vcpkg install grpc:x64-windows
vcpkg install protobuf protobuf:x64-windows
vcpkg install protobuf[zlib] protobuf[zlib]:x64-windows
vcpkg integrate install
Hence, those packages are installed now on my computer:
vcpkg list
abseil:x64-windows 2021-03-24#1 an open-source collection designed to augment th...
c-ares:x64-windows 1.17.1#2 A C library for asynchronous DNS requests
grpc:x64-windows 1.37.0#3 An RPC library and framework
grpc[codegen]:x64-windows Build code generator machinery
openssl:x64-windows 1.1.1k#8 OpenSSL is an open source project that provides ...
protobuf:x64-windows 3.15.8#4 Protocol Buffers - Google's data interchange format
protobuf:x86-windows 3.15.8#4 Protocol Buffers - Google's data interchange format
protobuf[zlib]:x64-windows ZLib based features like Gzip streams
protobuf[zlib]:x86-windows ZLib based features like Gzip streams
re2:x64-windows 2020-10-01 RE2 is a fast, safe, thread-friendly alternative...
upb:x64-windows 2020-12-19#1 μpb (often written 'upb') is a small protobuf i...
zlib:x64-windows 1.2.11#11 A compression library
zlib:x86-windows 1.2.11#11 A compression library
Here's my code:
#include <grpcpp/grpcpp.h>
using grpc::ServerBuilder;
int main(int argc, char** argv) {
ServerBuilder builder;
return 0;
}
I haven't configured any paths (e.g. Additional Dependencies) in the properties as I am using vcpkg (I suppose that's the point of using vcpkg). Here's the config page of vcpkg:
My project doesn't build in Visul Studio 2019 due to 27 unresolved externals...
1>grpc.lib(iomgr_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSAStartup referenced in function "void __cdecl winsock_init(void)" (?winsock_init##YAXXZ)
1>grpc.lib(iomgr_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSACleanup referenced in function "void __cdecl winsock_shutdown(void)" (?winsock_shutdown##YAXXZ)
1>grpc.lib(socket_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_bind referenced in function "void __cdecl probe_ipv6_once(void)" (?probe_ipv6_once##YAXXZ)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_bind
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_bind
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_bind
1>grpc.lib(socket_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_closesocket referenced in function "void __cdecl grpc_winsocket_shutdown(struct grpc_winsocket *)" (?grpc_winsocket_shutdown##YAXPEAUgrpc_winsocket###Z)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_closesocket
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_closesocket
1>address_sorting.lib(address_sorting_windows.c.obj) : error LNK2001: unresolved external symbol __imp_closesocket
1>grpc.lib(socket_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_socket referenced in function "void __cdecl probe_ipv6_once(void)" (?probe_ipv6_once##YAXXZ)
1>address_sorting.lib(address_sorting_windows.c.obj) : error LNK2001: unresolved external symbol __imp_socket
1>grpc.lib(resolve_address_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(tcp_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(socket_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(iocp_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAIoctl
1>grpc.lib(socket_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAIoctl
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAIoctl
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAIoctl
1>grpc.lib(tcp_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAIoctl
1>grpc.lib(socket_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSASocketA referenced in function "void __cdecl grpc_wsa_socket_flags_init(void)" (?grpc_wsa_socket_flags_init##YAXXZ)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSASocketA
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSASocketA
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSASocketA
1>grpc.lib(iocp_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSAGetOverlappedResult referenced in function "enum grpc_iocp_work_status __cdecl grpc_iocp_work(__int64)" (?grpc_iocp_work##YA?AW4grpc_iocp_work_status##_J#Z)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetOverlappedResult
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetOverlappedResult
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetOverlappedResult
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_getpeername referenced in function "void __cdecl on_accept(void *,struct grpc_error *)" (?on_accept##YAXPEAXPEAUgrpc_error###Z)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_getsockname referenced in function "struct grpc_error * __cdecl prepare_socket(unsigned __int64,struct grpc_resolved_address const *,int *)" (?prepare_socket##YAPEAUgrpc_error##_KPEBUgrpc_resolved_address##PEAH#Z)
1>grpc.lib(tcp_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_getsockname
1>address_sorting.lib(address_sorting_windows.c.obj) : error LNK2001: unresolved external symbol __imp_getsockname
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_listen referenced in function "struct grpc_error * __cdecl prepare_socket(unsigned __int64,struct grpc_resolved_address const *,int *)" (?prepare_socket##YAPEAUgrpc_error##_KPEBUgrpc_resolved_address##PEAH#Z)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_setsockopt referenced in function "void __cdecl on_accept(void *,struct grpc_error *)" (?on_accept##YAXPEAXPEAUgrpc_error###Z)
1>grpc.lib(tcp_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_setsockopt
1>grpc.lib(resolve_address_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_getaddrinfo referenced in function "struct grpc_error * __cdecl windows_blocking_resolve_address(char const *,char const *,struct grpc_resolved_addresses * *)" (?windows_blocking_resolve_address##YAPEAUgrpc_error##PEBD0PEAPEAUgrpc_resolved_addresses###Z)
1>grpc.lib(resolve_address_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_freeaddrinfo referenced in function "struct grpc_error * __cdecl windows_blocking_resolve_address(char const *,char const *,struct grpc_resolved_addresses * *)" (?windows_blocking_resolve_address##YAPEAUgrpc_error##PEBD0PEAPEAUgrpc_resolved_addresses###Z)
1>grpc.lib(tcp_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSARecv referenced in function "void __cdecl on_read(void *,struct grpc_error *)" (?on_read##YAXPEAXPEAUgrpc_error###Z)
1>grpc.lib(tcp_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSASend referenced in function "void __cdecl on_write(void *,struct grpc_error *)" (?on_write##YAXPEAXPEAUgrpc_error###Z)
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSASend
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_htonl referenced in function "unsigned int __cdecl grpc_htonl(unsigned int)" (?grpc_htonl##YAII#Z)
1>address_sorting.lib(address_sorting.c.obj) : error LNK2001: unresolved external symbol __imp_htonl
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_htons referenced in function "unsigned short __cdecl grpc_htons(unsigned short)" (?grpc_htons##YAGG#Z)
1>grpc.lib(grpc_ares_wrapper.cc.obj) : error LNK2001: unresolved external symbol __imp_htons
1>grpc.lib(parse_address.cc.obj) : error LNK2001: unresolved external symbol __imp_htons
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_ntohl referenced in function "unsigned int __cdecl grpc_ntohl(unsigned int)" (?grpc_ntohl##YAII#Z)
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_ntohs referenced in function "unsigned short __cdecl grpc_ntohs(unsigned short)" (?grpc_ntohs##YAGG#Z)
1>grpc.lib(grpc_ares_wrapper.cc.obj) : error LNK2001: unresolved external symbol __imp_ntohs
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_inet_pton referenced in function "int __cdecl grpc_inet_pton(int,char const *,void *)" (?grpc_inet_pton##YAHHPEBDPEAX#Z)
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol inet_ntop referenced in function "char const * __cdecl grpc_inet_ntop(int,void const *,char *,unsigned __int64)" (?grpc_inet_ntop##YAPEBDHPEBXPEAD_K#Z)
1>grpc.lib(ssl_transport_security.cc.obj) : error LNK2001: unresolved external symbol inet_ntop
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSASetLastError referenced in function "public: __cdecl grpc_core::WSAErrorContext::~WSAErrorContext(void)" (??1WSAErrorContext#grpc_core##QEAA#XZ)
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSAConnect referenced in function "public: int __cdecl grpc_core::GrpcPolledFdWindows::ConnectUDP(class grpc_core::WSAErrorContext *,struct sockaddr const *,int)" (?ConnectUDP#GrpcPolledFdWindows#grpc_core##QEAAHPEAVWSAErrorContext#2#PEBUsockaddr##H#Z)
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSARecvFrom referenced in function "public: void __cdecl grpc_core::GrpcPolledFdWindows::ContinueRegisterForOnReadableLocked(void)" (?ContinueRegisterForOnReadableLocked#GrpcPolledFdWindows#grpc_core##QEAAXXZ)
1>address_sorting.lib(address_sorting_windows.c.obj) : error LNK2019: unresolved external symbol __imp_connect referenced in function address_sorting_create_source_addr_factory_for_current_platform
I build in the Debug and x64 configuration.
What am I missing? I thought vcpkg shall make life easier?
It seems to be a problem of the grpc package.
2nd part of the accepted answer of Linking gRPC on Windows for VisualC++ exactly fixed my problem.
I added #pragma comment(lib, "Ws2_32.lib") to my cpp-file and the problem was gone.
It also can be fixed like so (I've taken the screenshot from Unresolved external symbol LNK2019):

Why am I getting these linker errors with cinder and CodeBlocks?

I'm having a bit of trouble compiling a project of mine using Code::Blocks and llvm-clang on Windows 10. Here's some of the error msg as its waay too long to fit in fully, but all of what should be needed is in there.
clang++.exe -LC:\Qub3d\cinder_master\lib -o bin\Debug\Qub3d.exe obj\Debug\src\mainMenus\mainMenu.o obj\Debug\src\Qub3d_EngineApp.o ..\Qub3d-libs\lib\msw\x64\libEGL.lib ..\Qub3d-libs\lib\msw\x64\libGLESv2.lib ..\Qub3d-libs\lib\msw\x64\libpng.lib ..\Qub3d-libs\lib\msw\x64\Debug\v141\cinder.lib
cinder.lib(wrapper.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in mainMenu.o
cinder.lib(GlslProg.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in mainMenu.o
cinder.lib(GlslProg.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in mainMenu.
libcpmtd.lib(stdthrow.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in mainMenu.o
libcpmtd.lib(stdthrow.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in mainMenu.o
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
mainMenu.o : warning LNK4217: locally defined symbol __std_terminate imported in function "int `public: __cdecl std::shared_ptr<class cinder::app::Window>::~shared_ptr<class cinder::app::Window>(void)'::`1'::dtor$2" (?dtor$2#?0???1?$shared_ptr#VWindow#app#cinder###std##QEAA#XZ#4HA)
Qub3d_EngineApp.o : warning LNK4049: locally defined symbol __std_terminate imported
Qub3d_EngineApp.o : warning LNK4217: locally defined symbol _CxxThrowException imported in function "int `private: void __cdecl std::shared_ptr<class cinder::app::Renderer>::_Setp<class cinder::app::RendererGl>(class cinder::app::RendererGl *,struct shared_ptr<class cinder::app::Renderer>::integral_constant<bool,0>)'::`1'::catch$4" (?catch$4#?0???$_Setp#VRendererGl#app#cinder###?$shared_ptr#VRenderer#app#cinder###std##AEAAXPEAVRendererGl#app#cinder##U?$integral_constant#_N$0A##1##Z#4HA)
cinder.lib(TextureFormatParsers.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(Unicode.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(RendererImplGlMsw.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(Platform.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(Signals.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(System.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(Context.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(Batch.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(Log.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(Exception.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(Window.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(Environment.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(CinderAssert.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(Shader.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(wrapper.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(RendererGl.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(AppBase.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(AppMsw.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
cinder.lib(AppMsw.obj) : error LNK2019: unresolved external symbol __imp_GetCursorPos referenced in function "public: virtual struct glm::tvec2<int,0> __cdecl cinder::app::AppMsw::getMousePos(void)const " (?getMousePos#AppMsw#app#cinder##UEBA?AU?$tvec2#H$0A##glm##XZ)
cinder.lib(AppMsw.obj) : error LNK2019: unresolved external symbol __imp_CommandLineToArgvW referenced in function "public: static void __cdecl cinder::app::AppMsw::initialize(class cinder::app::AppMsw::Settings *,class std::shared_ptr<class cinder::app::Renderer> const &,char const *)" (?initialize#AppMsw#app#cinder##SAXPEAVSettings#123#AEBV?$shared_ptr#VRenderer#app#cinder###std##PEBD#Z)
cinder.lib(ConstantConversions.obj) : error LNK2001: unresolved external symbol _calloc_dbg
cinder.lib(PlatformMsw.obj) : error LNK2001: unresolved external symbol _free_dbg
cinder.lib(GeomIo.obj) : error LNK2001: unresolved external symbol _free_dbg
cinder.lib(GlslProg.obj) : error LNK2001: unresolved external symbol _free_dbg
cinder.lib(BufferObj.obj) : error LNK2001: unresolved external symbol _free_dbg
cinder.lib(Vao.obj) : error LNK2001: unresolved external symbol _free_dbg
cinder.lib(Fbo.obj) : error LNK2001: unresolved external symbol _free_dbg
cinder.lib(Context.obj) : error LNK2001: unresolved external symbol _free_dbg
cinder.lib(Log.obj) : error LNK2001: unresolved external symbol _free_dbg
cinder.lib(Utilities.obj) : error LNK2001: unresolved external symbol _free_dbg
cinder.lib(Texture.obj) : error LNK2001: unresolved external symbol _free_dbg
cinder.lib(ShaderPreprocessor.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(ConstantConversions.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(VboMesh.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(PlatformMsw.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(GeomIo.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(GlslProg.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(BufferObj.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(Vao.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(Fbo.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(Context.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(Log.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(Utilities.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(Texture.obj) : error LNK2001: unresolved external symbol _malloc_dbg
cinder.lib(Log.obj) : error LNK2019: unresolved external symbol __imp_CloseEventLog referenced in function "public: virtual __cdecl cinder::log::LoggerSystem::ImplEventLog::~ImplEventLog(void)" (??1ImplEventLog#LoggerSystem#log#cinder##UEAA#XZ)
cinder.lib(Log.obj) : error LNK2019: unresolved external symbol __imp_RegisterEventSourceW referenced in function "public: __cdecl cinder::log::LoggerSystem::ImplEventLog::ImplEventLog(void)" (??0ImplEventLog#LoggerSystem#log#cinder##QEAA#XZ)
cinder.lib(Log.obj) : error LNK2019: unresolved external symbol __imp_ReportEventW referenced in function "public: virtual void __cdecl cinder::log::LoggerSystem::ImplEventLog::write(struct cinder::log::Metadata const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?write#ImplEventLog#LoggerSystem#log#cinder##UEAAXAEBUMetadata#34#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
cinder.lib(RendererImplGlMsw.obj) : error LNK2019: unresolved external symbol __imp_ChoosePixelFormat referenced in function "bool __cdecl cinder::app::`anonymous namespace'::getWglFunctionPointers(struct HGLRC__ * (__cdecl**)(struct HDC__ *,struct HGLRC__ *,int const *),int (__cdecl**)(struct HDC__ *,int const *,float const *,unsigned int,int *,unsigned int *))" (?getWglFunctionPointers#?A0x83b54a9b#app#cinder##YA_NPEAP6APEAUHGLRC__##PEAUHDC__##PEAU4#PEBH#ZPEAP6AH02PEBMIPEAHPEAI#Z#Z)
cinder.lib(RendererImplGlMsw.obj) : error LNK2019: unresolved external symbol __imp_DescribePixelFormat referenced in function "bool __cdecl cinder::app::`anonymous namespace'::setPixelFormat(struct HDC__ *,struct cinder::app::RendererGl::Options const &)" (?setPixelFormat#?A0x83b54a9b#app#cinder##YA_NPEAUHDC__##AEBUOptions#RendererGl#23##Z)
cinder.lib(RendererImplGlMsw.obj) : error LNK2019: unresolved external symbol __imp_SetPixelFormat referenced in function "bool __cdecl cinder::app::`anonymous namespace'::getWglFunctionPointers(struct HGLRC__ * (__cdecl**)(struct HDC__ *,struct HGLRC__ *,int const *),int (__cdecl**)(struct HDC__ *,int const *,float const *,unsigned int,int *,unsigned int *))" (?getWglFunctionPointers#?A0x83b54a9b#app#cinder##YA_NPEAP6APEAUHGLRC__##PEAUHDC__##PEAU4#PEBH#ZPEAP6AH02PEBMIPEAHPEAI#Z#Z)
cinder.lib(RendererImplGlMsw.obj) : error LNK2019: unresolved external symbol __imp_SwapBuffers referenced in function "public: virtual void __cdecl cinder::app::RendererImplGlMsw::swapBuffers(void)const " (?swapBuffers#RendererImplGlMsw#app#cinder##UEBAXXZ)
cinder.lib(RendererImplGlMsw.obj) : error LNK2019: unresolved external symbol __imp_DefWindowProcW referenced in function "struct HWND__ * __cdecl cinder::app::`anonymous namespace'::createDummyWindow(void)" (?createDummyWindow#?A0x83b54a9b#app#cinder##YAPEAUHWND__##XZ)
cinder.lib(AppImplMsw.obj) : error LNK2001: unresolved external symbol __imp_DefWindowProcW
cinder.lib(RendererImplGlMsw.obj) : error LNK2019: unresolved external symbol __imp_RegisterClassW referenced in function "struct HWND__ * __cdecl cinder::app::`anonymous namespace'::createDummyWindow(void)" (?createDummyWindow#?A0x83b54a9b#app#cinder##YAPEAUHWND__##XZ)
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_MapVirtualKeyW referenced in function "wchar_t __cdecl cinder::app::mapVirtualKey(unsigned __int64)" (?mapVirtualKey#app#cinder##YA_W_K#Z)
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_SetCapture referenced in function "__int64 __cdecl cinder::app::WndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?WndProc#app#cinder##YA_JPEAUHWND__##I_K_J#Z)
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_ReleaseCapture referenced in function "__int64 __cdecl cinder::app::WndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?WndProc#app#cinder##YA_JPEAUHWND__##I_K_J#Z)
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_SetForegroundWindow referenced in function "public: __cdecl cinder::app::BlankingWindow::BlankingWindow(class std::shared_ptr<class cinder::Display>)" (??0BlankingWindow#app#cinder##QEAA#V?$shared_ptr#VDisplay#cinder###std###Z)
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_BeginPaint referenced in function "__int64 __cdecl cinder::app::BlankingWndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?BlankingWndProc#app#cinder##YA_JPEAUHWND__##I_K_J#Z)
cinder.lib(RendererImpl2dGdi.obj) : error LNK2001: unresolved external symbol __imp_BeginPaint
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_EndPaint referenced in function "__int64 __cdecl cinder::app::BlankingWndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?BlankingWndProc#app#cinder##YA_JPEAUHWND__##I_K_J#Z)
cinder.lib(RendererImpl2dGdi.obj) : error LNK2001: unresolved external symbol __imp_EndPaint
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_InvalidateRect referenced in function "public: void __cdecl cinder::app::WindowImplMsw::setBorderless(bool)" (?setBorderless#WindowImplMsw#app#cinder##QEAAX_N#Z)
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_RedrawWindow referenced in function "public: virtual void __cdecl cinder::app::WindowImplMsw::redraw(void)" (?redraw#WindowImplMsw#app#cinder##UEAAXXZ)
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_SetWindowTextW referenced in function "public: virtual void __cdecl cinder::app::WindowImplMsw::setTitle(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?setTitle#WindowImplMsw#app#cinder##UEAAXAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_GetWindowTextW referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl cinder::app::WindowImplMsw::getTitle(void)const " (?getTitle#WindowImplMsw#app#cinder##UEBA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ)
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_GetOpenFileNameW referenced in function "public: static class std::experimental::filesystem::v1::path __cdecl cinder::app::AppImplMsw::getOpenFilePath(class std::experimental::filesystem::v1::path const &,class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >)" (?getOpenFilePath#AppImplMsw#app#cinder##SA?AVpath#v1#filesystem#experimental#std##AEBV45678#V?$vector#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2##8##Z)
cinder.lib(AppImplMsw.obj) : error LNK2019: unresolved external symbol __imp_GetSaveFileNameW referenced in function "public: static class std::experimental::filesystem::v1::path __cdecl cinder::app::AppImplMsw::getSaveFilePath(class std::experimental::filesystem::v1::path const &,class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >)" (?getSaveFilePath#AppImplMsw#app#cinder##SA?AVpath#v1#filesystem#experimental#std##AEBV45678#V?$vector#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2##8##Z)
cinder.lib(ImageTargetFileWic.obj) : error LNK2001: unresolved external symbol __imp_CoCreateInstance
cinder.lib(ImageTargetFileWic.obj) : error LNK2019: unresolved external symbol __imp_VariantInit referenced in function "protected: __cdecl cinder::ImageTargetFileWic::ImageTargetFileWic(class std::shared_ptr<class cinder::DataTarget>,class std::shared_ptr<class cinder::ImageSource>,class cinder::ImageTarget::Options,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0ImageTargetFileWic#cinder##IEAA#V?$shared_ptr#VDataTarget#cinder###std##V?$shared_ptr#VImageSource#cinder###3#VOptions#ImageTarget#1#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##3##Z)
bin\Debug\Qub3d.exe : fatal error LNK1120: 93 unresolved externals
I've linked cinder.lib, libEGL.lib, libGLESv2.lib, and libpng.lib
I don't see any reason why this should not be working.

libigl, GLEW, GLFW, and Eigen on CLion, Windows 10. Linker Errors

I'm sure I'm missing something trivial, but I can't put my finger on what.
I'm building a project with four external libraries using CLion. I'm trying to link Eigen, GLEW, GLFW, and libigl. I'm using the VC++ compiler in VS 2015.
This is one iteration of my cmake file:
cmake_minimum_required(VERSION 3.9)
project(Lab1)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
add_executable(Lab1 main.cpp)
include_directories(external/libigl/include)
include_directories(external/glfw/include/)
include_directories(external/eigen-git-mirror/)
include_directories(external/glew_2_1_0/include)
INCLUDE_DIRECTORIES(external/glew_2_1_0/lib/Release/x64)
link_libraries(external/glew_2_1_0/lib/Release/x64)
I have added the glew libraries (both 32 and 64 bit) to their respective folders in VC++. I've also added the glew32.dll files to (64 and 32 bit) to their respective folders in the system folders. I don't think I need to do this if I define where to look for them in my Cmake file, but I'm not entirely sure.
This is my folder structure in CLion:
CLion folder structure.
Here's what main.cpp contains in case it matters:
#include <igl/readOFF.h>
#include <igl/viewer/Viewer.h>
Eigen::MatrixXd V;
Eigen::MatrixXi F;
int main(int argc, char *argv[])
{
// Load a mesh in OFF format
igl::readOFF("bunny.off", V, F);
// Plot the mesh
igl::viewer::Viewer viewer;
viewer.data.set_mesh(V, F);
viewer.launch();
}
These are the linker errors I get.
[100%] Linking CXX executable Lab1.exe
"D:\Actual Program Files\JetBrains\CLion 2017.3.1\bin\cmake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\Lab1.dir --manifests -- D:\ACTUAL~1\VISUAL~2\VC\bin\link.exe /nologo #CMakeFiles\Lab1.dir\objects1.rsp #C:\Users\Mohammed\AppData\Local\Temp\nm6742.tmp
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glBindTexture#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glBlendFunc#8 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glClear#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::clear_framebuffers(void)" (?clear_framebuffers#ViewerCore#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glClearColor#16 referenced in function "public: void __thiscall igl::viewer::ViewerCore::clear_framebuffers(void)" (?clear_framebuffers#ViewerCore#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glDeleteTextures#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::free_buffers(void)" (?free_buffers#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glDisable#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glDrawElements#16 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::draw_mesh(bool)" (?draw_mesh#OpenGL_state#viewer#igl##QAEX_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glEnable#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glGenTextures#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::init_buffers(void)" (?init_buffers#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glGetError#0 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glGetString#4 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glLineWidth#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPixelStorei#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPointSize#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPolygonMode#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::draw_mesh(bool)" (?draw_mesh#OpenGL_state#viewer#igl##QAEX_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPolygonOffset#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::draw_mesh(bool)" (?draw_mesh#OpenGL_state#viewer#igl##QAEX_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glTexImage2D#36 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glTexParameteri#12 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glViewport#16 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glewInit#0 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glewGetErrorString#4 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glewGetString#4 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwInit referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwTerminate referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetErrorCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetPrimaryMonitor referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetVideoMode referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwWindowHint referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwCreateWindow referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwDestroyWindow referenced in function "public: void __thiscall igl::viewer::Viewer::launch_shut(void)" (?launch_shut#Viewer#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwWindowShouldClose referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetWindowShouldClose referenced in function "void __cdecl glfw_key_callback(struct GLFWwindow *,int,int,int,int)" (?glfw_key_callback##YAXPAUGLFWwindow##HHHH#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetWindowSize referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetFramebufferSize referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetWindowAttrib referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetWindowSizeCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwPollEvents referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwWaitEvents referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetInputMode referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetKeyCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetCharModsCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetMouseButtonCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetCursorPosCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetScrollCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetDropCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwMakeContextCurrent referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2001: unresolved external symbol ___glewActiveTexture
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBindBuffer
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBufferData
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteBuffers
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGenBuffers
main.cpp.obj : error LNK2001: unresolved external symbol ___glewAttachShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewCompileShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewCreateProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewCreateShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDisableVertexAttribArray
main.cpp.obj : error LNK2001: unresolved external symbol ___glewEnableVertexAttribArray
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetAttribLocation
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetProgramInfoLog
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetProgramiv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetShaderInfoLog
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetShaderiv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetUniformLocation
main.cpp.obj : error LNK2001: unresolved external symbol ___glewLinkProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewShaderSource
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform1f
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform1i
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform3fv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform4f
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniformMatrix4fv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUseProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewVertexAttribPointer
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBindFragDataLocation
main.cpp.obj : error LNK2001: unresolved external symbol ___glewProgramParameteri
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBindVertexArray
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteVertexArrays
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGenVertexArrays
main.cpp.obj : error LNK2001: unresolved external symbol _glewExperimental
Lab1.exe : fatal error LNK1120: 81 unresolved externals
LINK Pass 1 failed. with 1120
NMAKE : fatal error U1077: '"D:\Actual Program Files\JetBrains\CLion 2017.3.1\bin\cmake\bin\cmake.exe"' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"D:\Actual Program Files\Visual Studio 2015\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Actual Program Files\Visual Studio 2015\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Actual Program Files\Visual Studio 2015\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
Thanks for the help.
EDIT:
Tsyvarev helped me out with the obvious errors. Changed everything to 32-bit too. Down to 47 unresolved externals. Will update once it's working.
Current Cmake:
cmake_minimum_required(VERSION 3.9)
project(Lab1)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
link_libraries(../external/glew_2_1_0/lib/Release/Win32/glew32s)
add_executable(Lab1 main.cpp)
include_directories(external/libigl/include)
include_directories(external/glfw/include/)
include_directories(external/eigen-git-mirror/)
include_directories(external/glew_2_1_0/include)
EDIT: SOLVED It all works! Was missing some libraries. Decided to link them locally. Here's the cmake for the next pour soul that comes across this:
cmake_minimum_required(VERSION 3.9)
project(Lab1)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
link_libraries(../external/glew_2_1_0/lib/Release/Win32/glew32s)
link_libraries(../external/glfw/lib-vc2015/glfw3)
link_libraries(../external/openGL/OPENGL32)
link_libraries(../external/openGL/glut32)
link_libraries(../external/openGL/glu32)
find_package(OpenGL REQUIRED)
include_directories( ${OPENGL_INCLUDE_DIRS})
#target_link_libraries(${PROJECTNAME} ${OPENGL_LIBRARIES})
add_executable(Lab1 main.cpp)
include_directories(external/libigl/include)
include_directories(external/glfw/include/)
include_directories(external/eigen-git-mirror/)
include_directories(external/glew_2_1_0/include)
Thanks for the help!
Command link_libraries affects only on futher targets, so it should be issued before add_executable call.
Also, link_libraries accepts library files, not a directory with them.

I get error LNK2019 when I try to compile zeromq sources

I'm trying to compile the zeromq sources and I have the following error:
I'm using Visual studio 2013 update 4 / windows 7 x64
First of all I compile the libsodium library satisfactorily.
Then I link the libsodium header files directory path to additional dependencies and libsodium.lib to additional library directories. I also specify the name of library in additional dependencies.
I try to compile it under win32 architecture and x64 architecture but I get the same errors.
I know that a __imp prefix is used as a bridge to the function that I want to use so if I linked the libraries appropiately why do I get this error?
Console log:
1>Creating library E:\zmq\libzmq\builds\msvc\vs2013\libzmq\..\..\..\..\bin\Win32\Debug\v120\dynamic\libzmq.lib and object E:\zmq\libzmq\builds\msvc\vs2013\libzmq\..\..\..\..\bin\Win32\Debug\v120\dynamic\libzmq.exp
1>ctx.obj : error LNK2019: unresolved external symbol __imp__randombytes_close referenced in function "public: __thiscall zmq::ctx_t::~ctx_t(void)" (??1ctx_t#zmq##QAE#XZ)
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__sodium_init referenced in function "public: __thiscall zmq::curve_client_t::curve_client_t(struct zmq::options_t const &)" (??0curve_client_t#zmq##QAE#ABUoptions_t#1##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__sodium_init
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_keypair referenced in function "public: __thiscall zmq::curve_client_t::curve_client_t(struct zmq::options_t const &)" (??0curve_client_t#zmq##QAE#ABUoptions_t#1##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_keypair
1>zmq_utils.obj : error LNK2001: unresolved external symbol __imp__crypto_box_keypair
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_beforenm referenced in function "private: int __thiscall zmq::curve_client_t::process_welcome(unsigned char const *,unsigned int)" (?process_welcome#curve_client_t#zmq##AAEHPBEI#Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_beforenm
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box referenced in function "private: int __thiscall zmq::curve_client_t::produce_hello(class zmq::msg_t *)" (?produce_hello#curve_client_t#zmq##AAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_open referenced in function "private: int __thiscall zmq::curve_client_t::process_welcome(unsigned char const *,unsigned int)" (?process_welcome#curve_client_t#zmq##AAEHPBEI#Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_open
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_afternm referenced in function "public: virtual int __thiscall zmq::curve_client_t::encode(class zmq::msg_t *)" (?encode#curve_client_t#zmq##UAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_afternm
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_open_afternm referenced in function "public: virtual int __thiscall zmq::curve_client_t::decode(class zmq::msg_t *)" (?decode#curve_client_t#zmq##UAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_open_afternm
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__randombytes referenced in function "private: int __thiscall zmq::curve_client_t::produce_initiate(class zmq::msg_t *)" (?produce_initiate#curve_client_t#zmq##AAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__randombytes
1>curve_server.obj : error LNK2019: unresolved external symbol __imp__crypto_secretbox referenced in function "private: int __thiscall zmq::curve_server_t::produce_welcome(class zmq::msg_t *)" (?produce_welcome#curve_server_t#zmq##AAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2019: unresolved external symbol __imp__crypto_secretbox_open referenced in function "private: int __thiscall zmq::curve_server_t::process_initiate(class zmq::msg_t *)" (?process_initiate#curve_server_t#zmq##AAEHPAVmsg_t#2##Z)
Thanks in advance.
You're probably compiling libsodium in a static way.
Try to compile it dinamically and link it again.
Such errors are also able to occur when you have a wrong set calling convention at your project.

Output with cout << endl

So, i have a program where i include static lib.
After that i write this:
cout << 1 << endl;
And i have this many errors like this:
1>RL.lib(Connection.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:LBR' specification
1>Ggsg.lib(StrategyInfo.obj) : error LNK2001: unresolved external symbol _m_mem_nchar_undup
1>Ggsg.lib(StrategyLegInfo.obj) : error LNK2001: unresolved external symbol _m_mem_nchar_undup
1>Ggsg.lib(ProductRmsInfo.obj) : error LNK2019: unresolved external symbol _m_mem_nchar_undup referenced in function "int __cdecl RApiImp::dupProductRmsInfo(class RApi::ProductRmsInfo *,class RApi::ProductRmsInfo *,int *)" (?dupProductRmsInfo#RApiImp##YAHPAVProductRmsInfo#RApi##0PAH#Z)
1>Ggsg.lib(OrderReportElseRqCtx.obj) : error LNK2001: unresolved external symbol _m_mem_nchar_undup
1>Ggsg.lib(PnlInfo.obj) : error LNK2001: unresolved external symbol _m_mem_nchar_undup
1>Ggsg.lib(SubSymCtx.obj) : error LNK2001: unresolved external symbol _m_mem_nchar_undup
1>Ggsg.lib(RebuildBookRqCtx.obj) : error LNK2001: unresolved external symbol _m_mem_nchar_undup
1>Ggsg.lib(SubRqCtx.obj) : error LNK2001: unresolved external symbol _m_mem_nchar_undup
1>Ggsg.lib(SubWatchCtx.obj) : error LNK2001: unresolved external symbol _m_mem_nchar_undup
1>Ggsg.lib(TradeRouteInfo.obj) : error LNK2001: unresolved external symbol _m_mem_nchar_undup
1>Ggsg.lib(PreSubmitOrderRqCtx.obj) : error LNK2001: unresolved external symbol _m_mem_nchar_undup
1>Ggsg.lib(RothFillsRqCb.obj) : error LNK2001: unresolved external symbol _m_mem_nchar_undup
When i write this:
cout << 1;
Working well. Whats the matter?