C?????C++???????λ??????
???????????? ???????[ 2014/8/26 10:52:25 ] ????????NET C C++
???????濪?????:
//test.c
#include "stdio.h"
#include "dlfcn.h"
#define SOFILE "sec.so"
int (*f)();
int main()
{
void *dp;
dp=dlopen(SOFILE??RTLD_LAZY);
f=dlsym(dp??"f");
f();
return 0;
}
????????????????:
????gcc -rdynamic -s -o myapp test.c
????????Z$./myapp
????10
????$
??????????????μ?????????http://blogs.sun.com/lirincy/
???????blogд????????C????C++?????????????£???linux??????
??????????????????£????????????????
????gcc -rdynamic -s -o -ldl myapp test.c
??????????test.c????ü????
????dlclose(dp);
?????????CoreDump??
???????????????????????????????????????C????????extern C??
????????C++??????ε???C????д?????a.lib????ж?????????a.h??????a.h?ж????????:
????int WhyCoding(int a?? float b);
???????????
????/* cpp_a.h */
????extern "C" {
????#include "a.h"
????}
??????
????/* cpp_a.h */
????extern "C" {
????int WhyCoding(int a?? float b); /* ????????е?C???? */
????}
??????????????????extern "C" ??????C??C++??????????????????????????????C????????????????????????????????????????????????????C???????????int a(float x)?????????_a??????????C???????????????ú?????????????????????????????????????????????????C?????????????????C++???????????????????????????????????????????????????????a????????????_a_float???????????????????????????????д?????????????????????C++???????ú?????????????????????????????????????????????????????????????????????????????
?????????????C????C++??????????÷?????????C++????????÷????C???????C?????????extern "C" ???????????????????????£??????C??????????????????????.????????????????C++????????C++???????????extern "C" ????????????C????????????????????????????C++???????C++???????????C???????--????????????C???????????C++???????C????????????????????C????C++???.
????????C++????C??????extern "C" ???????????C++??????????ú?????????????C???????????_a??????_a_float??????ú?????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????