C 嵌入 Pythom 編譯問題

我們生活周遭存在太多太多的 embedded system ,過去 embedded system 有專屬的 OS,現在 linux 也可以應用在嵌入式環境,不過本版將廣泛討論所有嵌入式系統不只 linux 喔,歡迎有這方面經驗或有興趣的朋友一同進來討論。

版主: chester

C 嵌入 Pythom 編譯問題

文章shihyu » 週二 4月 03, 2007 3:21 pm

抱歉我不知道這問題要post 那個版比較適當 ..



代碼: 選擇全部
#include <Python.h>

int main(void){
    Py_Initialize();
    PyRun_SimpleString("from time import time,ctime\n"
                        "print 'Today is',ctime(time()\n)");
    Py_Finalize();
    return 1;

}



gcc -I/opt/python/include/python2.4 -L/opt/python/lib -lpython2.4 -o test_py test_py.c

上面程式碼是我在網路上看到的


不過我opt 資料夾沒有任何東西 , 我查了一下我python 所有檔案擺放位置

不過我也沒看到 include & lib 我想知道debian 會把python include & lib 會在哪個路徑下?

還是opt 中要有python/lib 及 python/include/python2.4 是要另外安裝?

下面是我主機 python 所有檔案擺放位置

代碼: 選擇全部
debian:~$ dpkg -L python

python/include/python2.4 /.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/python
/usr/share/doc/python/faq
/usr/share/doc/python/faq/extending.html
/usr/share/doc/python/faq/general.html
/usr/share/doc/python/faq/gui.html
/usr/share/doc/python/faq/installed.html
/usr/share/doc/python/faq/library.html
/usr/share/doc/python/faq/programming.html
/usr/share/doc/python/faq/windows.html
/usr/share/doc/python/FAQ.html
/usr/share/doc/python/python-policy.html
/usr/share/doc/python/python-policy.html/index.html
/usr/share/doc/python/python-policy.html/ch-python.html
/usr/share/doc/python/python-policy.html/ch-module_packages.html
/usr/share/doc/python/python-policy.html/ch-programs.html
/usr/share/doc/python/python-policy.html/ch-embed.html
/usr/share/doc/python/python-policy.html/ch-other.html
/usr/share/doc/python/python-policy.html/ap-build_dependencies.html
/usr/share/doc/python/python-policy.html/ap-packaging_tools.html
/usr/share/doc/python/python-policy.html/ap-upgrade.html
/usr/share/doc/python/python-policy.txt.gz
/usr/share/doc/python/changelog.Debian.gz
/usr/share/doc/python/README.Debian
/usr/share/doc/python/copyright
/usr/share/doc/python/python-policy.sgml.gz
/usr/share/doc/python2.4
/usr/share/man
/usr/share/man/man1
/usr/share/pixmaps
/usr/share/pixmaps/python.xpm
/usr/share/apps
/usr/share/apps/konsole
/usr/share/apps/konsole/python.desktop
/usr/share/doc-base
/usr/share/doc-base/python-policy
/usr/bin
/usr/lib
/usr/lib/valgrind
/usr/lib/valgrind/python.supp
/usr/share/doc/python2.4/python-policy.html
/usr/share/doc/python2.4/python-policy.sgml.gz
/usr/share/doc/python2.4/python-policy.txt.gz
/usr/share/man/man1/pydoc.1.gz
/usr/share/man/man1/pygettext.1.gz
/usr/share/man/man1/pdb.1.gz
/usr/bin/pyversions
/usr/bin/pydoc
/usr/bin/pygettext
/usr/bin/pdb/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/python
/usr/share/doc/python/faq
/usr/share/doc/python/faq/extending.html
/usr/share/doc/python/faq/general.html
/usr/share/doc/python/faq/gui.html
/usr/share/doc/python/faq/installed.html
/usr/share/doc/python/faq/library.html
/usr/share/doc/python/faq/programming.html
/usr/share/doc/python/faq/windows.html
/usr/share/doc/python/FAQ.html
/usr/share/doc/python/python-policy.html
/usr/share/doc/python/python-policy.html/index.html
/usr/share/doc/python/python-policy.html/ch-python.html
/usr/share/doc/python/python-policy.html/ch-module_packages.html
/usr/share/doc/python/python-policy.html/ch-programs.html
/usr/share/doc/python/python-policy.html/ch-embed.html
/usr/share/doc/python/python-policy.html/ch-other.html
/usr/share/doc/python/python-policy.html/ap-build_dependencies.html
/usr/share/doc/python/python-policy.html/ap-packaging_tools.html
/usr/share/doc/python/python-policy.html/ap-upgrade.html
/usr/share/doc/python/python-policy.txt.gz
/usr/share/doc/python/changelog.Debian.gz
/usr/share/doc/python/README.Debian
/usr/share/doc/python/copyright
/usr/share/doc/python/python-policy.sgml.gz
/usr/share/doc/python2.4
/usr/share/man
/usr/share/man/man1
/usr/share/pixmaps
/usr/share/pixmaps/python.xpm
/usr/share/apps
/usr/share/apps/konsole
/usr/share/apps/konsole/python.desktop
/usr/share/doc-base
/usr/share/doc-base/python-policy
/usr/bin
/usr/lib
/usr/lib/valgrind
/usr/lib/valgrind/python.supp
/usr/share/doc/python2.4/python-policy.html
/usr/share/doc/python2.4/python-policy.sgml.gz
/usr/share/doc/python2.4/python-policy.txt.gz
/usr/share/man/man1/pydoc.1.gz
/usr/share/man/man1/pygettext.1.gz
/usr/share/man/man1/pdb.1.gz
/usr/bin/pyversions
/usr/bin/pydoc
/usr/bin/pygettext
/usr/bin/pdb



謝謝
shihyu
懵懂的國中生
懵懂的國中生
 
文章: 184
註冊時間: 週四 11月 03, 2005 11:51 am

文章shihyu » 週二 4月 03, 2007 5:36 pm

問題解決了

原來是在 /usr/lib & /usr/include
shihyu
懵懂的國中生
懵懂的國中生
 
文章: 184
註冊時間: 週四 11月 03, 2005 11:51 am


回到 embedded system

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客

cron