Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,613 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 930 people online right now. Registration is fast and FREE... Join Now!




Code::Blocks Compiler question

 
Reply to this topicStart new topic

Code::Blocks Compiler question

polymath
post 16 Jul, 2008 - 09:21 AM
Post #1


D.I.C Regular

Group Icon
Joined: 4 Apr, 2008
Posts: 407



Thanked 4 times

Dream Kudos: 500
My Contributions


I am just starting to try Code::Blocks after using Dev-C++ and MSVC++, and I was wondering if I can set Code::Blocks to build for a platform other than that which I am using (WinXP), since my friend uses ubuntu all the time and I wanted to share my finished projects with him. Any help is appreciated.
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 16 Jul, 2008 - 09:47 AM
Post #2


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,176



Thanked 33 times

Dream Kudos: 25
My Contributions


The problem is not so much that Code::Blocks cannot be used for linux platforms (it can), but in the fact that the projects created on a windows system end up as an exe file. exe files will not run natively on linux, but you can use something like Wine to run it.

You can certainly write code using code::Blocks (or any IDE) that will run on Linux - you just have to adhere to standards and avoid platform dependencies. you'd also have to recompile the code in question on the linux platform.
User is offlineProfile CardPM

Go to the top of the page

polymath
post 16 Jul, 2008 - 09:51 AM
Post #3


D.I.C Regular

Group Icon
Joined: 4 Apr, 2008
Posts: 407



Thanked 4 times

Dream Kudos: 500
My Contributions


So I cannot compile directly on windows for linux, but if i download a second port of an IDE for Linux on a dual boot or sommat then I can compile for both (I just have to compile, restart, and compile again)? I'm not great with platform stuff...
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 16 Jul, 2008 - 10:25 AM
Post #4


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,439



Thanked 94 times

Dream Kudos: 2625

Expert In: ruling the world.

My Contributions


The way that I make gpe files for my GP2X is to compile them into an exe, and then run that exe through a converter, using different linker settings to make that exe into a gpe.

Screwed if I know how it works though...

Edit:
All I know is it runs stuff like -lgp2x as linker settings.
User is online!Profile CardPM

Go to the top of the page

Amadeus
post 16 Jul, 2008 - 11:17 AM
Post #5


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,176



Thanked 33 times

Dream Kudos: 25
My Contributions


@polymath: Correct, although you may not need to download another IDE. Most linux systems inherently have the gcc compiler on them for use, and since you would have already done all the design on the windows system, you'd probably only need to compile and run on linux.

Of course, the other option is to use something like Wine to run the executable from Windows directly.
User is offlineProfile CardPM

Go to the top of the page

MorphiusFaydal
post 16 Jul, 2008 - 02:11 PM
Post #6


D.I.C Lover

Group Icon
Joined: 12 May, 2005
Posts: 1,086



Thanked 8 times

Expert In: Hardware, Networking

My Contributions


If you look around on the Code::Blocks forums, there's a couple threads over there about how to set up cross-compiling... Not sure if you can do it on a Windows box, because I think they were setting up a new build of GCC on a linux box to compile for ARM or something like that...
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 16 Jul, 2008 - 02:49 PM
Post #7


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,439



Thanked 94 times

Dream Kudos: 2625

Expert In: ruling the world.

My Contributions


I'll look into it and see if I can tweak the settings a little tomorrow, the GP2X runs on a port of Linux anyway.

But I work with Dev-CPP when I'm making gpe programs.

Anyway, I'll keep you posted.
User is online!Profile CardPM

Go to the top of the page

gabehabe
post 18 Jul, 2008 - 01:56 AM
Post #8


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,439



Thanked 94 times

Dream Kudos: 2625

Expert In: ruling the world.

My Contributions


OK, I've found a detailed tutorial:

http://forums.codeblocks.org/index.php?topic=3343.0

It's even on the Code::Blocks website smile.gif

Good luck!

Edit:Crap, I retract that. It's for compiling Windows programs under Linux.

Another edit: Try this:
http://metamod-p.sourceforge.net/cross-com....for.linux.html
User is online!Profile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/23/08 02:44AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month