OSX, Cmake and Xcode

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Re: OSX, Cmake and Xcode

Post 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
...
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: OSX, Cmake and Xcode

Post 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
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: OSX, Cmake and Xcode

Post 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?
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: OSX, Cmake and Xcode

Post 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
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: OSX, Cmake and Xcode

Post 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?
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: OSX, Cmake and Xcode

Post by strook »

because i need ogre for the seamless flight and we discussed to get a version to be built with ogre :roll:
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: OSX, Cmake and Xcode

Post 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
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: OSX, Cmake and Xcode

Post 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....
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: OSX, Cmake and Xcode

Post by strook »

fixed nearly all errors. hope that linking isn't too complicated...
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: OSX, Cmake and Xcode

Post by strook »

i got it compiled for macos x, however, it crashes with cegui.

if you have any questions, ask me.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: OSX, Cmake and Xcode

Post 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?
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: OSX, Cmake and Xcode

Post 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
make me a sandwich
make: *** No rule to make target 'me'. Stop.
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: OSX, Cmake and Xcode

Post 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.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: OSX, Cmake and Xcode

Post 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 ;)
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
Post Reply