Author Topic: How to install C::B on cygwin?  (Read 7535 times)

Offline cube1982

  • Single posting newcomer
  • *
  • Posts: 8
How to install C::B on cygwin?
« 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:


Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: How to install C::B on cygwin?
« Reply #1 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. There you will find information how to install different compiles.

Regards raph

Offline cube1982

  • Single posting newcomer
  • *
  • Posts: 8
Re: How to install C::B on cygwin?
« Reply #2 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: How to install C::B on cygwin?
« Reply #3 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: [Select]
../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
« Last Edit: August 02, 2007, 01:28:49 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline lizhuoyi

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: How to install C::B on cygwin?
« Reply #4 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 :( )

Offline cube1982

  • Single posting newcomer
  • *
  • Posts: 8
Re: How to install C::B on cygwin?
« Reply #5 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: [Select]
../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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: How to install C::B on cygwin?
« Reply #6 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
« Last Edit: August 02, 2007, 06:48:59 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline cube1982

  • Single posting newcomer
  • *
  • Posts: 8
Re: How to install C::B on cygwin?
« Reply #7 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: How to install C::B on cygwin?
« Reply #8 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
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9609
Re: How to install C::B on cygwin?
« Reply #9 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: How to install C::B on cygwin?
« Reply #10 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
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: How to install C::B on cygwin?
« Reply #11 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. :)
Be a part of the solution, not a part of the problem.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: How to install C::B on cygwin?
« Reply #12 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
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline cube1982

  • Single posting newcomer
  • *
  • Posts: 8
Re: How to install C::B on cygwin?
« Reply #13 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: How to install C::B on cygwin?
« Reply #14 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

« Last Edit: August 02, 2007, 08:15:51 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline cube1982

  • Single posting newcomer
  • *
  • Posts: 8
Re: How to install C::B on cygwin?
« Reply #15 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!
« Last Edit: August 03, 2007, 01:28:30 am by cube1982 »