c++ - Linking against third-party libraries when doing cross-platform build in Visual Studio 2015 -


i trying compile shared object (.so) visual studio 2015 rc.

i linking against opus codec libs in stdafx.h:

#pragma comment(lib, "..\\..\\opus-1.1-beta\\win32\\vs2010\\win32\\debug\\celt.lib") #pragma comment(lib, "..\\..\\opus-1.1-beta\\win32\\vs2010\\win32\\debug\\opus.lib") #pragma comment(lib, "..\\..\\opus-1.1-beta\\win32\\vs2010\\win32\\debug\\silk_common.lib") #pragma comment(lib, "..\\..\\opus-1.1-beta\\win32\\vs2010\\win32\\debug\\silk_fixed.lib") #pragma comment(lib, "..\\..\\opus-1.1-beta\\win32\\vs2010\\win32\\debug\\silk_float.lib") 

i getting linker error:

linker command failed exit code 1 (use -v see invocation) sharedobject1 c:\users\myuser\documents\visual studio 2015\projects\sharedobject1\sharedobject1\clang.exe 1

can tell me how investigate might have gone wrong there? state "-v"?

and not ok use .libs in cross-platform project? wondering why talks .a files, .so, never .libs.

edit: have uploaded small example project here if willing have look.

first, opus codec distribution comes visual studio projects configured build windows libraries, not cross-platform. need replace these projects cross platform library projects. or better alternative: download prebuilt libopus.a, e.g. here.

second, cannot use #pragma comment(lib, ...) in cross-platform projects. instead, add library dependencies project properties: add opus configuration properties -> linker -> input -> library dependencies; add path folder containing libopus.a configuration properties -> linker -> general -> additional library directories.

third, looks trying use version of clang.exe placing in root of project (your linker error shows this). must wrong. instead, need use clang comes android ndk. (make sure ndkroot environment variable points root of android ndk installation.)


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -