Why I can't to use my function that is in .so file?
===

I'm trying to write a program to call my .so file in Android.

main.cpp:

    #include <stdio.h>
    #include <dlfcn.h>
    #include <stdlib.h>
    
    typedef int (*test_ptr)(int, int);
    
    int main()
    {
        int rc;
        void *handle;
        const char *error;
        
        handle = dlopen("./testdll.so", RTLD_LAZY);
        if(!handle){
            printf("dlopen %s\n", dlerror());
            return -1;
            }
        printf("dlopen success.\n");
        
        test_ptr test = (test_ptr)dlsym(handle, "max");
        error = dlerror();
        if (error)  {
            printf("error %s\n", error);
            dlclose(handle);
            return -1;
        }
        rc = test(10, 20);
        printf("rc = %d\n", rc);
        
        dlclose(handle);
    	return 1;
    }

testdll.cpp:

    #include<stdio.h>
    
    int max(int x,int y){
        return x>y?x:y;
    }

Android.mk:

    LOCAL_PATH:= $(call my-dir)
    include $(CLEAR_VARS)
    LOCAL_SRC_FILES:= \
        testdll.cpp
    LOCAL_MODULE_TAGS := optional
    LOCAL_PRELINK_MODULE := true
    LOCAL_LDFLAGS := -Wl,--export-dynamic
    LOCAL_MODULE:= testdll
    include $(BUILD_SHARED_LIBRARY)
    
    include $(CLEAR_VARS)
    LOCAL_SRC_FILES:= \
    	main.cpp
    LOCAL_LDLIBS := -ldl
    LOCAL_SHARED_LIBRARIES := \
    libcutils   \
    libdl
    LOCAL_MODULE_TAGS := optional
    LOCAL_PRELINK_MODULE := true
    LOCAL_MODULE := mytest
    LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
    include $(BUILD_EXECUTABLE)

and I use **mmm** to make file and push **testdll.so** in to **/system/lib** and **mytest** to **/data/data**.

Then I run **./mytest**, it can **open testdll.so successed**, but can't connect my function.

error is:

    Symbol not found:

Anybody know how to solve this problem?