I used a c++ code for android project, so I use the NDK tools.
The IDE is eclipse.
When compile the project, I got the error for memcpy function:
Invalid arguments '
Candidates are:
void * memcpy(void *, const void *, ?)
'
It happens for malloc, strftime too.
I developed under Windows system.
Why?
Here is part of my code:
#include <vector>
#include <iostream>
#include <fstream>
#include <iterator>
#include "dirent.h"
#include <jni.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <android/log.h>
string getCurrentDate() {
    time_t rawtime;
    struct tm * timeinfo;
    char buffer[80];
    time(&rawtime);
    timeinfo = localtime(&rawtime);
    // #######################error part
    strftime(buffer, 80, "%Y-%m-%d_%H-%M-%S", timeinfo);
    string timeStr(buffer);
    return timeStr;
}
std::string jstring2str(JNIEnv* env, jstring jstr) {
    char* rtn = NULL;
    jclass clsstring = env->FindClass("java/lang/String");
    jstring strencode = env->NewStringUTF("GB2312");
    jmethodID mid = env->GetMethodID(clsstring, "getBytes",
            "(Ljava/lang/String;)[B");
    jbyteArray barr = (jbyteArray) env->CallObjectMethod(jstr, mid, strencode);
    jsize alen = env->GetArrayLength(barr);
    jbyte* ba = env->GetByteArrayElements(barr, JNI_FALSE);
    if (alen > 0) {
        // ####################error for malloc
        rtn = (char*) malloc(alen + 1);
        // ####################error for memcpy
        memcpy(rtn, ba, alen);
        rtn[alen] = 0;
    }
    env->ReleaseByteArrayElements(barr, ba, 0);
    std::string stemp(rtn);
    free(rtn);
    return stemp;
}
...