about xcode

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

about xcode

Postby Julio Jerez » Mon Feb 21, 2011 5:37 pm

Her is a problem with xcode that had being bothering me with for a while.

In Visual studio to can make a static library project and then you cna add tha project to any othe project as a dependency.
If you use any makefile, you also can call othe make files and even pass parameters as argument.

However in Xcode I can not figure ut hwo to make a project a dependency of of anoteh project.
for example I have a math library, teh Netwon core, the container, etc
How can I make those sub projects of teh Main application with out having to recreate the project as a target?

bafore this was ok because the libraryes were close source but now I want to add them as dependecies to the demos by I cannot figure it out
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby thedmd » Mon Feb 21, 2011 6:05 pm

Select "Project" -> "Add to Project..." and select Xcode project file from which current is dependent. Then you will see list of the targets under this Xcode project. Drag target to current target and viola. If dependency is missing it is automatically build by Xcode when needed.

This works well for our games.
thedmd
 

Re: about xcode

Postby Julio Jerez » Mon Feb 21, 2011 6:33 pm

Ok it worked. Thanks

Now I am having ton of errors with the Qt framerk and I do not know what is wrong there.
I even get errors when building the demos tha coem with QT sdk
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby thedmd » Mon Feb 21, 2011 7:45 pm

Unfortunate thing is I cannot help you much with Qt. I may try to build it, but that would be possible on the weekend.
thedmd
 

Re: about xcode

Postby Julio Jerez » Mon Feb 21, 2011 11:55 pm

Ok I think I found the problem. I typed some of the errors in google, and it appears that xcopde 4.2 is quite bogus in xcpode.
tousands of people are complaining about the same bugs I am having.

Newton simple do not compile with GCC 4.2 in xcode, but if I switch to GCC 4.0 is works fine.
then the same bugs happen with QT headers, but setting xcode to use GCC 4.0 it works fine too.

In Google I found lots of people with the same bugs and one of the said that it is a Bug with GCC 4.2 and the system header files, he recomended to stay with GCC 4.0
and it apears that he is correct. so it was not xcode 3.2.5 it is GCC 4.2 integration that does no seems to work with later version of xcode.


Now the problem I am having it with the dependencies libraries,
what you say works, however I am still having the problem that I have to add the libraries to the project,
but I do not knwo how to set the configuration to use the matching library
for example the debug configuration should use debug libraries, Release should link Release libaries and so on.
This is very eassy with visual studio, not so much with xcode.

I am having an unexpected very, vary hard time with this.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby thedmd » Tue Feb 22, 2011 6:00 am

That's weird, because actually I did compiled Newton using GCC 4.2 using your Xcode project. I got no errors at all.
To be honest I did three changes:
- Base SDK is set to the latest (Mac OS X 10.6) in my case
- Compiler was changed to GCC 4.2
- Mac OS X Deployment Target was changed to Mac OS X 10.4

I do not have any test application to test those libraries. To prove this I prepared a package. This should work on Mac OS X 10.4 and newer on PPC, x86 and x64.
http://77.55.66.239/thedmd/files/Newton_Mac_OS_X_Universal.7z

One configuration in Xcode is able to produce one target. In our project we have Debug, Release and ReleaseDebug configurations both in engine and games. Procedure to add dependency is as follows:
- open info tab for specified target (application target, which need a dependency)
- in general tab in "Direct Dependencies" click '+' and add desired dependency
- in "Linked Libraries" do very same thing, you will probably need to use "Add other..." button or drag library target reference directly into list of linked libraries
(sorry for repeating this, but I want to clarify some steps as I have access to mac right now)

Architecture and configurations are matched automatically and I doubt they can be changed. I didn't found a equivalent of configuration manager is Visual Studio yet. I suspect there is no such functionality in Xcode.
thedmd
 

Re: about xcode

Postby Julio Jerez » Tue Feb 22, 2011 11:10 am

Ok I just added the xcode project, but it barely compile.
There are the problems:
    1-It compiles in Debug but not in Release, In release it complains that the functions in the dependency libraries are missing.
    2-I cannot figure out how to make the dependency to compile when and change Is made, I have to recompile then one by one, and the is very tedious
    3-I cannot figure out how to make the Configuration use the current dependency libraries, I have to switch them each time I switch configuration.
    4-I have not run it yet; I believe it will crash because I probably have to change the function that finds the files in the media folder. We can fix that after we finalize the project file
I you sync to SVN and the project you can open the xcode project newtonDemos, in the application/project fordel.
If you can figure a way of fixing the first thee problems, then we are in business and that will complete the SVN archive.
From that point on it is only working on the engine and the Editor.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby thedmd » Tue Feb 22, 2011 2:53 pm

Got it! Sweet! OK.

I did the following things in newton, tinyxml, dScene, dContainers, dMath and newtonDemo:
- set Base SDK to "Latest"
- set compiler to "GCC 4.2"
- set deployment target to Mac OS X 10.4
- add _MAC_VER preprocessor definition if missing

In newtonDemo:
- remove _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC thing from preprocessor
- add "Direct Dependencies"
- remove libnewton.a and the rest of dependencies and add them again trough dragging from references
- add CoreFoundation.framerowk
- check: build active archs only (this is not necessary, but I do not have Qt for Mac OS X 10.4 so I has to do this)
- fix GetWorkingFileName() to use hardcoded path to media, current implementation does not work
- comment out dThread::Lock() since it cause deadlocks (I do not know why, but real cause of it is probably in other place)

After such changes demo is almost usable. Simulation is reseted every second and I do not know why.
thedmd
 

Re: about xcode

Postby Julio Jerez » Tue Feb 22, 2011 3:25 pm

excelent !!

I will make those changes tonight or if you make a patch I can just integrated.

about the serest every secund I know what that is.
It is the dTread class in teh container library that is broken for both Linux and Mac, I have to fix it.
In linux I just Hacked to not run asyncropnuos for the time being, until I ge the projects running

bacially the plooblem is that is doe no re4st teh timing to the previeus and it isrepalate formn teh original pstion to the end teh last simulation frame.
It is no big deal I can fix it tonight.

This Open source thing is very cool.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby thedmd » Tue Feb 22, 2011 4:57 pm

Sure, I will prepare a patch tomorrow. I have a fresh mac on board and I didn't configured VNC yet, so I cannot use it at home.
That is one more conclusion. Everything work as expected on vanilla fresh system.

For dThread on Mac I did exactly same workaround as you did for Linux. Huh.

Unfortunate thing is newtonDemo cannot be compiled for every platform at the same time, because Qt based on Cocoa require Mac OS X 10.5 and above. On the other hand carbon Qt does not support x64 apps, no winners in there.
But, that is an issue only for demo application, Newton itself is compiled as universal library and single library file will handle x64, x86 and ppc. Nice!
thedmd
 

Re: about xcode

Postby Julio Jerez » Tue Feb 22, 2011 5:50 pm

thedmd wrote:Unfortunate thing is newtonDemo cannot be compiled for every platform at the same time, because Qt based on Cocoa require Mac OS X 10.5 and above. On the other hand carbon Qt does not support x64 apps, no winners in there.
But, that is an issue only for demo application, Newton itself is compiled as universal library and single library file will handle x64, x86 and ppc. Nice!

That was my impresion too, I asked of the Qt Forum and they replied that in fact is does. you can read here by the end
http://developer.qt.nokia.com/forums/viewthread/3980/

a helpful guy there by the name Volker todl to look at thsi table
http://doc.qt.nokia.com/4.7/developing-on-mac.html

for what ioc an see, using these options
10.5
Leopard
Cocoa
32/64
PPC/Intel
Yes

I beleive we can get to run in all Macs, by I did not read the hole article and I do not knwo hoe tio set that up.
It looks leke the mistake is that I selected Carbon framework, and it has to be Cocoa and OS 10.5, not 10.4
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby Cannos » Tue Feb 22, 2011 9:12 pm

Hey guys, I see that you're working on xcode / Mac stuff. Are one of you working on the xcodeproj for building libNewton_iPhoneDevice.a and libNewton_iPhoneEmulation.a? I searched in the SVN repository and the packaged up zip but couldn't find any xcodeproj files. I must be missing something.
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: about xcode

Postby Julio Jerez » Tue Feb 22, 2011 9:18 pm

No I did not added teh iphone icode project.
For some reason I could no make it compiled with my version of xcode.
later when I complete the problems we are having with QT we can add add version.

you can make you own by simple adding a new configuration to eh corrent project.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby Cannos » Tue Feb 22, 2011 9:33 pm

I'll give it a try. For some reason I wasn't seeing the xcodeprojs, but I guess I hadn't pulled down all the source yet. I see them now, so I'll see if I can make it work. Thanks.
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: about xcode

Postby thedmd » Wed Feb 23, 2011 4:17 am

Correct me if I'm wrong. Building newtonDemos for all Macs at once will require from me to build Qt with configuration specified in the article. Right?

To support all versions newtonDemos have to have target for Cocoa and target for Carbon. I do not know if I can install frameworks for Qt Cocoa and Carbon at once. It they are mutually exclusive the best option will be to abandon the Mac OS 10.4 ship. Alternative would be to abandon x64 binary versions and stick with x86. Compatibility for sake of performance.

Mentioned diff is in the attachment.
Attachments
mac.zip
Path for Mac OS X
(3.8 KiB) Downloaded 192 times
thedmd
 

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron