Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ Python
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?
Posted 8-Nov-12 11:03am
Rate this: bad
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.
Sergey Alexandrovich Kryukov at 8-Nov-12 18:40pm
Agree, a 5.
Marcus Kramer at 8-Nov-12 18:50pm
Thanks, Sergey
Qianfei Li at 9-Nov-12 12:20pm
Thanks for the thought!
Rate this: bad
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
Sergey Alexandrovich Kryukov at 8-Nov-12 18:41pm
Another link to an interesting project, a 5, good to know, thank you for sharing.
Espen Harlinn at 8-Nov-12 18:51pm
Thanks, Sergey - If you could have a look at
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...
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... :-)
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...)
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. :-)
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

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

  Print Answers RSS
0 Peter Leow 308
1 Kornfeld Eliyahu Peter 220
2 Sergey Alexandrovich Kryukov 162
3 Maciej Los 160
4 OriginalGriff 153
0 OriginalGriff 383
1 Peter Leow 318
2 Kornfeld Eliyahu Peter 260
3 Maciej Los 230
4 Sergey Alexandrovich Kryukov 212

Advertise | Privacy | Mobile
Web01 | 2.8.150301.1 | Last Updated 8 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100