Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: typicalc on May 24, 2016, 04:27:36 pm

Title: How to set target for linux?
Post by: typicalc on May 24, 2016, 04:27:36 pm
I've created a small C exe that I've run on Windows 7 command prompt. No errors or warnings.
It has no Windows features, inludes or libraries - just plain C.

Now I'd like to create a Linux exe from same source. How do I select target exe to be "native" linux? Currently my Build->Select targe has only "Debug" and Release".

I'm planning on creating an exe for Raspberry Pi with linux distro but compile & link it on a Windows 7 computer. I copy the resulting exe to the Rasberry SSD and run it there as a console app.
Title: Re: How to set target for linux?
Post by: oBFusCATed on May 24, 2016, 07:07:07 pm
I'm planning on creating an exe for Raspberry Pi with linux distro but compile & link it on a Windows 7 computer. I copy the resulting exe to the Rasberry SSD and run it there as a console app.
The first problem you need to solve is finding a compiler that can work on windows and build for arm-linux. The official name for this is cross compiling.
After that you can think how to setup the project in codeblocks.

Have you solved this problem?
Title: Re: How to set target for linux?
Post by: typicalc on May 24, 2016, 09:18:39 pm
Ok.  I'll have to move the source files over to Raspberry and use GCC over there to compile and link.
Thank you for the time.