Author Topic: Help in linking python lib  (Read 3923 times)

Offline gReaen

  • Multiple posting newcomer
  • *
  • Posts: 18
Help in linking python lib
« on: March 18, 2008, 05:22:48 pm »
Hello all,
I have a project which requires python files. I have included the python Include directory in the project build options Search directories. But the functions in those files require library files which are in .py format.
I tried linking the same but when i build my project, it shows a syntax error in those .py files and the file is displayed to be empty...
Is there a way to link the python libraries in Code::Blocks?

The components i have:
OS: Windows XP (SP2)/Windows 2000
CB: Nightly build 4893
Compiler: MinGW 5.1
wxWidgets: 2.8.7

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Help in linking python lib
« Reply #1 on: March 18, 2008, 10:31:19 pm »
do the .py files contain c/c++ or python?

if python then you can't compile them but you can import them by embedding python into your app (you would need to including relevant python headers and link against the libpython). if that is what you want to do, then this isn't really a codeblocks specific issue so your needs would probably be better met on another board. you might get some tips on how to setup the project files and CB environment here but that's about it.

if c/c++ then I'm just confused

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Help in linking python lib
« Reply #2 on: March 19, 2008, 09:33:25 am »
If any kind of file appears empty, chances are there are invalid characters in it. Check your encoding.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline gReaen

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Help in linking python lib
« Reply #3 on: March 19, 2008, 02:14:14 pm »
Hello,
Thanks for the help. The files contained python statements. I have linked the lib file now and it works fine.