boost python´«µÝÒýÓã¿
void xxx(int& x)
{
x = 100;
}
def("xxx", xxx);
import y
a = 0
y.xxx(a)
±¨´íÁË£º
ArgumentError: Python argument types in
L0_L1.xxx(int)
did not match C++ signature:
xxx(int {lvalue})
ÇëÎÊÏñÕâÖÖ´«µÝÒýÓõĺ¯ÊýÈçºÎÓÃboost·â×°£¿
ͬÒ⣬BoostÒ²²»ÊÇÍòÄܵ쬻¹ÊÇÓкܶàËü²»Äܰü×°µÄ¶«Î÷¡£
xxx(&_x)´«µÝµÄÊÇ_xµÄµØÖ·£¬Òª´«µÄÊÇÒ»¸öÒýÓã¬ÔÚC++Àï±àÒ뱨´í£¬ÎÞ·¨½«int* ת»¯Îªint&£¬¸ÃÔõôÉè¼Æ£¿
°¡...Ã÷ÏÔ²ÎÊý´íÁË£¬Ò²Â©·µ»ØÖµ¡£ÊÔÊÔ¸üÕýº¯ÊýÌåΪ{xxx(_x);return _x;}
Ïà¹ØÎÊ´ð£º
×î½üÓÃpythonдһ¸ö³ÌÐò,×ÜÊÇÒì³£Í˳ö£¬µ«ÊÇȴû·¨ÓÃtry..exceptÀ´²¶×½
ÓÉÓÚû·¨·¢Í¼Æ¬£¬ËùÒÔ°ÑÏà¹ØµÄÐÅÏ¢´òÓ¡³öÀ´
Òì³£µÄÐÅÏ¢´óÖÂÈçÏ£º
python.exeÓöµ½ÎÊÌâÐèÒª¹Ø±Õ¡£ÎÒÃǶԴËÒýÆðµÄ²»±ã±íʾ±§Ç¸ ......
֮ǰÎҵĵçÄÔÉϰ²×°ÁËIronPython2.0,ºó°²×°ShareDevelop3.0,²ÉÓÃĬÈÏÉèÖÃ
ÎÒÔÚShareDevelopÖн¨Á¢ÁËÒ»¸öĬÈϵÄPythonµÄ¿ØÖÆÌ¨»ò´°ÌåÏîÄ¿,ÔËÐÐʱ±¨´íÈçÏÂ:
µ÷ÊÔÆ÷Å׳öÒì³£System.IO.FileNotFoundException: ......
ÓźñµÄ¸å³ê£¬³ÏÕÐPython¼¼ÊõÈËÔ±²ÎÓë¸÷ÖÖ¼¼ÊõÊé¼®³ö°æ¡£
ͨ¹ý¸ÃÊé¼®£¬×÷Õß¿ÉÒԵõ½Èçϱ¨³ê£º
1¡¢·áºñµÄ¸å³ê¡£
2¡¢Êé¼®Öø×÷µÄÊðÃûȨ¡£
3¡¢¶Ô×÷ÕߺÍÊé½øÐÐÐû´«£¬Ìá¸ß×÷ÕßÔÚ¼¼ÊõȦ×ÓÀ ......