Code::Blocks Forums

User forums => Help => Topic started by: cube1982 on August 01, 2007, 11:34:11 pm

Title: How to install C::B on cygwin?
Post by: cube1982 on August 01, 2007, 11:34:11 pm
My OS is WinXP. I have used C::B 1RC2 for two months and really like it. Now I have a project need to be done on Cygwin. So I want to install a Nightly build C::B on Cygwin. It seems I need to install the wxWidgets first. My problems are:

1. Should I install wxWidgets on Windows or Cygwin? Which package I should install? wxGTK or wxMSW?

2. Is there a complete guide that illustrates the whole procedure?

3. Any one can help me to install C::B on Cygwin?

Thanks! Thanks! Thanks! :shock:

Title: Re: How to install C::B on cygwin?
Post by: raph on August 02, 2007, 12:12:28 am
You do not need wxWidgets to get codeblocks running (just a dll which is linked in the nightly build forum posts).
If you want to develop own applications using wxWidgets you need wxMSW installed to compile it under windows and wxGTK if you want to build them under linux.
Have a look at the wiki (http://wiki.codeblocks.org/index.php?title=Main_Page). There you will find information how to install different compiles.

Regards raph
Title: Re: How to install C::B on cygwin?
Post by: cube1982 on August 02, 2007, 12:59:27 am
Thank you for your quick reply!

Since I need to install C::B on Cygwin, I assume that I should follow this wiki instruction:
"Installing Code::Blocks from source on Linux"
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux

If so, I have to install wxWidgets, because "... In order to sucesfully compile Code::Blocks, the wxWidgets (wxGTK-2.6.1 or later) cross-platform UI library must be installed..."

Am I correct?

Thanks
Title: Re: How to install C::B on cygwin?
Post by: stahta01 on August 02, 2007, 01:21:46 am
Note, Please try to download the regular Code::Blocks nightly build for use under windows.
Then, set it up to use the Cygwin GCC and see if it works for what you want.

You will likely find a few bugs (since I don't know if anyone has tested C::B using Cygwin GCC recently), but just post them and they should get fixed quicky.

I spent two days trying to compile Code::Blocks under Cygwin and I failed badly.

Note, if you wish to try remember Cygwin has no Unicode support so if building code::blocks under it you must do ANSI build.
Edit: The Code::Blocks configure was hard codded to use wxGTK as of a month or two ago, so try it using GTK installed.

My standard command to configure wxWidgets under Cygwin, note I never really used the build yet, so may have issues.

Code
../configure --with-gtk=2 --enable-shared \
  --enable-monolithic --enable-unicode=no \
  --without-odbc  \
  --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin \
  --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin

Tim S
Title: Re: How to install C::B on cygwin?
Post by: lizhuoyi on August 02, 2007, 03:52:37 am
Note, Please try to download the regular Code::Blocks nightly build for use under windows.
Then, set it up to use the Cygwin GCC and see if it works for what you want.

You will likely find a few bugs (since I don't know if anyone has tested C::B using Cygwin GCC recently), but just post them and they should get fixed quicky.


I used Code::Blocks with arm-9tdmi-linux-gnu toolchain, it is perfect! ( but gdb is :( )
Title: Re: How to install C::B on cygwin?
Post by: cube1982 on August 02, 2007, 05:22:03 am
If I build a program using Cygwin GCC via C::B under Windows, can that program run on Linux or Unix?

Another question is my project requires 3rd party libraries. And there is not easy way to install them on Windows. So I have to install them on Cygwin. Can I still use C::B to compile those libraries and build my program under Windows?

Thanks 



Note, Please try to download the regular Code::Blocks nightly build for use under windows.
Then, set it up to use the Cygwin GCC and see if it works for what you want.

You will likely find a few bugs (since I don't know if anyone has tested C::B using Cygwin GCC recently), but just post them and they should get fixed quicky.

I spent two days trying to compile Code::Blocks under Cygwin and I failed badly.

Note, if you wish to try remember Cygwin has no Unicode support so if building code::blocks under it you must do ANSI build.
Edit: The Code::Blocks configure was hard codded to use wxGTK as of a month or two ago, so try it using GTK installed.

My standard command to configure wxWidgets under Cygwin, note I never really used the build yet, so may have issues.

Code
../configure --with-gtk=2 --enable-shared \
  --enable-monolithic --enable-unicode=no \
  --without-odbc  \
  --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin \
  --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin

Tim S
Title: Re: How to install C::B on cygwin?
Post by: stahta01 on August 02, 2007, 06:46:57 am
If I build a program using Cygwin GCC via C::B under Windows, can that program run on Linux or Unix?

No, to my knowledge there is no ABI Compatibility between CygWin and Linux Distros.

Another question is my project requires 3rd party libraries. And there is not easy way to install them on Windows. So I have to install them on Cygwin. Can I still use C::B to compile those libraries and build my program under Windows?

Maybe, if you can build it with Cygwin GCC C++ compiler then you should be able to build it using C::B using Cygwin GCC.

Note, C::B is an IDE not an compiler. You need to know and understand what Cygwin GCC compiler can do, I don't really use it much so am not a good source of info.
 
Tim S
Title: Re: How to install C::B on cygwin?
Post by: cube1982 on August 02, 2007, 07:18:07 am
So if I want to develop an application can run on Linux, the solution is to use the wxWidgets?

Thank you very much, Tim! you have already help me a lot.

If I build a program using Cygwin GCC via C::B under Windows, can that program run on Linux or Unix?

No, to my knowledge there is no ABI Compatibility between CygWin and Linux Distros.

Another question is my project requires 3rd party libraries. And there is not easy way to install them on Windows. So I have to install them on Cygwin. Can I still use C::B to compile those libraries and build my program under Windows?

Maybe, if you can build it with Cygwin GCC C++ compiler then you should be able to build it using C::B using Cygwin GCC.

Note, C::B is an IDE not an compiler. You need to know and understand what Cygwin GCC compiler can do, I don't really use it much so am not a good source of info.
 
Tim S
Title: Re: How to install C::B on cygwin?
Post by: stahta01 on August 02, 2007, 07:42:40 am
So if I want to develop an application can run on Linux, the solution is to use the wxWidgets?

There is no easy option that can create an application that can run on all Linux distros.

You need separate binary packages for each major distro. Your source code should be able to work on most or even maybe all of the Linux distros, but you will need to test on a few of the Distros.

You must test you application on an Unicode OS before writing very much code, it is very easy to make mistakes in ANSI using wxWidgets that works under Cygwin, but not under an Unicode OS.

If you wish to develop an Linux Application, I suggest writing it under the Linux OS not under Cygwin!

Tim S
Title: Re: How to install C::B on cygwin?
Post by: MortenMacFly on August 02, 2007, 07:51:06 am
I spent two days trying to compile Code::Blocks under Cygwin and I failed badly.
Why are you guys trying such??? :shock: :shock: :shock:
If you want to develop Apps for Cygwin just install Cygwin and setup the Cygwin compiler inside "native" C::B. You can even setup the tool menu to run the Cygwin bash with your application if you like. This way you can produce apps that will need the Cygwin layer (DLL). There is no need to compile C::B under Cygwin for that purpose.

Hence this will not guarantee that your apps are "Linux compatible" in the end.

With regards, Morten.
Title: Re: How to install C::B on cygwin?
Post by: stahta01 on August 02, 2007, 07:56:39 am
Why are you guys trying such??? :shock: :shock: :shock:

I did because I wanted a way to verify my patches to Code::Blocks did not break the configure make method used by Linux.

Also, tried to build Code::Blocks using configure make method under MSYS and failed also.

I have no idea why someone would use Cygwin to develop for Linux because there is many differences. More than I would have guessed till I tried testing the building of Code::Blocks under Cygwin.

Tim S
Title: Re: How to install C::B on cygwin?
Post by: Biplab on August 02, 2007, 09:02:31 am
If I build a program using Cygwin GCC via C::B under Windows, can that program run on Linux or Unix?

NO. It won't. But you can if you use cross-compiling tools (I don't know if they are available on Cygwin or not).

Why are you guys trying such??? :shock: :shock: :shock:
I did because I wanted a way to verify my patches to Code::Blocks did not break the configure make method used by Linux.

I agree with Morten. There is no need to use Cygwin to build C::B. If you want to test that the patches you make works on Linux, I would recommend you to download & install VMWare and install a Linux distro in it. In that way you can be sure of the outcome. :)
Title: Re: How to install C::B on cygwin?
Post by: stahta01 on August 02, 2007, 09:12:52 am
I agree with Morten. There is no need to use Cygwin to build C::B. If you want to test that the patches you make works on Linux, I would recommend you to download & install VMWare and install a Linux distro in it. In that way you can be sure of the outcome. :)

FYI: I have been using andLinux to test it, but I thought it was worth a try doing Cygwin. I thought about doing an VMWare, but I had issues related to Windows XP. I really should re-format my PC, windows is acting unstable sometimes and VMware seems to not work to work with my current setup.

I am really thinking of using Linux and running Windows in a Virtual machine.

cube1982: Cygwin is not really for development of new Linux applications, but it is good for porting Linux applications to windows.

Tim S
Title: Re: How to install C::B on cygwin?
Post by: cube1982 on August 02, 2007, 07:51:31 pm
I don't have a Linux OS installed, and I don't think I can install and learn it in a short period of time. So what's the best way, if any, to develop Linux applications under Windows?

yes, I m a newbie and really thank all you guys.
Title: Re: How to install C::B on cygwin?
Post by: stahta01 on August 02, 2007, 08:06:39 pm
I don't have a Linux OS installed, and I don't think I can install and learn it in a short period of time. So what's the best way, if any, to develop Linux applications under Windows?

yes, I m a newbie and really thank all you guys.

The best way, to test your application, is to have an dedicated Linux machine(s) with the OS the same as the major target Linux distribution(s).
Next, is dual booting Linux on your PC for final testing of application.
Third, is using an Virtual machine under your Windows OS.

What do you know about Linux?
Do you know that Linux distributions very a lot?
Having one binary package for Linux distributions is very hard to do for complex applications and sometimes for simple applications.
What is the top three Linux distributions you are targeting?

Edit: I am trying out Cooperative Linux from http://sourceforge.net/projects/colinux/ to test Linux Builds right now.
It is a special type of Virtual machine solution, andLinux is based on an older version of Cooperative Linux.

Tim S

Title: Re: How to install C::B on cygwin?
Post by: cube1982 on August 03, 2007, 12:48:48 am

The best way, to test your application, is to have an dedicated Linux machine(s) with the OS the same as the major target Linux distribution(s).
Next, is dual booting Linux on your PC for final testing of application.
Third, is using an Virtual machine under your Windows OS.

What do you know about Linux?
Do you know that Linux distributions very a lot?
Having one binary package for Linux distributions is very hard to do for complex applications and sometimes for simple applications.
What is the top three Linux distributions you are targeting?

Edit: I am trying out Cooperative Linux from http://sourceforge.net/projects/colinux/ to test Linux Builds right now.
It is a special type of Virtual machine solution, andLinux is based on an older version of Cooperative Linux.

Tim S




A friend finally allowed me to use his machine(running Linux) to build and test my code. Thank godness! But I will try use a VM after getting this project done.

Many thanks!