0
点赞
收藏
分享

微信扫一扫

g++编译调用gcc的静态库

Android开发指南 2022-02-18 阅读 65


#include<iostream>
#include<stdio.h>
using namespace std;
//arm-hisiv200-linux-g++ hello.cpp -lpthread -lm -L. libhello.a libmpi.a libhdmi.a libVoiceEngine.a libaec.a libresampler.a libanr.a libjpeg.a -o hello


extern "C" void testc();
extern "C" int HI_MPI_VB_Exit();
extern "C" int HI_MPI_VB_Init();

int main()
{

if( HI_MPI_VB_Exit()==0)
printf("HI_MPI_VB_Exit ok\n");
else
printf("HI_MPI_VB_Exit err\n");


if( HI_MPI_VB_Init()==0)
printf("HI_MPI_VB_Init() ok\n");
else
printf("HI_MPI_VB_Init() err\n");

testc();
cout<<"Hello c++, Linux!"<<endl;
printf("\n");
return 0;
}
#include<stdio.h>
//arm-hisiv200-linux-gcc hello.c -o hell
//arm-hisiv200-linux-gcc -c hello.c ;
//arm-hisiv200-linux-ar crv libhello.a hello.o


void testc()
{
printf("hello c \n");
}



举报

相关推荐

Linux编译器-gcc/g++(动静态链接)

GCC/G++

【Linux】编译器-gcc/g++使用

GCC的gcc和g++区别

gcc与g++的区别

gcc和g++的使用

Linux | gcc/g++的使用

0 条评论