2006年09月12日 星期二 00:42
ÜëBâH§² )öjW«®Ë4uÓz-¢§~)^§+a¢}·vXºèì^rëb bG±zÖ§ì^Õê뢻4Áªçx,N§ÃÚr¶'r§zÇ¢éÜzÉb²Û)ÊØhÉæj)m¢Ü)Þ±æèºw²X¬¶Êr¶'rxÞ®¼¶ÓN¸ë]<§+a¢w!w¬zX¬¶Êr¶'rt^§+a¢w!w¬yÊr¶'öãa¶Úlÿü0ë(~ÜèÊ&ýׯzZ)z¼(®K?yÛjبùiÊØhÇ+w^Æf)Üç^?+a¢x ·µæºw-í¢§vW®º+³^Ø^ʺ¿ï¢'^®º+r«zºì¶¸§â×ìêë²Úâ±ÝbÙÒzÛ©¶¯j¸nW¬¶hÙ¶±û§rبƧuÉZ²È§²Ö§qëj·§ èÂ)e]¢êëzÛ«ö¥¹ïÏÈæãyËkzÙ²\«,ëa¡Ö«Êç-~Zµö«zx^Óò"x©bÍïË¡§hº¹¨vé^þl¦¡Óò"jh®Ò&¦í2nçÈ®³òÁçhص£ò¶'¡¸ÞrÖÚrKaz·°jÆ©®åzoâ~l¦¡
2006年09月12日 星期二 08:26
asong:
没有找到Python的Debug连接库文件。
可以自己用Python的源代码编译一个出来;
也可以把你程序的编译连接方式改为Release方式(就是用发布方式的,不要Debug信息的)。
致
礼!
风尘无限
Bejing HATL Information Technology Co. Ltd.
tianyu263在163.com
2006-09-12 08:23:46
= = = = = = = = = = = = = = = = = = = =
======= 2006-09-12 00:37:41 您在来信中写道:=======
>HI ,
>
> 我看到这个例子,在vc6.0下编译怎么出现这样的错误,我哪里设置有问题
>么?
>
>Linking...
>
>LINK : fatal error LNK1104: cannot open file "python23_d.lib"
>
>Error executing link.exe.
>
>
>
>tank.exe - 1 error(s), 0 warning(s)
>
>
>
>Thanks!
>
>Palo
>
>
>
> _____
>
>发件人: python-chinese-bounces在lists.python.cn
>[mailto:python-chinese-bounces在lists.python.cn] 代表 jerry
>发送时间: 2006年4月6日 1:08
>收件人: python-chinese在lists.python.cn
>主题: Re: [python-chinese] c与python交互
>
>
>
>从网上看到的一个例子(有C代码和PYTHON代码),应该可以解决你的问题。
>
>https://www6.software.ibm.com/developerworks/education/l-pythonscript/index.
>html
>
>
>
>#include
>
>/* Create a function to handle errors when they occur */
>void error(char errstring)
>{
> printf("%s\n",errstring);
> exit(1);
>}
>
>int main()
>{
>/* Set up the variables to hold methods, functions and class
> instances. farenheit will hold our return value */
> PyObject *ret, *mymod, *class, *method, *args, *object;
> float farenheit;
>
> Py_Initialize();
>
>/* Load our module */
> mymod = PyImport_ImportModule("celsius");
>
>/* If we dont get a Python object back there was a problem */
> if (mymod == NULL)
> error("Can't open module");
>
>/* Find the class */
> class = PyObject_GetAttrString(mymod, "celsius");
>
>/* If found the class we can dump mymod, since we won't use it
> again */
> Py_DECREF(mymod);
>
>/* Check to make sure we got an object back */
> if (class == NULL)
> {
> Py_DECREF(class);
> error("Can't find class");
> }
>
>/* Build the argument call to our class - these are the arguments
> that will be supplied when the object is created */
> args = Py_BuildValue("(f)", 100.0);
>
> if (args == NULL)
> {
> Py_DECREF(args);
> error("Can't build argument list for class instance");
> }
>
>/* Create a new instance of our class by calling the class
> with our argument list */
> object = PyEval_CallObject(class, args);
> if (object == NULL)
> {
> Py_DECREF(object);
> error("Can't create object instance");
> }
>
>/* Decrement the argument counter as we'll be using this again */
> Py_DECREF(args);
>
>/* Get the object method - note we use the object as the object
> from which we access the attribute by name, not the class */
> method = PyObject_GetAttrString(object, "farenheit");
>
> if (method == NULL)
> {
> Py_DECREF(method);
> error("Can't find method");
> }
>
>/* Decrement the counter for our object, since we now just need
> the method reference */
> Py_DECREF(object);
>
>/* Build our argument list - an empty tuple because there aren't
> any arguments */
> args = Py_BuildValue("()");
>
> if (args == NULL)
> {
> Py_DECREF(args);
> error("Can't build argument list for method call");
> }
>
>/* Call our object method with arguments */
> ret = PyEval_CallObject(method,args);
>
> if (ret == NULL)
> {
> Py_DECREF(ret);
> error("Couldn't call method");
> }
>
>/* Convert the return value back into a C variable and display it */
> PyArg_Parse(ret, "f", &farenheit;);
> printf("Farenheit: %f\n", farenheit);
>
>/* Kill the remaining objects we don't need */
> Py_DECREF(method);
> Py_DECREF(ret);
>
>/* Close off the interpreter and terminate */
> Py_Finalize();
> return 0;
>}
>
>
>/////////////////
>
>class celsius:
> def __init__(self, degrees):
> self.degrees = degrees
> def farenheit(self):
> return ((self.degrees*9.0)/5.0)+32.0
>
>
>
>
>
>On 4/5/06, Robert Chen <search.pythoner在gmail.com> wrote:
>
>我建议你还是用正统的Python的C扩展方式,用一个C的dll包装你的C++的class,呵
>呵,这个不会耽误你太多时间 :)
>
>On 4/5/06, 吴俊玉 < wujunyu在gmail.com wujunyu在gmail.com> > wrote:
>
>要崩溃了!
>
>
>
>今天又看了一些boost,确实看到了一些例子能够把类封装成python模块,
>
>天哪,还是使用bjam的,以前就没有手写过makefile,等于又要学一样工具
>
>我又晕头转向编译了一下boost,
>
>
>
>还是使用dll的――我可不想使用dll的方式
>
>而且boost的这种方式让我害怕
>
>时间不多了,还有5天要完成编码了!
>
>明天看一下boost。python源码吧!希望有帮助、
>
>
>
>
>
>
>
>
>
>_______________________________________________
>python-chinese
>Post: send python-chinese在lists.python.cn
>python-chinese在lists.python.cn>
>Subscribe: send subscribe to python-chinese-request在lists.python.cn
>Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn
>Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
>
>
>--
>Robert
>Python源码剖析――http://blog.donews.com/lemur/
>
>
>_______________________________________________
>python-chinese
>Post: send python-chinese在lists.python.cn
>Subscribe: send subscribe to python-chinese-request在lists.python.cn
>Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn
>Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
>_______________________________________________
>python-chinese
>Post: send python-chinese在lists.python.cn
>Subscribe: send subscribe to python-chinese-request在lists.python.cn
>Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn
>Detail Info: http://python.cn/mailman/listinfo/python-chinese
2006年09月12日 星期二 08:49
On 09/12/2006 at 00:42, asong wrote: > HI , > > 我看到这个例子,在vc6.0下编译怎么出现这样的错误,我哪里设置有问题 > 么? > > Linking... > > LINK : fatal error LNK1104: cannot open file "python23_d.lib" > > Error executing link.exe. > > > > tank.exe - 1 error(s), 0 warning(s) #undef _DEBUG #include#define _DEBUG -- (reply-to (concat "snlee99" "@" "tom" "." "com"))
2006年09月12日 星期二 09:02
Ò²¿ÉÒÔ±àÒëÒ»¸ödebug°æµÄÁ´½Ó¿â¡£ 2006/9/12, Darren <snlee99在tom.com>: > > On 09/12/2006 at 00:42, asong wrote: > > > HI , > > > > ÎÒ¿´µ½Õâ¸öÀý×Ó£¬ÔÚvc6.0ϱàÒëÔõô³öÏÖÕâÑùµÄ´íÎó£¬ÎÒÄÄÀïÉèÖÃÓÐÎÊÌâ > > ô£¿ > > > > Linking... > > > > LINK : fatal error LNK1104: cannot open file "python23_d.lib" > > > > Error executing link.exe. > > > > > > > > tank.exe - 1 error(s), 0 warning(s) > > #undef _DEBUG > #include> #define _DEBUG > > > -- > (reply-to (concat "snlee99" "@" "tom" "." "com")) > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -- »¶Ó·ÃÎÊ£º http://blog.csdn.net/ccat ÁõöÎ March.Liu -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20060912/6c4eefa3/attachment.html
2006年09月13日 星期三 00:30
En,改成release版本编译就好了,谢谢大家了, Debug 版本的编译库明天编译一个再试试。 Thanks! Palo _____ 发件人: python-chinese-bounces at lists.python.cn [mailto:python-chinese-bounces at lists.python.cn] 代表 刘鑫 发送时间: 2006年9月12日 9:02 收件人: python-chinese at lists.python.cn 主题: Re: [python-chinese] 答复: c与python交互 也可以编译一个debug版的链接库。 2006/9/12, Darren <snlee99 at tom.com>: On 09/12/2006 at 00:42, asong wrote: > HI , > > 我看到这个例子,在vc6.0下编译怎么出现这样的错误,我哪里设置有问题 > 么? > > Linking... > > LINK : fatal error LNK1104: cannot open file "python23_d.lib" > > Error executing link.exe. > > > > tank.exe - 1 error(s), 0 warning(s) #undef _DEBUG #include#define _DEBUG -- (reply-to (concat "snlee99" "@" "tom" "." "com")) _______________________________________________ python-chinese Post: send python-chinese at lists.python.cn Subscribe: send subscribe to python-chinese-request at lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese -- 欢迎访问: http://blog.csdn.net/ccat 刘鑫 March.Liu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20060913/d8555157/attachment-0001.html
Zeuux © 2025
京ICP备05028076号