I tried those command but it still complained can not open -lstdc++ when I
executed the second command. Then I tried the following commands and they
worked:
1. g++ -static -c program.c -o program.o ( Actually, my program is a c program
not a c++ program).
2. gcc -static program.o -L$(MY_LIB_PATH) -lmylib -o program
(Here I use gcc instead of g++ and I did not specify the stdc++ library path at all).
Anyway, your hints did help me a lot. Thank you!