**********==問題描述**********==
今天同事給我發來乙個檔案,說讓我通過android呼叫裡面的函式檔案是:
裡面的內容是:
call_so.cpp檔案的內容:
#pragma pack(1) //非常重要的申明,記憶體對齊的方法,影響sizeof()的結果
#include
#include
#include
#include "operation_tools.h"
#include "call_so.h"
char uv_file_name[1024];
int uv_class_type = 1;
int uf_call_so_file(lpbyte inhdib,rect inarea)
call_so.h的內容:
#ifndef __callso__
#define __callso__
int uf_call_so_file(lpbyte inhdib,rect inarea);
#endif
operation_tools.sh的內容:
#ifndef __operationtools__
#define __operationtools__
#include
#include
#include
#include
#include
using namespace std;
typedef unsigned long dword;
typedef int bool;
typedef unsigned char byte;
typedef unsigned short word;
typedef float float;
//typedef dword far* lpdword;
typedef dword *lpdword;
typedef unsigned char * lpbyte;
typedef int int;
typedef unsigned int uint;
typedef unsigned int *puint;
typedef long long;
#define pthread_t handle
#define pthread_mutex_t handle
#define pthread_cond_t handle
typedef void *handle;
typedef handle hlocal;
typedef lpbyte hdib;
#define lpstr char*
#include
#include
#ifndef _rect_
#define _rect_
struct _rect
;#ifndef _declare_maxvalue
#define _declare_maxvalue
typedef struct
maxvalue;
#endif
typedef _rect rect;
#define lmem_moveable 0x0002
#define lmem_zeroinit 0x0040
#define lhnd (lmem_moveable | lmem_zeroinit)
/*typedef int bool;
typedef unsigned char byte;
typedef float float;
typedef float *pfloat;
typedef char char;
typedef unsigned char uchar;
typedef unsigned char *puchar;
typedef short short;
typedef unsigned short ushort;
typedef unsigned short *pushort;
typedef long long;
typedef unsigned short word;
typedef unsigned long dword;
typedef long long longlong;
typedef unsigned long long ulonglong;
typedef ulonglong *pulonglong;
typedef unsigned long ulong;
typedef int int;
typedef unsigned int uint;
typedef unsigned int *puint;
typedef void void;
typedef char *lpstr;
typedef const char *lpcstr;
typedef wchar_t wchar;
typedef wchar *lpwstr;
typedef const wchar *lpcwstr;
typedef dword *lpdword;
typedef unsigned long uint_ptr;
typedef uint_ptr size_t;
typedef longlong usn;
typedef byte boolean;
typedef void *pvoid;
typedef struct _filetime filetime;
typedef union _ularge_integer ;
struct u;
ulonglong quadpart;
} ularge_integer,
*pularge_integer;
*/#endif
#ifndef _point_
#define _point_
struct _point
;typedef _point point;
#endif
/*#ifndef _new_
#define _new_
// 過載了全域性的new操作符
void* operator new (unsigned int size)
#endif
#ifndef _delete_
#define _delete_
// 過載了全域性的delete操作符
void operator delete (void *ptr)
#endif
*///#include "cstring_linux/cstring.h"
//#include "../../sdk/inc_all/l999_struct.h"
//#include "../../sdk/inc_all/wb_struct.h"
//#include "../myjc/myjc.h"
//#include "control_lgq.h"
#endif
call_so.o的檔案點不開。。。
問題是我需要呼叫那個檔案,,如何呼叫????
本人是新手,求大神們指導
如果有dome最好。。。。
**********==解決方案1**********==
你這是android呼叫c++**。。
看看這個
Unity Android呼叫 so檔案
最近做乙個專案,發布目標平台是android,開發中需要呼叫甲方的.so檔案 用ndk直接編譯c 檔案而成 網上查了下呼叫方式,和呼叫dll相同,大致步驟如下 1.將.so檔案放在assets plugins android目錄下 2.c 檔案中使用 dllimport 檔名 不含lib字首和.so...
python呼叫 so檔案
專案需要python呼叫.so檔案,使用網上的教程會丟擲異常。而這種方法可以完整呼叫,但是我忘記當初是怎麼寫的了。如果後面還要用到再來完善。from ctypes import adddll cdll.loadlibrary libpyckapi.so adddll.sendrequestautho...
Nginx lua 實現呼叫 so檔案
本文給大家分享的是nginx結合lua 實現呼叫.so動態鏈結庫檔案的方法和示例,有需要的小夥伴可以參考下 最近在和智慧型硬體部門一起,做乙個室內定位的服務,該服務根據手機端傳過來的beacon裝置列表,根據一定的演算法計算出具體的商場,並將商場id和beason裝置列表作為引數,呼叫.so檔案中的...