Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Cross-Platform Development => Topic started by: kirbysayshi on July 10, 2009, 01:53:48 pm

Title: Compiling on OS X: ./cutscene/oggplayer.h
Post by: kirbysayshi on July 10, 2009, 01:53:48 pm
Hello all, this is my first post.

I'm attempting to compile the trunk code on 10.5.7. I did ./autogen.sh, which was successful, followed by make.

Make gives some output, but eventually errors out:
Code: [Select]
./cutscene/oggplayer.h:8:27: error: theora/theora.h: No such file or directory
./cutscene/oggplayer.h:9:26: error: vorbis/codec.h: No such file or directory
./cutscene/oggplayer.h:20: error: ‘ogg_sync_state’ does not name a type
./cutscene/oggplayer.h:21: error: ‘ogg_page’ does not name a type
./cutscene/oggplayer.h:22: error: ‘ogg_packet’ does not name a type
./cutscene/oggplayer.h:23: error: ‘ogg_stream_state’ does not name a type
./cutscene/oggplayer.h:24: error: ‘ogg_stream_state’ does not name a type
./cutscene/oggplayer.h:26: error: ‘theora_info’ does not name a type
./cutscene/oggplayer.h:27: error: ‘theora_comment’ does not name a type
./cutscene/oggplayer.h:28: error: ‘theora_state’ does not name a type
./cutscene/oggplayer.h:30: error: ‘vorbis_info’ does not name a type
./cutscene/oggplayer.h:31: error: ‘vorbis_dsp_state’ does not name a type
./cutscene/oggplayer.h:32: error: ‘vorbis_block’ does not name a type
./cutscene/oggplayer.h:33: error: ‘vorbis_comment’ does not name a type
make[1]: *** [movie.o] Error 1
make: *** [all-recursive] Error 1

I've been trying to install different macports (libvorbis, libogg, etc) but non seem to come with the actual dev files. Where are people getting these header files (theora.h, codec.h)?

Thanks all! The project is so exciting!
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: Tinman on July 10, 2009, 02:14:38 pm
why don't you use Xcode to compile it?

theres a Xcode project (FS2_Open.xcodeproj) that works  :D 
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: chief1983 on July 10, 2009, 02:15:38 pm
Honestly, I don't know anything about compiling with plain GCC on OS X.  If you just use xcodebuild it works fine, that's how I've been making the nightly builds.  Plus, you get a universal binary.  The libs that are needed for OS X are in the Frameworks.tgz file in the projects/Xcode/ folder.  Extracting it to that directory lets you build with xcodebuild as that's where it expects the libs to be.

My script essentially does the following:

Code: [Select]
(initial setup)
cd ~/
svn co svn://svn.icculus.org/fs2open/trunk/fs2_open/ fs2_open

(script)
svn update fs2_open
svn export fs2_open fs2_open_temp
cd fs2_open_temp/projects/Xcode
tar -xzf Frameworks.tgz
xcodebuild -project FS2_Open.xcodeproj -configuration ##CONFIG## clean build
mv build/##CONFIG##/FS2_Open*.app ~/Desktop/

where ##CONFIG## is probably Release.  And there you go, a release build on the desktop.  Other possible configs are Debug, Release_Inferno, and Debug_Inferno.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: CaptJosh on July 10, 2009, 02:27:36 pm
You need the development packages libogg-devel and libvorbis-devel, libtheora-devel would probably be a good idea too, now that I think about it.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: chief1983 on July 10, 2009, 02:35:56 pm
The frameworks tar has Ogg, OpenAL, SDL, Theora, and Vorbis dev libs.  It's just set up for Xcode is all, but you can try and get those 5 libs separately and keep fighting with gcc if you want.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: kirbysayshi on July 10, 2009, 08:18:17 pm
WOW.

Thanks guys for all the quick suggestions! I didn't realize there was an XCode project (or that there was a projects folder... eesh), I untarred the frameworks folder, and I'm compiling it right now in XCode.

I just assumed people were using vim or something :)

The libogg-devel, libvobis-devel, etc weren't on macports, and I was weary about trying to grab them from a linux distro.

People seriously, again, thanks for the responses.

Do you have to compile all the entries in the Products list before FS2_Open will compile? I'm talking about libcode.a, cfilearchiver, cfileextractor, cryptstring, scramble, etc. As FS2_Open is compiling, it's throwing some errors :

/Users/drew/fs2_open/projects/Xcode/../../code/graphics/gropengl.cpp:1325: error: invalid conversion from 'long int*' to 'const GLint*'
/Users/drew/fs2_open/projects/Xcode/../../code/graphics/gropengl.cpp:1325: error:   initializing argument 3 of 'CGLError CGLSetParameter(_CGLContextObject*, CGLContextParameter, const GLint*)'

A few more that are very similar to that as well. I wonder if it's just the state of the trunk code? I've never used XCode before (aside from playing around with some Actionscript) OR programmed in C... so this is a little new to me.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: Echelon9 on July 10, 2009, 08:49:19 pm
As FS2_Open is compiling, it's throwing some errors :

/Users/drew/fs2_open/projects/Xcode/../../code/graphics/gropengl.cpp:1325: error: invalid conversion from 'long int*' to 'const GLint*'
/Users/drew/fs2_open/projects/Xcode/../../code/graphics/gropengl.cpp:1325: error:   initializing argument 3 of 'CGLError CGLSetParameter(_CGLContextObject*, CGLContextParameter, const GLint*)'

A few more that are very similar to that as well. I wonder if it's just the state of the trunk code? I've never used XCode before (aside from playing around with some Actionscript) OR programmed in C... so this is a little new to me.
I see you said you're using OS X 10.5.7, but what version of Xcode are you using?
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: chief1983 on July 10, 2009, 08:56:48 pm
I think only the 3.1 or newer stuff will run on Leopard.  Either way, I don't even compile from in the GUI, I just build the project as a whole, it handles all the dependencies.  It should be similar to the command line where you just tell it to build the whole project, after you select the configuration.  You don't want to build the pieces individually.

That said, I could use a host for the OS X nightly build script, if you happen to know anything about setting up Perl/CPAN, and have a Mac that's on most of the time, you could really help me out... :)
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: kirbysayshi on July 10, 2009, 09:53:58 pm
I see you said you're using OS X 10.5.7, but what version of Xcode are you using?

XCode 3.1.2...

chief1983, when I have some time, I'll give the command line compile you suggested earlier a try. While I do have a mac that's on all the time, I don't know any perl (I'm a php guy). But if all you need is a script to run and compile and send, I could help with that.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: chief1983 on July 10, 2009, 11:21:19 pm
I've already got the script, I just need someone who can get the necessary modules set up on their Mac.  It uses a few that normally have to be grabbed from CPAN as they're not usually already installed.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: kirbysayshi on July 11, 2009, 01:51:56 am
I'm trying out the xcodebuild command you gave, seems to be going well.

After reading the CPAN FAQ, it seems like it wouldn't be too hard to set things up. What modules are needed for your script?
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: Echelon9 on July 11, 2009, 02:00:05 am
XCode 3.1.2...
Hrmm, then you shouldn't have any problems compiling trunk. Let me know if there's any problems with the xcodebuild command.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: chief1983 on July 11, 2009, 02:07:28 am
use Config::Tiny;
use File::Copy;
use Net::FTP;
use Smf;
use Cwd;
use Data::Dumper;
use File::Path;
use WWW::Mechanize;

OS X already has a version of Perl/CPAN installed I think, at least if you installed Xcode, but it might be outdated.  Usually recommended to update CPAN at least, if not Perl itself.  Not asking anyone to b0rk a system or anything.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: Tinman on July 11, 2009, 05:08:05 am
just for info
I get a lot of warnings since a svn commit near the 5400 in XCode

(I think there are no warnings in VC2008 or VC6 of this kind)

Code: [Select]
Line Location hudparse.cpp:53: warning: invalid access to non-static data member 'hud_info::Player_shield_coords' of NULL object
Line Location hudparse.cpp:53: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:54: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:54: warning: invalid access to non-static data member 'hud_info::Target_shield_coords' of NULL object
Line Location hudparse.cpp:55: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:55: warning: invalid access to non-static data member 'hud_info::Shield_mini_fname' of NULL object
Line Location hudparse.cpp:55: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:55: warning: invalid access to non-static data member 'hud_info::Shield_mini_coords' of NULL object
Line Location hudparse.cpp:56: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:56: warning: invalid access to non-static data member 'hud_info::Aburn_fname' of NULL object
Line Location hudparse.cpp:56: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:56: warning: invalid access to non-static data member 'hud_info::Aburn_size' of NULL object
Line Location hudparse.cpp:56: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:56: warning: invalid access to non-static data member 'hud_info::Aburn_coords' of NULL object
Line Location hudparse.cpp:57: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:57: warning: invalid access to non-static data member 'hud_info::Wenergy_fname' of NULL object
Line Location hudparse.cpp:57: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:57: warning: invalid access to non-static data member 'hud_info::Wenergy_size' of NULL object
Line Location hudparse.cpp:57: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:57: warning: invalid access to non-static data member 'hud_info::Wenergy_coords' of NULL object
Line Location hudparse.cpp:58: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:58: warning: invalid access to non-static data member 'hud_info::Wenergy_text_coords' of NULL object
Line Location hudparse.cpp:59: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:59: warning: invalid access to non-static data member 'hud_info::Escort_htext' of NULL object
Line Location hudparse.cpp:59: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:59: warning: invalid access to non-static data member 'hud_info::Escort_filename' of NULL object
Line Location hudparse.cpp:59: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:59: warning: invalid access to non-static data member 'hud_info::Escort_coords' of NULL object
Line Location hudparse.cpp:62: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:62: warning: invalid access to non-static data member 'hud_info::Hud_mini_3digit' of NULL object
Line Location hudparse.cpp:63: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:63: warning: invalid access to non-static data member 'hud_info::Hud_mini_1digit' of NULL object
Line Location hudparse.cpp:65: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:65: warning: invalid access to non-static data member 'hud_info::Hud_mini_2digit' of NULL object
Line Location hudparse.cpp:66: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:66: warning: invalid access to non-static data member 'hud_info::Escort_htext_coords' of NULL object
Line Location hudparse.cpp:67: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:67: warning: invalid access to non-static data member 'hud_info::Escort_list' of NULL object
Line Location hudparse.cpp:68: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:68: warning: invalid access to non-static data member 'hud_info::Escort_filename' of NULL object
Line Location hudparse.cpp:68: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:68: warning: invalid access to non-static data member 'hud_info::Escort_entry' of NULL object
Line Location hudparse.cpp:69: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:69: warning: invalid access to non-static data member 'hud_info::Escort_filename' of NULL object
Line Location hudparse.cpp:69: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:69: warning: invalid access to non-static data member 'hud_info::Escort_entry_last' of NULL object
Line Location hudparse.cpp:70: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:70: warning: invalid access to non-static data member 'hud_info::Escort_name' of NULL object
Line Location hudparse.cpp:71: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:71: warning: invalid access to non-static data member 'hud_info::Escort_integrity' of NULL object
Line Location hudparse.cpp:72: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:72: warning: invalid access to non-static data member 'hud_info::Escort_status' of NULL object
Line Location hudparse.cpp:719: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:719: warning: invalid access to non-static data member 'hud_info::custom_gauge_coords' of NULL object
Line Location hudparse.cpp:720: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:720: warning: invalid access to non-static data member 'hud_info::custom_gauge_sizes' of NULL object
Line Location hudparse.cpp:721: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:721: warning: invalid access to non-static data member 'hud_info::custom_gauge_images' of NULL object
Line Location hudparse.cpp:722: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:722: warning: invalid access to non-static data member 'hud_info::custom_gauge_frames' of NULL object
Line Location hudparse.cpp:723: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:723: warning: invalid access to non-static data member 'hud_info::custom_gauge_text' of NULL object
Line Location hudparse.cpp:724: warning: (perhaps the 'offsetof' macro was used incorrectly)
Line Location hudparse.cpp:724: warning: invalid access to non-static data member 'hud_info::custom_gauge_colors' of NULL object
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: Echelon9 on July 11, 2009, 08:22:28 am
just for info
I get a lot of warnings since a svn commit near the 5400 in XCode
(I think there are no warnings in VC2008 or VC6 of this kind)
Code: [Select]
Line Location hudparse.cpp:53: warning: invalid access to non-static data member 'hud_info::Player_shield_coords' of NULL object
Line Location hudparse.cpp:53: warning: (perhaps the 'offsetof' macro was used incorrectly)
...
Yup, I've got those too lately. Not my highest priority at the moment, but we should be able to fix those Warnings soon.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: portej05 on July 11, 2009, 09:04:51 am
It is the offsetof macro being used incorrectly (why it's being used that way, beats me - there's better ways to do what is trying to be done) through HUD_VAR./me adds to the list of things to do.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: kirbysayshi on July 11, 2009, 04:44:34 pm
use Config::Tiny;
use File::Copy;
use Net::FTP;
use Smf;
use Cwd;
use Data::Dumper;
use File::Path;
use WWW::Mechanize;

I installed perl5.10 (5.18 was on the system by default) and updated CPAN. So far, the modules installed with the following exceptions:

File::Copy is complaining that I would need to force it to install, as the newest version is for perl5.8.9.
Smf cannot be found.
WWW::Mechanize mostly installed, at the end was unable because of an error in the HTTP::Response::Encoding dependency.

Any ideas?
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: chief1983 on July 11, 2009, 05:01:00 pm
Oh sorry Smf is my module, I just copied the use lists from both.  Unfortunately they're all pretty much required unless there's an alternative that does something similar, I'm not sure of one for Mechanize.  The entire posting system is dependent on it.  Although, I do have Perl 5.10 on my windows box and File::Copy works on it.  Probably cause it's the activestate one.  I seem to be running Perl 5.8.8 on mine.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: kirbysayshi on July 12, 2009, 11:20:27 pm
Alright, I installed those modules on my 5.8.8 install (the default one).

What next?
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: chief1983 on July 13, 2009, 12:18:21 am
Now you just need my compiling script.  Luckily it's at Nightly Build SVN (https://svn.icculus.org/fs2open/trunk/nightly-build/).  Assuming it works for you and gets to trying to upload it, I'll get you the username and pass info you need, unless you just want to get me a shell account and let me finish its setup.  Either way works for me.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: kirbysayshi on July 13, 2009, 12:00:40 pm
So, do I need to install that smf module, or can I just run nightlybuild.pl?
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: chief1983 on July 13, 2009, 12:17:48 pm
Just get all three files in that folder and put them alongside it, it will find the Smf module in that folder automatically.  I put it in my user folder and check out the code to ~/fs2_open, but you can set it up differently.  You will need to make some changes to the .conf file, mostly to set up the paths where it is looking for the code.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: kirbysayshi on July 13, 2009, 12:38:21 pm
Results of running nightlybuild.pl:
Code: [Select]
DeloreanFlux:fs2-nightly-build drew$ perl nightlybuild.pl
Useless use of join or string in void context at /opt/local/lib/perl5/site_perl/5.8.8/WWW/Mechanize.pm line 2360.
SVN still at revision 5435, terminating.
DeloreanFlux:fs2-nightly-build drew$

I assume that means it's working, but that because the svn hasn't changed, there's no need to make a new nightly?
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: chief1983 on July 13, 2009, 01:32:33 pm
Do 'svn update -r 5430 fs2_open' or whatever dir the source is in.  Then run the script, and it will build after updating.  That will just take it a couple of revisions back.
Title: Re: Compiling on OS X: ./cutscene/oggplayer.h
Post by: kirbysayshi on July 13, 2009, 04:07:46 pm
OK!
Code: [Select]
DeloreanFlux:fs2-nightly-build drew$ perl nightlybuild.pl
Useless use of join or string in void context at /opt/local/lib/perl5/site_perl/5.8.8/WWW/Mechanize.pm line 2360.
SVN has been updated to revision 5435, compiling...
Going to export /Users/drew/fs2_open to directory /Users/drew/fs2_open_0
Building Release...
Moving and renaming files...
Moving /Users/drew/fs2_open_0/projects/Xcode/build/Release/FS2_Open.app to /Users/drew/fs2-builds/FS2_Open-20090713_r5435.app
Building Debug...
Moving and renaming files...
Moving /Users/drew/fs2_open_0/projects/Xcode/build/Debug/FS2_Open (debug).app to /Users/drew/fs2-builds/FS2_Open (debug)-20090713_r5435.app
Compiling completed
Executing:  tar -cvzf fso-OSX-20090713_r5435.tgz "FS2_Open-20090713_r5435.app" "FS2_Open (debug)-20090713_r5435.app"
Executing:  md5 fso-OSX-20090713_r5435.tgz > fso-OSX-20090713_r5435.md5
Uploading /Users/drew/fs2-builds/fso-OSX-20090713_r5435.tgz and /Users/drew/fs2-builds/fso-OSX-20090713_r5435.md5 to swc.fs2downloads.com
Cannot login Login incorrect.

That's what I got... looks like things are working.