Trying to add Newton to an Xcode project (not iPhone)

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Trying to add Newton to an Xcode project (not iPhone)

Postby patrickdavison » Wed Aug 11, 2010 1:00 pm

I am trying to add Newton to an Xcode project I am working on, and run into errors every time. I am working on a Mac, running Leopard (not Snow Leopard) and am not developing for the iPhone. I say this because most of the examples or explanations I have found so far use the iPhone SDK which I do not have.

The instructions I have found for installation are, " include 'Newton.h' and include 'Newton.lib'."

I believe I have figured out that on a Mac, there is no "Newton.lib" but rather "newtonlib32.a". I have opened my existing project, and used "add existing file" to add both "Newton.h" and "newtonlib32.a". "newtonlib32.a" automatically adds itself to the Link Binary With Libraries section of my build target, which seems right. However, when I add an include call for "Newton.h" to my main.m file - I always get errors.

I write include like this:

#include "Newton.h"

and the errors I get are all syntax errors, usually before the names of Class Types. For example, "syntax error before 'NewtonHingeSliderUpdateDesc"

SO - after all of this, this MAY just be me having an Xcode problem. There is a lot about the program I do not understand and it's totally possible I have just screwed up the inclusion of the files somehow. However, I wanted to check and make sure I wasn't completely missing a step, or even trying to use the wrong file.

Any help that anyone could offer would be amazing. I'm actually really excited to start using Newton to...you know...model physics...but so far I've been stuck just trying to get the thing to work. And it's making me feel foolish.

For the record, this is for a not-for-profit experimental games project. My friend and I are developing this in our free time before we get busy with non-programming freelance work.
patrickdavison
 
Posts: 4
Joined: Wed Aug 11, 2010 12:46 pm

Re: Trying to add Newton to an Xcode project (not iPhone)

Postby Julio Jerez » Wed Aug 11, 2010 1:23 pm

First thing first, Did you get the demos that come withe the SDK running?

one for xcode 2.5 and one for xcode 3.0 or better.
the project for xcode 2.5 skould run out of teh Box on all Macs running OSX Leopard
That projec was build on a Imac G5, an it is a 32 bit build.

If you are using and newer OS and and Intel Macl the you can open teh projet for 3.0,
the was was made on a Mac pro, with xcode 3.1 and should run on all mac using OS10 tiger

if you are using a older Mac you can using the library NewtonLibG3.
The Iphone Build is in a separate forder.

Tell me if you get any of the project to open and run first.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Trying to add Newton to an Xcode project (not iPhone)

Postby patrickdavison » Wed Aug 11, 2010 1:47 pm

Hey there - thanks for the help.

Yes, I found the Xcode 3.0 example - opened it, compiled on first shot - and ran it. The app runs, and I'm able to switch and watch probably the first ten or so scenes. The later, more complicated scenes all crash before opening. But it runs.
patrickdavison
 
Posts: 4
Joined: Wed Aug 11, 2010 12:46 pm

Re: Trying to add Newton to an Xcode project (not iPhone)

Postby Julio Jerez » Wed Aug 11, 2010 1:59 pm

Yes some scene crash, but the crash have nothing to do with Newton, it is because asset management.
I made the mistake of using Collada as asset manager but I did not realized how limited it really is in some areas, and how bloated it is in others.
Plus is requires a great deal of maintenance to add new funtionality.
I realeased because there were some bugs fixes in the Newton Library that were stoping some people.

I am in teh process of making change to the file format, (making a new Newton proprietary format),
I am changing some of the libraries and that makes demos tah were working before crash in teh lastest version,
But it is not relate to the Newton libraries.

I am also changing wxWidget GUI, and will make the next version use the Native OSX GUI, just like it is in the Iphone.
I am hoping these changes will make the SDK more palettable to the native Mac users.

anyway, if you create your xcode project, you can just add the Newton Library and header which I am guessing is Newtonlib64.
If you are using C++ you should have not problems. if you are using objective C you can probably use the Iphone wrapper to the engine and replace the iphone library with the the Newton Library.
I have not done that, but it should works since the Iphone build does not have any changes specific for Iphone,
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Trying to add Newton to an Xcode project (not iPhone)

Postby patrickdavison » Wed Aug 11, 2010 2:08 pm

Hey there - yeah I wasn't too worried about the demo.

So to be clear, do I need to add both Newton.h and newtonlib64.a to the project? Or just the newtonlib64.a?

The problem for me comes when I try to include Newton.h in my already existing program.

This might be an objective-C problem. I'm not sure what you were trying to say about the iPhone wrapper.

I guess I might be importing things wrong. If you have any other advice, that would be great. I guess I'll go dig for more Xcode help.

Thanks.
patrickdavison
 
Posts: 4
Joined: Wed Aug 11, 2010 12:46 pm

Re: Trying to add Newton to an Xcode project (not iPhone)

Postby Julio Jerez » Wed Aug 11, 2010 2:26 pm

I guess you need Newton.h and newtonlib64.a
I will check it out tonight, to be sure.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Trying to add Newton to an Xcode project (not iPhone)

Postby patrickdavison » Wed Aug 11, 2010 2:28 pm

Hey there - after some double checking I was running objective C, not C ++ and after switching over, I think it works. Thanks for helping!
patrickdavison
 
Posts: 4
Joined: Wed Aug 11, 2010 12:46 pm

Re: Trying to add Newton to an Xcode project (not iPhone)

Postby Julio Jerez » Wed Aug 11, 2010 4:27 pm

Would you be interets in a Objective C project?

Since I am going to rewrite the Mac SDK, I am thing to use the Objective C wrapper I made, tha way I will have just one SDK for all mac platform,
but I do not know how popular is Objective C with Mac deveopers.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 49 guests

cron