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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/mao0514/article/details/84974645
#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");
}

猜你喜欢

转载自blog.csdn.net/mao0514/article/details/84974645