Page 2 of 2

Re: OSX, Cmake and Xcode

Posted: Wed Mar 02, 2011 5:51 am
by ace123
shenle wrote:I was able to get over the GTK2 problem by deleting findgtk2.cmake altogether from the source tree. Then cmake proceeded and I could generate a project. Compiling in xcode resulted in errors, so no binary.
I've seen most of your errors -- and there might be something wrong with your system libraries. Because after I cleaned up some stuff in my macports installation I no longer got most of these.
shenle wrote:1.common.h, line 168: 'UINT64_C' was not declared in this scope (this error repeats 3 times)

Code: Select all

    if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
I thought the FindFFMPEG.cmake script took care of this already. Basically, you need to define -D__STDC_CONSTANT_MACROS in the CPPFLAGS.

On Sunday, I committed a fix to this in automake. You can see my change here:
http://vegastrike.svn.sourceforge.net/v ... hrev=13102
shenle wrote:2. png.h, 795: forward declaration of 'struct png_struct_def'

Code: Select all

typedef struct png_struct_def png_struct;
Not sure about this. Are you using libpng12 or libpng3 or something else? I don't see this on my mac, but I'm using a 3-year-old version of libpng, so I might be avoiding this somehow.
shenle wrote:3. vid_file.cpp, 73: 'img_convert' was not declared in this scope

Code: Select all

#ifdef DEPRECATED_IMG_CONVERT
            img_convert(
                (AVPicture*) pFrameRGB, PIX_FMT_RGB24,
                (AVPicture*) pNextFrameYUV, pCodecCtx->pix_fmt,
                pCodecCtx->width, pCodecCtx->height );
Make sure you properly installed ffmpeg with the pkgconfig files that go with it. I had to manually copy over the .pc files from /usr/local/lib/pkgconfig into /opt/local/lib/pkgconfig because my version of pkg-config is from MacPorts (in /opt/local/bin/pkg-config).

Type "which pkg-config" to see where yours is installed. If your .pc files are in the wrong place, CMake won't find "libswscale.dylib" which means it assumes you are on a 4-year-old version of ffmpeg.

I'm considering removing that code since there's no excuse to use such an old version any more -- that way it will error out from the get-go if you have this problem.
shenle wrote:4. vsimage.cpp, 870: invalid use of undefined type 'struct png_struct_def'

Code: Select all

if ( setjmp( png_ptr->jmpbuf ) ) {
        png_destroy_write_struct( &png_ptr, &info_ptr );
        return BadFormat;
    }
Also not getting this. Are you sure it's finding the right version of libpng? (Probably the same issue as #2)

My cmake compile on mac was mostly straightforward but I'm stuck on linker errors where it doesn't link to libjpeg for some unexplained reason.
I'm getting all these linker errors in cmake:
_jpeg_destroy_compress
_jpeg_finish_compress
_jpeg_std_error
...

Re: OSX, Cmake and Xcode

Posted: Wed Mar 02, 2011 3:13 pm
by strook
well i have no problems with jipjpeg

my settings are:

Code: Select all

JPEG_KINCLUDE_DIR = /usr/local/include
JPEG_LIBRARY = /usr/local/lib/libjpeg.dylib

Re: OSX, Cmake and Xcode

Posted: Tue Mar 08, 2011 1:06 pm
by strook
hey guys can you help me out?

i came to theese three errors i have no solution for:

Code: Select all

/Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks/OGRE.framework/Headers/OgreString.h:44:0 /Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks/OGRE.framework/Headers/OgreString.h:44: error: redefinition of 'struct __gnu_cxx::hash<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >'

Code: Select all

/Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks/OGRE.framework/Headers/OgreWindowEventUtilities.h:158:0 /Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks/OGRE.framework/Headers/OgreWindowEventUtilities.h:158: error: 'EventHandlerCallRef' has not been declared

Code: Select all

/Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks/OGRE.framework/Headers/OgreWindowEventUtilities.h:158:0 /Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks/OGRE.framework/Headers/OgreWindowEventUtilities.h:158: error: 'EventRef' has not been declared

any clue?

Re: OSX, Cmake and Xcode

Posted: Tue Mar 08, 2011 1:17 pm
by strook
hey ace, maybe you included the wrong headrs for the library.

i mean - beacuse on mac it is normal that multiple versions of a library exist on multiple positions (/usr /opt /sw and the *.rramework/Headers dirs) cmake makes errors in selecting headers for the libs.
maybe your lib was in /opt/local/lib and your selected header was in /usr/include, but the headers needed for this must be selected in /opt/local/include

if then the release versions of the libraries in theese two branches differ, there is a problem.

i had this prob with the boost lib i think

Re: OSX, Cmake and Xcode

Posted: Tue Mar 08, 2011 5:07 pm
by klauss
It all seems ogre-centric.

Ogre is only used to support conversion to ogremesh format in mesher, which is entirely an optional thing - why don't you try building without Ogre?

Re: OSX, Cmake and Xcode

Posted: Tue Mar 08, 2011 5:16 pm
by strook
because i need ogre for the seamless flight and we discussed to get a version to be built with ogre :roll:

Re: OSX, Cmake and Xcode

Posted: Tue Mar 08, 2011 5:39 pm
by klauss
Ya, but at least you'd get the issue constrained to Ogre like that.

BTW: src/gnuhash may also be at fault here

Re: OSX, Cmake and Xcode

Posted: Tue Mar 08, 2011 10:07 pm
by strook
thx, fixed one error.

the other two come from because i didn't include the carbon sdk and the approitate header.

i included the sdk and included the header carbon/carbon.h

but had no success....

Re: OSX, Cmake and Xcode

Posted: Thu Mar 10, 2011 10:24 am
by strook
fixed nearly all errors. hope that linking isn't too complicated...

Re: OSX, Cmake and Xcode

Posted: Sat Mar 19, 2011 11:16 am
by strook
i got it compiled for macos x, however, it crashes with cegui.

if you have any questions, ask me.

Re: OSX, Cmake and Xcode

Posted: Sun Mar 20, 2011 10:00 pm
by strook
i don't know how to load in "*.bundle" libraries. does anyone know how to set up them so that my project loads them in correctly?

Re: OSX, Cmake and Xcode

Posted: Wed Apr 06, 2011 12:08 am
by shenle
I'm revisiting this since I now have a new OSX 10.6.7 installation, complete with xcode 3.2.5 and (I think) all the necessary support libraries I need to compile VS - installed via Fink. Including ffmpeg, which is an older version (0.4.2 I think)

Using cmake, with the findffmpeg.cmake fix from earlier in this thread. Still had to point it manually to some libraries and includes (avcodec, avutil, avformat, swscale and gtkgl). Finally got it configured and makefile generated.

On compile I get this:

Code: Select all

Scanning dependencies of target OPcollide
[  0%] Building CXX object CMakeFiles/OPcollide.dir/src/cmd/collide2/Ice/IceAABB.o
In file included from /Users/s/Desktop/vegastrike/vegastrike/src/cmd/collide2/Stdafx.h:20,
                 from /Users/s/Desktop/vegastrike/vegastrike/src/cmd/collide2/Ice/Stdafx.h:1,
                 from /Users/s/Desktop/vegastrike/vegastrike/src/cmd/collide2/Ice/IceAABB.cpp:21:
/Users/s/Desktop/vegastrike/vegastrike/src/cmd/collide2/opcodetypes.h:177: error: conflicting declaration ‘typedef int64 intmax_t’
/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stdint.h:97: error: ‘intmax_t’ has a previous declaration as ‘typedef long int intmax_t’
/Users/s/Desktop/vegastrike/vegastrike/src/cmd/collide2/opcodetypes.h:179: error: conflicting declaration ‘typedef uint64 uintmax_t’
/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stdint.h:106: error: ‘uintmax_t’ has a previous declaration as ‘typedef long unsigned int uintmax_t’
In file included from /Users/s/Desktop/vegastrike/vegastrike/src/gfx/vec.h:18,
                 from /Users/s/Desktop/vegastrike/vegastrike/src/gfx/quaternion.h:4,
                 from /Users/s/Desktop/vegastrike/vegastrike/src/cmd/collide2/opcodesysdef.h:28,
                 from /Users/s/Desktop/vegastrike/vegastrike/src/cmd/collide2/Stdafx.h:21,
                 from /Users/s/Desktop/vegastrike/vegastrike/src/cmd/collide2/Ice/Stdafx.h:1,
                 from /Users/s/Desktop/vegastrike/vegastrike/src/cmd/collide2/Ice/IceAABB.cpp:21:
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h: In function ‘float VSSwapHostFloatToLittle(float)’:
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h:74: warning: ‘NXSwapHostLongToLittle’ is deprecated (declared at /usr/include/architecture/byte_order.h:349)
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h:74: warning: ‘NXSwapHostLongToLittle’ is deprecated (declared at /usr/include/architecture/byte_order.h:349)
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h: In function ‘unsigned int VSSwapHostIntToLittle(unsigned int)’:
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h:85: warning: ‘NXSwapHostLongToLittle’ is deprecated (declared at /usr/include/architecture/byte_order.h:349)
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h:85: warning: ‘NXSwapHostLongToLittle’ is deprecated (declared at /usr/include/architecture/byte_order.h:349)
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h: In function ‘short unsigned int VSSwapHostShortToLittle(short unsigned int)’:
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h:90: warning: ‘NXSwapHostShortToLittle’ is deprecated (declared at /usr/include/architecture/byte_order.h:331)
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h:90: warning: ‘NXSwapHostShortToLittle’ is deprecated (declared at /usr/include/architecture/byte_order.h:331)
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h: In function ‘double DONTUSE__NXSwapBigDoubleToLittleEndian(double)’:
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h:102: warning: ‘NXSwapHostLongToLittle’ is deprecated (declared at /usr/include/architecture/byte_order.h:349)
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h:102: warning: ‘NXSwapHostLongToLittle’ is deprecated (declared at /usr/include/architecture/byte_order.h:349)
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h:103: warning: ‘NXSwapHostLongToLittle’ is deprecated (declared at /usr/include/architecture/byte_order.h:349)
/Users/s/Desktop/vegastrike/vegastrike/src/endianness.h:103: warning: ‘NXSwapHostLongToLittle’ is deprecated (declared at /usr/include/architecture/byte_order.h:349)
make[2]: *** [CMakeFiles/OPcollide.dir/src/cmd/collide2/Ice/IceAABB.o] Error 1
make[1]: *** [CMakeFiles/OPcollide.dir/all] Error 2
make: *** [all] Error 2

Re: OSX, Cmake and Xcode

Posted: Sun Apr 10, 2011 3:49 pm
by strook
Oh sorry for being away so long...
Ya, the ffmpeg lib is this.
The problem is, you'll have to compile vs as a 64 bit binary.
Ffmpeg does not compile 32bit.

Another option could be disabling ffmpeg.

The NX... Warnings are cause the code is deprecated.
If you would accept my code there would be already a fix.
You can download "enddianess_replaced.cpp" from my site to avoid this warning.
You will find much more modified vs source files in order to get them running with
Macosx on my site.

Re: OSX, Cmake and Xcode

Posted: Sun Apr 10, 2011 5:58 pm
by strook
btw, if we are on compiling it for macosx, when you'll get past this, you'll get problems using boost python. maybe you'll have a hint for me ;)