Eu tentei construir um projeto VC ++ para Linux (Raspbian) no VS2017 (do meu PC) usando a biblioteca estática libgattlib.so que reside na placa Raspberry Pi 3. A compilação foi sem erros. Posso incluir de forma confiável nos arquivos .h do projeto usando, por exemplo, \\ usr \ include . Eu também preciso de uma referência ao arquivo de biblioteca libgattlib.so. Ele reside em / usr / lib no Raspberry Pi 3 e o link está corretamente ( \\ usr \ lib ) definido no VS2017 Projeto- > Propriedades de configuração - > Diretórios VC ++ - > ; Diretórios de biblioteca e -lgattlib em Projeto- > Propriedades de configuração- > Linker- > Input- > Dependências de biblioteca , mas o linker reporta o erro:
Link de destino:
1> Linking objects
1> Invoking 'ld'
1> g++ -o "/home/pi/projects/Id2Monitor_For_Linux/bin/ARM/Debug/Id2Monitor_For_Linux.out" -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack /home/pi/projects/Id2Monitor_For_Linux/obj/ARM/Debug/main.o -lbluetooth -llibgattlib
1> /usr/bin/ld: cannot find -llibgattlib
1> /usr/bin/ld: cannot find -llibgattlib
1> collect2: error: ld returned 1 exit status
1> collect2: error: ld returned 1 exit status
1> /usr/bin/ld: cannot find -llibgattlib
1> collect2: error: ld returned 1 exit status
1> collect2 : error : ld returned 1 exit status
1> Done linking, output file name: '/home/pi/projects/Id2Monitor_For_Linux/bin/ARM/Debug/Id2Monitor_For_Linux.out'
1>Done building target "Link" in project "Id2Monitor_For_Linux.vcxproj" -- FAILED.
1>
1>Done building project "Id2Monitor_For_Linux.vcxproj" -- FAILED.
1>
1>Build FAILED.
1>
1>collect2 : error : ld returned 1 exit status
1> 0 Warning(s)
1> 1 Error(s)
Por favor me avise como configurar corretamente as referências para a biblioteca libgattlib.so no VS2017. Obrigado.