Game Development Community

Ranlib OK, compiles OK, failed to open main.cs error

by David Janik-Jones · in Torque Game Engine · 04/02/2004 (10:15 am) · 21 replies

OK, so I updated the ogg and vorbis libraries via ranlib. No problem. Compiles under XCode and OSX 10.3.3 OK, but with Seth Willits many duplicate errors. But still, it said it compiled successfully.

But on double clicking the compiled .app I get ...

Failed to open main.cs and it then shuts down.

Any thoughts?
Page «Previous 1 2
#1
04/02/2004 (10:47 am)
You must have a main.cs file in the main working directory.

If you are runing it from your IDE you need to set the working directory to be where the executable is. Same with a shortcut.
#2
04/02/2004 (11:06 am)
This is the complete console error log on startup, with system info removed ...

//-------------------------- 4/2/2004 -- 14:32:30 -----
System & Processor Information:
[snipped]

Math Init:
Installing Standard C extensions
Installing FPU extensions

Input Init:
Basic mouse capture failed to enable!

Video Init:
Accelerated OpenGL display device detected.

setModPaths: invalid mod path directory name: 'starter.fps'
setModPaths: invalid mod path directory name: 'common'
--------- Loading MODS ---------
Missing file: common/main.cs!
Missing file: starter.fps/main.cs!

--------- Parsing Arguments ---------
Engine initialized...

When I open the compiled package I don't see any of the directory structure I'm expecting to see; e.g., a /common or /starter.fps directory.

Thanks, John, will try your solution.
#3
04/02/2004 (11:15 am)
I seem to remember that by default the mac build does not package the game directories in the packaged app.
ie you have to move the .app exe to your example directory, or whatever you've named your top directory with the common, etc. folders.
If you want to debug, you have to point PB or XCode at the executable once you moved it to the right spot.
#4
04/02/2004 (11:18 am)
David,

Also notice that the messages,

"Basic mouse capture failed to enable" indicates that you may not have any access to menu items if you do get the system started because the mouse is not working properly.

setModPaths: invalid mod path directory name: 'starter.fps'
In your example/main.cs you have inidcated that your game is going to start in the directory, "starter.fps" my guess is you have deleted that subdirectory and created a new one and put your game in it.

setModPaths: invalid mod path directory name: 'common'
Again the system is looking in your example directory for a subdirectory called "common" and not finding it.
#5
04/02/2004 (11:23 am)
Overall it sounds like it is what I said; The working directory is not correct.
#6
04/06/2004 (5:52 pm)
OK, so I followed the directions for compiling under Xcode and OSX to the letter. Compiled it to the "example" directory so that the .app file and the pb_build folder both end up in that directory. All of the directories seem to be correct in the example directory. When it compiles, I get a successful run with 38 duplicate file (variable?) names but otherwise OK.

But when I try to run the .app (executable) program file I get a spinning beach ball and it never starts. I see the name of the application in the menu bar, but the beach ball just spins and spins, never starting the program.

An investigation into the console log shows it compiling/running everything perfectly, except for the following errors ...

--------- Loading MODS ---------
Missing file: common/defaults.cs!

--------- Initializing MOD: FPS Starter Kit ---------
Missing file: starter.fps/data/terrains/scorched/propertyMap.cs!

--------- Initializing MOD: FPS Starter Kit: Client ---------
Missing file: starter.fps/client/ui/QuitGui.gui!
Unable to locate audio profile 'AudioStartup'

I've looked through the /example directory and these files DO NOT EXIST. Is this the result of another CVS pulldown error? Does anyone have these files in their CVS pull? Is it an error not showing up in the actual compiling stage?

This is extremely frustrating not being able to compile this thing. Any Mac programmers out who know Xcode well want to give me some help?

Thanks.
#7
04/07/2004 (4:03 am)
Those warnings in the console log are just a few files that need cleaned up, they should not cause enough trouble that the application will hang. Unfortunatly that is about all I can tell you as I don't own a mac. But I can tell you that I've seen the same missing files in my log many times.
#8
06/24/2004 (11:57 am)
It would be great if the Mac build files could be reshaped to "just work".
I downloaded the Lords demo.app and it did not "just work" (it also installed into my root dir... not very nice but no biggy).

I tossed it, and that's a sad kick in the pants for something I'm guessing had an awful lot of work put into it.

tone
#9
06/24/2004 (12:16 pm)
I'm also having problems with "Failed to open main.cs" when trying to start Torque. I also compiled it successfully using Xcode into the example directory (in Xcode preferences, under the "Build" tab, under "Build Results" checked "Separate location for building products:" ../example)

Likewise, in Xcode under "Groups & Files" on the main Xcode window, I can see that "Torque-MacCarb-Release" or "Torque-MacCarb-Debug" executables are using the example directory as the working directory.

There is a main.cs file siting at the top level of the example directory, along with the Torque Demo OSX.app.

[yggdrasil:torquecvsroot/torque/example]% ls
./
../
.DS_Store*
CVS/
ReadMe.html
Torque Demo Debug OSX.app/
Torque Demo OSX.app/
common/
fps/
main.cs
racing/
rw/
show/
torque_pb_2_1.build/


So, what is causing the error "Failed to open main.cs" ? Where *PRECISELY* is this file supposed to be when running the Torque engine on a Mac (OS10.3.2).

Thanks in advance.
#10
06/24/2004 (12:25 pm)
Exactly what happens to me when running at Win98:

setModPaths: invalid mod path directory name: 'starter.fps'
setModPaths: invalid mod path directory name: 'common'
--------- Loading MODS ---------
Missing file: common/main.cs!
Missing file: starter.fps/main.cs!

--------- Parsing Arguments ---------
Engine initialized...

but in WinXP it works fine!.
#11
06/24/2004 (12:26 pm)
Anthony and Elisabeth,

Sorry to burst your bubble/enthusiasm, but I've been unable to resolve any of my Mac-centric problems with Torque and have basically given up on it as a tool (and have basically squandered my $100 in the process -- ah, live and learn). I've not yet ever been able to compile the demo as advertised, despite the great help from Mark Frohnmayer. (Really, Mark, thanks for trying so hard!)

Unfortunately, there seem to be very few, if any, Mac developers here (if I get one more email asking where my ".exe" files are I'm going to scream ;-)) It's a *Mac* forum people, but thanks anyways.

Sorry to sound bitter but US$100 is really CDN$140 to me. Maybe the upcoming Unity engine from http://www.otee.dk will work out better. At least it's made on a Mac, specifically for a Mac, to compile Mac and PC programs.

No way to get my money back either. Fortunately, I didn't tell my wife I was spending the $$ so there's no rolled eyes and "I told you so." :-)

DaveyJJ
#12
06/24/2004 (7:34 pm)
@Elisabeth,

How are you trying to run your .app ? from Xcode, command line or Finder ? The torque Demo debug goes in the folder you mentioned. And it will work ( at least it works here ) when called by the finder. When called by Xcode or Terminal, what is really executed is the application that resides inside the.app ( type cd TorqueDemo Debug.app to see it in the resources folder ). If you call it, it won't find a main.cs in there.

@DaveyJJ

Just a simple question : Have you checked if you have a starter.fps directory ? As I've seen you have an fps directory. try renaming it to starter.fps.

Also : there is a bug in the root main.cs that reports more ( or less ) command line parameters than there really are. This is only a mac bug.

And, regarding the mac comunity. I've also posted some rants about it's lack of existance but I was just mocked at and called a MacZealot. What happens is that those of us who don't have PCs have grown acustomed to a more participative and helpfull comunity.

But Torque DOES work on Macs. I'm developping my whole game on it and I DON'T have a PC.

Bruno
#13
06/24/2004 (9:15 pm)
Bruno, I have tried to run it in all three manners but the first way I tried was from Finder inside the "example" directory and that produces the error "Failed to open main.cs".

Starting from Xcode or the command line didn't work either, but I tried them just to see...

Any ideas?
#14
06/25/2004 (4:30 am)
Bruno,

Wow, finally a Mac guy replies! :-) I'll try that rename thing and report back. I was told that some of the parameters being listed after a build were, indeed, just extraneous stuff that wouldn't affect anything. But as I've explained to Mark, I can actually get the demo to (apparently) compile properly but then several things go wrong: no missions are available; odd crashes etc. Let me re-try today with the rename and see what happens. Good luck on your game, btw! I'm a big supporter of shareware (Orbz, Solace (crashy) and Samurai from Klear Games were all purchases in the last two months). No chance it's a port of the upcoming Rome Total War?

DaveyJJ
#15
06/25/2004 (5:09 am)
Bruno,

No joy. It won't even build as it's giving me three errors for "Missing file or directory" "...blahblah/torque/example/torque_pb_2_1.build/Info.plist, and pbdevelopment.plist, and Pkginfo"

Ugh. Much stronger language being used here ;-)
#16
06/25/2004 (5:12 am)
Sounds like the resolution bug to me, try setting your desktop res higher

[edit]opps maybe not[/edit]
#17
06/25/2004 (5:27 am)
Bruno,

No joy. It won't even build as it's giving me three errors for "Missing file or directory" "...blahblah/torque/example/torque_pb_2_1.build/Info.plist, and pbdevelopment.plist, and Pkginfo"

Ugh. Much stronger language being used here ;-)
#18
06/25/2004 (6:38 am)
A simple explanation first : The main.cs file that torque doesn't find ISN'T the one on the "game root" directory ( that is called as "~" ). If it were you wouldn't have a console listing at all. There are several main.cs files in a game project. The one torque isn't finding is the ~/starter.fps/main.cs.

A little carbon 101 : A carbon app isn't really an app. It's a directory with a special flag called "bundled". Inside it contains the app itself one of it's subfolders, together with the several localized interfaces and dictionaries.

Pkginfo keeps info about the whole package, what icon it uses, the executable binary name, etc.
Info.plist keeps info that shows on the finder Get-Info panel.
pbdevelopment.plist PROBABLY keeps info that will help the building.

Those files are XML files ( readable in any text editor ) and if you don't have them where they should be, find them and copy them to the desired location.

@Elisabeth.

As I seen from your ls, you don't have a starter.fps. Have you tried renaming your "fps" directory to "starter.fps" ?

@DJJ
I thought your building problems were over ? You managed to build it in Apr 06 ? didn't you ?

Bruno
#19
06/25/2004 (7:17 am)
Not without errors, no. I've never been able to compile a working demo app that had any missions to load and didn't exhibit odd behaviour once compiled (hang when clicking menu items, etc).

And those XML files don't exist at all in the Torque CVS download; I assumed they were generated during the build process. But if they are separate files that need to be generated by me, why isn't that in the Mac-specific instructions for building the Torque demo?

I'm on vacation anyways starting tomorrow so am just going to leave this whole thing again. I very, very much appreciate the attempts at help, Bruno, but I remebered why I dropped this all now back in April ... the circular getting nowhere despite many people's attempt to help. It's obviously an operator error here on my end. Cavaet emptor, I guess. :-)
#20
06/25/2004 (7:25 am)
Not without errors, no. I've never been able to compile a working demo app that had any missions to load and didn't exhibit odd behaviour once compiled (hang when clicking menu items, etc).

And those XML files don't exist at all in the Torque CVS download; I assumed they were generated during the build process. But if they are separate files that need to be generated by me, why isn't that in the Mac-specific instructions for building the Torque demo?

I'm on vacation anyways starting tomorrow so am just going to leave this whole thing again. I very, very much appreciate the attempts at help, Bruno, but I remebered why I dropped this all now back in April ... the circular getting nowhere despite many people's attempt to help. It's obviously an operator error here on my end. Cavaet emptor, I guess. :-)
Page «Previous 1 2