Google

[Solved] Newbie Q: Cross compiling with Kdevelop

Get answers to all your basic programming questions. No Ogre questions, please!

Moderators: Moderators, OGRE Team

[Solved] Newbie Q: Cross compiling with Kdevelop

Postby serrix » Mon Dec 25, 2006 6:11 am

Hi there,
Sorry if i'm reposting a asked Q or in the wrong place...

I've found a couple of guides like the ones below:
http://wiki.codeblocks.org/index.php?ti ... _Compilers
http://www.ogre3d.org/wiki/index.php/Se ... evelop_IDE

They all seem to use code::blocks for cross compling.

Is there a way to cross compile to windows using kdevelop?
I'm running kubuntu and have mingw32 installed.
Following this: http://www.ogre3d.org/wiki/index.php/Se ... evelop_IDE i've got the working application but now want to set up cross capatibility for windows and OS X.

Do i just need to do something similar to: http://www.ogre3d.org/wiki/index.php/ProjectPaths to get the application to work under OS X? (I guess that would make sense since its based off darwin)

Any help would be greatly appreciated, hopefully will clear up my super confused mind too.
Thanks in advance for your time and suggestions,
Cheers,
Serrix.
Last edited by serrix on Wed Dec 27, 2006 10:03 am, edited 1 time in total.
serrix
Newcomer
 
Posts: 23
Joined: Tue Mar 14, 2006 12:34 am

Postby irrdev » Tue Dec 26, 2006 10:11 am

I had a bit of a tough time deciphering your topic. I think I need to clear a couple things up...
In order for any app to run on an OS, it has to be compiled on that OS. That means any app that you compile on a Mac won't run on Linux or Windows, but it will run on all Macs. You may, however, take your code to the desired OS(Linux, Windows) and compile it on that machine so that you can run it on that OS. Ogre is a cross-platform library/api. That means that you can take the exact code from your OS and compile it on another Mac, Linux or Windows. There are some libraries that don't support this; that is why Ogre is so popular. Also, I may note that KDeveop is Mac only. Apple doesn't release the source code and so you can't compile it on either Linux or Windows. In order to compile on either of the two latter platforms, you have to use an IDE like Code::Blocks or Microsoft Visual C++. As stated before, your code should compile like on your OS, and run exactly the same. :wink:

P.S. There is actually a way to run Windows compiled app on Linux. It is a project called Wine. Unfortunately, there exists no like implementation for Linux->Windows, Linux->Mac, Mac->Windows, Mac->Linux, Windows->Mac. :wink:
FeedLaunch .NET RSS and ATOM feed editor- open-source and released under the GPL. Visit Feed Launch .NET Project Website hosted at sourceforge.net
User avatar
irrdev
Veteran
 
Posts: 420
Joined: Sun Oct 15, 2006 7:30 pm

Postby serrix » Tue Dec 26, 2006 3:57 pm

Hey,
Sorry - was completly confused there for a minute (hence the very bad wording... reading through it it dosn't make very much sense, sorry about that)
I had the crazy idea you could compile a app and have it run in the OS is was compiled for, didn't realise you had to compile it on the OS you wanted to run it on.

Does that include OS X? I'm not sure how close Darwin (based of BSD i think...) would be to other flavors of linux but if its packaged properly it may work?
http://www.ogre3d.org/wiki/index.php/ProjectPaths

Sounds like cedega will get some use on the dev box now too :)
Thanks for replying and clearing the confusion, I really appreciate it

Cheers,
Jason
serrix
Newcomer
 
Posts: 23
Joined: Tue Mar 14, 2006 12:34 am

Postby hmoraldo » Tue Dec 26, 2006 4:17 pm

irrdev wrote:I had a bit of a tough time deciphering your topic. I think I need to clear a couple things up...
In order for any app to run on an OS, it has to be compiled on that OS.


No, there is actually this thing the original poster is talking about, cross compiling, that lets you compile, say, a Windows app in Linux. How to do that in ogre is also explained in the wiki if I remember right (using Mingw).

Best regards,
H. Hernan Moraldo
Personal website
User avatar
hmoraldo
OGRE Expert User
OGRE Expert User
 
Posts: 517
Joined: Tue Mar 07, 2006 11:22 pm
Location: Buenos Aires, Argentina

Postby Game_Ender » Tue Dec 26, 2006 4:23 pm

Irrdev is wrong, you can compile applications on Linux and have them run on Windows its just a little complex and might not work for something like Ogre. The trick is that you must link your project against all the windows libraries it depends on.

What a cross complier does is build executables for another platforms (called the target) on the host, which in your case is Linux. This is done all the time for the embedded development, and probably console development as well. The complex part, after getting the tool chain setup which is what the mingw32 package provides, is getting all the dependencies libraries for your target platform on you host.

You should be able to compile things Ogre and its dependencies, but I would get the MinGW Ogre SDK instead. Now in order to compile your application you would setup your project just like you would on windows so you can base what you do off the Windows instructions. The issue here is that you need some windows libraries that don't come with Linux and probably don't come with the mingw linux package. You might be able link against the ones provided with wine, but you won't know till you try.

The same caveats apply to OS X, but its quite a bit harder because you need to somehow get a hold off all the Mac Carbon/Cocoa frameworks and have to get the Apple vervsion of GCC which Darwin has. I am not sure its even worth it.

EDIT: This will only work if your application would compile on the target platform already.
User avatar
Game_Ender
Veteran
 
Posts: 1268
Joined: Wed May 25, 2005 2:31 am
Location: Rockville, MD, USA

Postby irrdev » Tue Dec 26, 2006 10:53 pm

Never heard of compiling an app for windows on a Linux machine. I learned something new. I believe that I once heard about a Linux->Mac implementation, but I considered it too buggy to be worth mentioning. This is interesting, although I will express my doubts about this ever working with an api like Ogre. :wink:
FeedLaunch .NET RSS and ATOM feed editor- open-source and released under the GPL. Visit Feed Launch .NET Project Website hosted at sourceforge.net
User avatar
irrdev
Veteran
 
Posts: 420
Joined: Sun Oct 15, 2006 7:30 pm

Postby hmoraldo » Tue Dec 26, 2006 11:39 pm

I think this should work well; Gcc and Mingw do their work as well in any platform; if they can compile Ogre under Windows, they can do it under Linux for Windows as well. There is no black magic in that (as far as you provide it with the right libraries and stuff).
H. Hernan Moraldo
Personal website
User avatar
hmoraldo
OGRE Expert User
OGRE Expert User
 
Posts: 517
Joined: Tue Mar 07, 2006 11:22 pm
Location: Buenos Aires, Argentina

Postby serrix » Wed Dec 27, 2006 12:56 am

Hey there,
Thanks Game_Ender, I thought it was possible... Unfortunatly i'm not experienced enough to get it working, i found the instructions for mingw alittle above my level at the moment (i'm stuck again http://www.ogre3d.org/phpBB2/viewtopic.php?t=27430 :shock: )

I think once i've got the game state set up and have made a basic scene with a few moving lights for the intro and maybe a basic menu i'll (try) get mingw going again, since it'll be a pain to try implement it anyway further through.
If anyone gets it going before then and can prehaps have a blank project as a example i'd be greatful.
Thanks for all your help guys!
Cheers,
Serrix
serrix
Newcomer
 
Posts: 23
Joined: Tue Mar 14, 2006 12:34 am


Return to Back to Basics

Who is online

Users browsing this forum: No registered users and 1 guest