FIX : To run embeded application, it complains for missing libgcc_s_dw2-1.dll and libstdc++-6.dll.(#60)

This commit is contained in:
Edison 2013-06-15 19:04:29 +08:00
parent b3cb20d6eb
commit e07a1e2f57

View File

@ -468,7 +468,8 @@ setting the boot classpath to "[bootJar]".
$ cat >embedded-jar-main.cpp <<EOF $ cat >embedded-jar-main.cpp <<EOF
#include "stdint.h" #include "stdint.h"
#include "jni.h" #include "jni.h"
#include "stdlib.h"
#if (defined __MINGW32__) || (defined _MSC_VER) #if (defined __MINGW32__) || (defined _MSC_VER)
# define EXPORT __declspec(dllexport) # define EXPORT __declspec(dllexport)
@ -496,6 +497,8 @@ setting the boot classpath to "[bootJar]".
} }
} // extern "C" } // extern "C"
extern "C" void __cxa_pure_virtual(void) { abort(); }
int int
main(int ac, const char** av) main(int ac, const char** av)
@ -557,7 +560,7 @@ __on Mac OS X:__
__on Windows:__ __on Windows:__
$ g++ -I$JAVA_HOME/include -I$JAVA_HOME/include/win32 \ $ g++ -fno-exceptions -fno-rtti -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/win32" \
-D_JNI_IMPLEMENTATION_ -c embedded-jar-main.cpp -o main.o -D_JNI_IMPLEMENTATION_ -c embedded-jar-main.cpp -o main.o
__5.__ Link the objects produced above to produce the final __5.__ Link the objects produced above to produce the final
@ -577,7 +580,7 @@ __on Windows:__
$ dlltool -z hello.def *.o $ dlltool -z hello.def *.o
$ dlltool -d hello.def -e hello.exp $ dlltool -d hello.def -e hello.exp
$ g++ hello.exp *.o -L../../win32/lib -lmingwthrd -lm -lz -lws2_32 \ $ gcc hello.exp *.o -L../../win32/lib -lmingwthrd -lm -lz -lws2_32 \
-mwindows -mconsole -o hello.exe -mwindows -mconsole -o hello.exe
$ strip --strip-all hello.exe $ strip --strip-all hello.exe