Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++Python
Hi,
 
Need some help embedding Python in C++, following the article:
Embedding Python in C/C++: Part I[^]
 
My system:
Windows 7 64bit
Python 2.7
VS 2005
 
I've already included Python27/lib and Python27/include in my VC++ additional include directories. In addition, I was using "release" mode. However, I still have the fatal error:
LINK : fatal error LNK1104: cannot open file 'python27.lib'
 
Anyone has the similar problem before?
 
Thanks!!
Posted 8-Nov-12 10:03am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

If you're going down that road, you're probably better off basing your work on Boost Python[^]
 
As for your error:LINK : fatal error LNK1104: cannot open file 'python27.lib'
 
You need to tell the linker where to find the library.
Linker->General->Additional Library Directories
 
Best regards
Espen Harlinn
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 8-Nov-12 18:41pm
   
Another link to an interesting project, a 5, good to know, thank you for sharing. --SA
Espen Harlinn at 8-Nov-12 18:51pm
   
Thanks, Sergey - If you could have a look at http://www.codeproject.com/Articles/471662/Windows-Development-in-Cplusplus-working-with-menu Any thoughts you would have about it would be greatly appreciated
Sergey Alexandrovich Kryukov at 19-Nov-12 18:43pm
   
Looks nice, but, according to my records. 2 more of your articles wait in line for my review. First of all, I found some problems in your work on dependencies -- very nice WPF technique and styling, but I wish you had more essential functionality. Another one is on Direct2D. I'll try to review them, if I find I have enough expertize on the topics, but some time later. I have 100% complete code to publish an article by myself, cannot get enough courage to sit down and write the whole text at once, waiting for more room in my free time... I don't count 2-3 articles with "almost complete" code and one major work... Hopefully, I'll get some time and prioritize it all soon enough... --SA
Espen Harlinn at 19-Nov-12 19:08pm
   
My last 4 articles share the same codebase, currently crawling towards 1.7MB of C++ code - and it's fair to say I've only just got started. So I've put a wee bit more work into the code than the articles - so far I'm only creating "lego" bricks, that is the basic building blocks for a framework. As for Depends4Net - I certainly intended to do a bit more work on it, but so far I haven't gotten around to it ;) >> cannot get enough courage to sit down and write the whole text at once I would certainly describe some of mine as work-in-progress - still, I think, getting some feedback is quite useful. Look at the difference between the two articles on Depends4Net - the first has a nice picture on the top, while the second contains far more practical code examples and descriptions - still, the first got far better response. I tend to view it as a learning experience ...
Sergey Alexandrovich Kryukov at 19-Nov-12 19:34pm
   
I was talking it because earlier I relatively easily programmatically detected dependency diagram; even though I did it in console application, I needed work result, not application. Maybe you could use the idea. Actually, messing with all this stuff is very useful when you just get some project made by a team before you, and really need to dig into this can of worms to sort things out... :-) --SA
Espen Harlinn at 19-Nov-12 19:44pm
   
I've picked up a few tricks that I would like to incorporate from ILSpy - but for now, I will continue on the C++ library - I guess it's time to call it a night ...
Sergey Alexandrovich Kryukov at 19-Nov-12 20:01pm
   
Agree. But I'm still at work, want to go home (20:01), but... your time is 2AM, right? Going to do some work tomorrow, or what? :-) (As to me, I often can allow myself to sleep in the morning...) --SA
Espen Harlinn at 20-Nov-12 4:16am
   
Yes, it was about 2:00AM - and I was back at work at 9:00PM - so, yes, sleep sounds just wonderful
Sergey Alexandrovich Kryukov at 20-Nov-12 11:24am
   
You take care of yourself. :-) --SA
Qianfei Li at 9-Nov-12 12:21pm
   
Thanks a lot Espen. I solved the case and am looking at Boost.Python now!
Espen Harlinn at 9-Nov-12 12:23pm
   
That's brilliant :-D
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Your question would be better placed at the bottom of the article in question rather than here. You stand a much better chance of the author seeing it then and being able to answer.
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 8-Nov-12 18:40pm
   
Agree, a 5. --SA
Marcus Kramer at 8-Nov-12 18:50pm
   
Thanks, Sergey
Qianfei Li at 9-Nov-12 12:20pm
   
Thanks for the thought!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Shai Vashdi 440
1 Sergey Alexandrovich Kryukov 221
2 OriginalGriff 183
3 Tadit Dash 160
4 Guruprasad.K.Basavaraju 125
0 Sergey Alexandrovich Kryukov 9,255
1 OriginalGriff 5,433
2 Peter Leow 4,100
3 Maciej Los 3,540
4 Abhinav S 3,333


Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 8 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid