PDA

View Full Version : Cannot compile XBMC for Mac OS X because of python


FearlessSpiff
2008-02-23, 14:36
I get:
/linuxport/XBMC/xbmc/lib/libPython/XBPyThread.h:7:30: error: python2.4/Python.h: No such file or directory

but i made a "sudo port install python24" which does not help! What am I missing?

Gamester17
2008-02-23, 14:59
Sounds like the same problems as 64-bit compile for Linux (which do not either support python yet)
http://xbmc.org/forum/showthread.php?t=27155

Try disable python in the code before compiling. guilib/system.h there's a definition of HAS_PYTHON (search for the right one), then make clean and try.
http://xbmc.org/forum/showthread.php?t=31400

FearlessSpiff
2008-02-23, 16:01
Yeah, right! Thanks. But I couldn't get it to run for now. Will have to wait then to test with the OSX port... :-)

FearlessSpiff
2008-02-23, 17:15
ok, have it running now. had to "undef HAS_PYTHON" and change all

#ifndef _LINUX
#include "python/Python.h"
#else
#include <python2.4/Python.h>


to


#ifndef _LINUX
#include "python/Python.h"
#else
#include <python/Python.h>


Notice, that this is a quick hack to make it compile. I don't know why __MAC__ isn't used in the preprocessor directives in the xcode project, but for the moment I don't care, because i'm happy, that it compiles...

FearlessSpiff
2008-03-10, 16:18
I thought this is fixed, but not for me, so i think i have a problem with my environment:

I made "sudo port install python24" but i still get this compile error:

error: python2.4/Python.h: No such file or directory

And if I look under /opt/local/include I don't have the python2.4 directory with its definitions.
How can I solve this? Thanks

spiderlane
2008-03-10, 19:14
@FearlessSpiff

I resolved this problem but I'm not at my mac right now to give you exact details.

I think I remember that the headers for python2.4 were not in /opt/local/include rather in /opt/local/frameworks/Python.framework/include or something. I think I had to add a reference to this into "Header Search Paths".

I'll double check when I get home with the exact setting that I had to use.

Good luck,
Spiderlane

Gamester17
2008-03-10, 19:40
http://xbmc.org/wiki/?title=HOW-TO_submit_a_patch

nudge nudge, wink wink :rolleyes:

FearlessSpiff
2008-03-10, 20:46
I already tried this, but it didn't work. I added /opt/local/var/macports/software/python24/2.4.4_4+darwin_9/opt/local/Library/Frameworks/Python.framework/Versions/2.4/include

to the Header-Path in the Debug configuration but it won't compile... :-( What's your path then?

FearlessSpiff
2008-03-10, 21:15
ok, now i made a symlink and it works:

ln -s /opt/local/var/macports/software/python24/2.4.4_4+darwin_9/opt/local/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ /opt/local/include/python2.4

No idea, why it didn't work with the project setting...

spiderlane
2008-03-10, 23:46
http://xbmc.org/wiki/?title=HOW-TO_submit_a_patch

nudge nudge, wink wink :rolleyes:

What a good idea ;-)

Here (http://sourceforge.net/tracker/index.php?func=detail&aid=1911421&group_id=87054&atid=581840) is a patch which resolves this and other compile and link errors against r11970.

I hope it's helpful to someone. It's my first patch for this project, so let me know if I did anything wrong format-wise, or placed it in the wrong place.

@FearlessSpiff on my machine the path to the Python headers is /opt/local/Library/Frameworks/Python.Framework/Versions/2.4/include

Cheers
Spiderlane

FearlessSpiff
2008-03-11, 10:14
Great! I will try the patch as soon as I get home this evening. :-)

FearlessSpiff
2008-03-11, 20:32
First time i could compile alltogether, but i get a linking error:
"library not found for -lcdio"
I tried to "sudo port install cdio" without success...

Gamester17
2008-03-11, 21:51
I think you mean libcdio (not lcdio nor cdio), so try "sudo port install libcdio"

FearlessSpiff
2008-03-11, 22:27
yeah, you're right. But i already installed it. Have to look at the search path then...

FearlessSpiff
2008-03-11, 22:45
So, when adding /opt/local/lib and /Users/test/Development/Eclipse/workspace/XBMC/xbmc/lib/ recurivly i get a build, which when executed is a black window that cannot be closed without "Force Quit"... :-(

spiderlane
2008-03-12, 01:37
Make sure you've set your XBMC_HOME environment variable to point to somewhere sensible.

e.g. I do export XBMC_HOME=/Users/marklane/osx/xbmc/XBMC

Also check the xmbc.log to see what's happening on load.

spiderlane
2008-03-12, 01:46
Oh, and if your build didn't run cleanly from start to finish, try a clean and a re-build to be sure everything is built correctly

NEI
2008-03-12, 10:42
Will try that tonight. But the question is: Where is XBMC_HOME?
Is it where the Unix-Executable is built to? Somewhere under build/debug/?
Is it where I did the checkout (seems like this, as your path shows XBMC at the end)?
Or is it in the Application Support Folder?

spiderlane
2008-03-12, 10:52
Where is XBMC_HOME?

XBMC_HOME points to the "root" folder of XBMC where it can find, skins, scripts, configs etc etc. XBMC will put any user settings inside ~/Library/Application Support/XBMC (this is not where you want XBMC_HOME to point)

If you point it to the main XBMC directory inside the folder that you checked out of SVN then that should work.

E.g for me, I have the project checked out of SVN into

/Users/marklane/osx/xbmc

inside here it looks like this

XBMC docs mplayer sources

so I point my XBMC_HOME to the XBMC folder in there.

i.e. export XBMC_HOME=/Users/marklane/osx/xbmc/XBMC

confusion might arise because I've named my project folder "xbmc" too. Hell this confuses me a lot of the time (note to self, rename to xbmc-dev :) )

Hope this helps
Spiderlane

NEI
2008-03-12, 12:25
Thanks for the explanation! Will try this later! :-)

spiderlane
2008-03-12, 13:26
Thanks for the explanation!

My pleasure. Don't forget to come back here and let us know how you got on in case it helps others in the same predicament.

Good luck :)

NEI
2008-03-12, 19:12
Great! Now it works. Did a clean, build and exported the dir you mentioned! But only when started through the terminal. When i add the XBMC_HOME to the executable in XCODE, I still get this black screen! But there is no error message about XBMC_HOME anymore... So I am not able to debug it, which isn't so bad for the moment.

gmackenz
2008-03-14, 02:02
I just checked out the latest and greatest from SVN an hour ago and I get a compilation error...Bad checkin?

/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp: In member function ‘void CCharsetConverter::utf8ToW(const CStdStringA&, CStdStringW&, bool)’:
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:223: error: invalid conversion from ‘const char**’ to ‘char**’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:223: error: initializing argument 2 of ‘size_t libiconv(void*, char**, size_t*, char**, size_t*)’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp: In member function ‘void CCharsetConverter::subtitleCharsetToW(const CStdStringA&, CStdStringW&)’:
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:266: error: invalid conversion from ‘const char**’ to ‘char**’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:266: error: initializing argument 2 of ‘size_t libiconv(void*, char**, size_t*, char**, size_t*)’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp: In member function ‘void CCharsetConverter::utf8ToStringCharset(const CStdStringA&, CStdStringA&)’:
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:356: error: invalid conversion from ‘const char**’ to ‘char**’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:356: error: initializing argument 2 of ‘size_t libiconv(void*, char**, size_t*, char**, size_t*)’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp: In member function ‘void CCharsetConverter::stringCharsetToUtf8(const CStdStringA&, CStdStringA&)’:
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:394: error: invalid conversion from ‘const char**’ to ‘char**’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:394: error: initializing argument 2 of ‘size_t libiconv(void*, char**, size_t*, char**, size_t*)’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp: In member function ‘void CCharsetConverter::stringCharsetToUtf8(const CStdStringA&, const CStdStringA&, CStdStringA&)’:
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:429: error: invalid conversion from ‘const char**’ to ‘char**’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:429: error: initializing argument 2 of ‘size_t libiconv(void*, char**, size_t*, char**, size_t*)’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp: In member function ‘void CCharsetConverter::wToUTF8(const CStdStringW&, CStdStringA&)’:
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:465: error: invalid conversion from ‘const char**’ to ‘char**’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:465: error: initializing argument 2 of ‘size_t libiconv(void*, char**, size_t*, char**, size_t*)’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp: In member function ‘void CCharsetConverter::utf16BEtoUTF8(const CStdStringW&, CStdStringA&)’:
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:495: error: invalid conversion from ‘const char**’ to ‘char**’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:495: error: initializing argument 2 of ‘size_t libiconv(void*, char**, size_t*, char**, size_t*)’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp: In member function ‘void CCharsetConverter::utf16LEtoW(const char*, CStdStringW&)’:
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:531: error: invalid conversion from ‘const char**’ to ‘char**’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:531: error: initializing argument 2 of ‘size_t libiconv(void*, char**, size_t*, char**, size_t*)’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp: In member function ‘void CCharsetConverter::ucs2CharsetToStringCharset(cons t CStdStringW&, CStdStringA&, bool)’:
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:580: error: invalid conversion from ‘const char**’ to ‘char**’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:580: error: initializing argument 2 of ‘size_t libiconv(void*, char**, size_t*, char**, size_t*)’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp: In member function ‘void CCharsetConverter::utf32ToStringCharset(const long unsigned int*, CStdStringA&)’:
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:617: error: invalid conversion from ‘const char**’ to ‘char**’
/Users/gordon/Public/linuxport/XBMC/xbmc/utils/CharsetConverter.cpp:617: error: initializing argument 2 of ‘size_t libiconv(void*, char**, size_t*, char**, size_t*)’

CompileC build/XBMC.build/Debug/XBMC.build/Objects-normal/i386/CPUInfo.o /Users/gordon/Public/linuxport/XBMC/xbmc/utils/CPUInfo.cpp normal i386 c++ com.apple.compilers.gcc.4_0
cd /Users/gordon/Public/linuxport/XBMC
/Developer/usr/bin/gcc-4.0 -x c++ -arch i386 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_DEBUG -D_LINUX -D_REENTRANT -D_FILE_DEFINED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAS_SDL_JOYSTICK -fmessage-length=0 -fvisibility-inlines-hidden -mfix-and-continue -mmacosx-version-min=10.5 -gdwarf-2 -I/Users/gordon/Public/linuxport/XBMC/build/XBMC.build/Debug/XBMC.build/XBMC.hmap -F/Users/gordon/Public/linuxport/XBMC/build/Debug -I/Users/gordon/Public/linuxport/XBMC/build/Debug/include -Ixbmc/lib -I/Library/Frameworks/Python.framework/Versions/2.4/Headers -Ixbmc/lib/libportaudio -Ixbmc/cores -Ixbmc/cores/ffmpeg -Ixbmc/cores/dvdplayer -Ixbmc -Ixbmc/linux -Iguilib -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/mysql5-devel -I/usr/X11R6/include -I/Users/gordon/Public/linuxport/XBMC/build/XBMC.build/Debug/XBMC.build/DerivedSources -isysroot /Developer/SDKs/MacOSX10.5.sdk -c /Users/gordon/Public/linuxport/XBMC/xbmc/utils/CPUInfo.cpp -o /Users/gordon/Public/linuxport/XBMC/build/XBMC.build/Debug/XBMC.build/Objects-normal/i386/CPUInfo.o
** BUILD FAILED **

gmackenz
2008-03-14, 02:14
I guess this related to this issue:

http://xbmc.org/forum/showthread.php?t=31891

I tried the change in that thread and it failed to compile immediately.

gmackenz
2008-03-21, 10:25
So if there was a patch submitted, it either wasn't checked in or it failed to fix the problem error: python24/Python.h: no such file or directory.

So I tried the second symbolic link mentioned:

ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/ /opt/local/include/python2.4

Which seemed to finally get past the python hurdle.

Now I have to undefine the stupid cmyth stuff now:

In file included from /Users/gordo/Public/linuxport/XBMC/xbmc/lib/libcmyth/bookmark.c:26:
/Users/gordo/Public/linuxport/XBMC/xbmc/lib/libcmyth/cmyth_local.h:36:25: error: mysql/mysql.h: No such file or directory
In file included from /Users/gordo/Public/linuxport/XBMC/xbmc/lib/libcmyth/bookmark.c:26:
/Users/gordo/Public/linuxport/XBMC/xbmc/lib/libcmyth/cmyth_local.h:119: error: syntax error before 'MYSQL'
/Users/gordo/Public/linuxport/XBMC/xbmc/lib/libcmyth/cmyth_local.h:119: warning: no semicolon at end of struct or union
/Users/gordo/Public/linuxport/XBMC/xbmc/lib/libcmyth/cmyth_local.h:403: error: syntax error before '*' token
/Users/gordo/Public/linuxport/XBMC/xbmc/lib/libcmyth/cmyth_local.h:403: warning: data definition has no type or storage class
/Users/gordo/Public/linuxport/XBMC/xbmc/lib/libcmyth/cmyth_local.h:430: error: syntax error before '*' token
/Users/gordo/Public/linuxport/XBMC/xbmc/lib/libcmyth/cmyth_local.h:430: warning: data definition has no type or storage class
** BUILD FAILED **

d4rk
2008-03-22, 01:29
Just install mysql from macports and you'll be good to go.

gmackenz
2008-03-22, 06:25
Just install mysql from macports and you'll be good to go.

I have mysql installed per the instruction (via macport)...I did try compiling with mysql5 instead of the README.osx's mysql5-devel, still same cmyth error:

The following ports are currently installed:
expat @2.0.1_0 (active)
freetype @2.3.5_1 (active)
fribidi @0.10.9_0 (active)
gettext @0.17_3 (active)
glew @1.5.0_0+darwin_9 (active)
jpeg @6b_2 (active)
libcddb @1.3.0_0 (active)
libcdio @0.75_0 (active)
libiconv @1.12_0 (active)
libogg @1.1.3_2 (active)
libpng @1.2.25_0 (active)
libsdl @1.2.13_1 (active)
libsdl-framework @1.2.13_0 (active)
libsdl_gfx @2.0.16_0 (active)
libsdl_image @1.2.6_2 (active)
libsdl_mixer @1.2.8_0 (active)
libvorbis @1.2.0_0 (active)
lzo @1.08_0 (active)
mysql5-devel @5.1.23-rc_2 (active)
ncurses @5.6_0 (active)
ncursesw @5.6_1 (active)
openssl @0.9.8g_0 (active)
pcre @7.6_0 (active)
pkgconfig @0.23_0 (active)
python24 @2.4.5_0+darwin_9 (active)
smpeg @0.4.4_6 (active)
tiff @3.8.2_1+macosx (active)
zlib @1.2.3_1 (active)
Media-Center-Mini:Public gordo$

_tv_
2008-03-22, 08:59
Because mysql5-devel will install mysql.h in /opt/local/include/mysql5/mysql/mysql.h, addsymlinks or path to project, which ever you feel better.

gmackenz
2008-03-23, 08:51
This just never ends...I'm glad that this has been educational, because after two weeks of trying this on my off-work, after-household chores/activities, just before sleep...I still cannot get this darn project to compile using xcodebuild.

To summarize what i've found incorrect with the README.osx/instructions on the WIKI:

Starting with a virgin Mac Mini 2.0GHz C2D running an up-to-date Leopard OS X,

I installed XCODE 3.0 from the Leopard disk

I installed the current rev of MacPorts.

I have installed all the listed libs & such from the README/WIKI

I then did a svn checkout of the latest linuxport.

I have NOT been able to build the XBMC because:

Python24 & MySQL both get their include files buried deep within /opt/local/include/... and have to have symbolic links created to /opt/local/include

I had to install a never-mentioned-before lib of libmad from MacPorts.

And now I am stuck at xcodebuild complaining it needs libsmbclient!!!

(I was glad I was in a relaxed saturday morning mood at the latest compile failure, I could have really hurt myself screaming and punching my LCD screen and desk at this point).

I really would love to help with the OSXMBC port, but it seems I'm never going to ever get this project built at this rate.

---

Please help me clear this latest hurdle? MacPOrts doesn't have s smbclient package, I know Mac OS X has SMB, there is a libsmbclient.dylib:

/Developer/SDKs/MacOSX10.5.sdk/usr/lib/samba
Media-Center-Mini:samba gordo$ ls
auth/ libmsrpc.dylib* nss_info/
charset/ libsmbclient.dylib* pdb/
idmap/ libsmbsharemodes.dylib* vfs/

I tried a symbolic link from the /Developer/SDKs/MacOSX10.5.sdk/usr/lib/samba to /opt/local/include

And a SVN update.

It seems that somebody may have broken SVN with a checkin related to KaiVector? This is probably happening before getting to the smbclient stuff so that may not have been solved by my THIRD symbolic link.

ERROR:

CompileC build/XBMC.build/Debug/XBMC.build/Objects-normal/i386/KaiVector.o /Users/gordo/Public/linuxport/XBMC/xbmc/KaiVector.cpp normal i386 c++ com.apple.compilers.gcc.4_0
cd /Users/gordo/Public/linuxport/XBMC
/Developer/usr/bin/gcc-4.0 -x c++ -arch i386 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_DEBUG -D_LINUX -D_REENTRANT -D_FILE_DEFINED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAS_SDL_JOYSTICK -fmessage-length=0 -fvisibility-inlines-hidden -mfix-and-continue -mmacosx-version-min=10.5 -gdwarf-2 -I/Users/gordo/Public/linuxport/XBMC/build/XBMC.build/Debug/XBMC.build/XBMC.hmap -F/Users/gordo/Public/linuxport/XBMC/build/Debug -I/Users/gordo/Public/linuxport/XBMC/build/Debug/include -Ixbmc/utils -Ixbmc/lib -I/Library/Frameworks/Python.framework/Versions/2.4/Headers -Ixbmc/lib/libportaudio -Ixbmc/cores -Ixbmc/cores/ffmpeg -Ixbmc/cores/dvdplayer -Ixbmc -Ixbmc/linux -Iguilib -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/mysql5-devel -I/usr/X11R6/include -I/Users/gordo/Public/linuxport/XBMC/build/XBMC.build/Debug/XBMC.build/DerivedSources -isysroot /Developer/SDKs/MacOSX10.5.sdk -c /Users/gordo/Public/linuxport/XBMC/xbmc/KaiVector.cpp -o /Users/gordo/Public/linuxport/XBMC/build/XBMC.build/Debug/XBMC.build/Objects-normal/i386/KaiVector.o
** BUILD FAILED **
Media-Center-Mini:XBMC gordo$