Author Topic: Compile CodeBlocks by Cygwin  (Read 27292 times)

Offline PetrPetrov

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Compile CodeBlocks by Cygwin
« Reply #30 on: November 07, 2013, 08:37:16 am »
Also I have standard Windows distribution of C::B, it shows Windows OS in About dialog.
Note that C::B compiled by Cygwin shows 'Linux' OS in About dialog.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 6671
    • My Best Post
Re: Compile CodeBlocks by Cygwin
« Reply #31 on: November 07, 2013, 04:34:13 pm »
I am trying this Configure Command for wxWidgets (wxGTK) (I am using wx 2.8 SVN Branch)
Code: [Select]
../configure --enable-unicode --with-libjpeg=builtin --with-regex=builtin --without-msw --with-gtk --prefix=/opt/wx/2.8 --enable-monolithic  --disable-universal --without-gtkprint --without-gnomeprint --enable-tooltips --enable-dnd --enable-shared

These options --without-gtkprint --without-gnomeprint helped build in the past using wxWidgets SVN trunk (2.9) .

I am nearly certain "--enable-shared" is required for a wxWidgets able to be used by Code::Blocks.
I decided to try "--enable-unicode" this option because this will reduce the patches needed by Code::Blocks it has about 3 places ANSI code needs fixed the last time I did an ANSI build (about 1 year ago.)
I used "--with-libjpeg=builtin" because two years ago; the version of libjpeg in CygWin caused issues.
I used "--with-regex=builtin" because the other poster in this thread commented out code that using this option might NOT need done.

I got the below displayed before I did make; it is still running make.
Code: [Select]
Configured wxWidgets 2.8.12 for `i686-pc-cygwin'

  Which GUI toolkit should wxWidgets use?                 GTK+ 2
  Should wxWidgets be compiled into single library?       yes
  Should wxWidgets be compiled in debug mode?             no
  Should wxWidgets be linked as a shared library?         yes
  Should wxWidgets be compiled in Unicode mode?           yes
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.4      no
                                       wxWidgets 2.6      yes
  Which libraries should wxWidgets use?
                                       jpeg               builtin
                                       png                sys
                                       regex              builtin
                                       tiff               builtin
                                       zlib               sys
                                       odbc               no
                                       expat              sys
                                       libmspack          no
                                       sdl                no

I set CXXFLAGS="-Wno-attributes" before running make to reduce the warnings in hope it speeds up the build. Edit: It made no difference in building. Will try next time setting it before the configure command.

wxWidgets is still building.

The command I plan to try on Code::Blocks boot/configure
Code: [Select]
./bootstrap
export CXXFLAGS="-DWXMAKINGDLL_SCI -Wno-attributes"
 ./configure


Tim S.
« Last Edit: November 07, 2013, 05:35:24 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 PetrPetrov

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Compile CodeBlocks by Cygwin
« Reply #32 on: November 07, 2013, 06:13:12 pm »
Sorry, I did not run ./bootstrap never....

Code: [Select]
[email protected] /usr/src/codeblocks-12.11release8629
$ ./bootstrap
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
aclocal:configure.in:79: warning: macro `AM_OPTIONS_WXCONFIG' not found in library
aclocal:configure.in:80: warning: macro `AM_PATH_WXCONFIG' not found in library
Useless use of /d modifier in transliteration operator at /usr/share/automake-1.9/Automake/Wrap.pm line 60.
configure.in:79: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.in:80: error: possibly undefined macro: AM_PATH_WXCONFIG

wxWidgets is not installed property?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12121
    • Travis build status
Re: Compile CodeBlocks by Cygwin
« Reply #33 on: November 07, 2013, 06:33:00 pm »
wxWidgets is not installed property?
What is the output of "wx-config --cflags --libs" in your console?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline PetrPetrov

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Compile CodeBlocks by Cygwin
« Reply #34 on: November 07, 2013, 06:45:06 pm »
my output is:

Code: [Select]
[email protected] ~
$ wx-config --cflags --libs
-I/usr/local/lib/wx/include/gtk2-ansi-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DWXUSINGDLL -D__WXGTK__
-L/usr/local/lib    -lwx_gtk2-2.8

Offline PetrPetrov

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Compile CodeBlocks by Cygwin
« Reply #35 on: November 07, 2013, 06:48:27 pm »
I am worrying that problem in my Cygwin system.
It seems that libtool utility always create static libraries.

I have created small test project:
1. Wrote small a.cpp file the following content:
Code: [Select]
__attribute__ ((dllexport)) int fn(int a)
{
  return a + 19;
}

and compile it by libtool (just wrapper for gcc)
Code: [Select]
libtool --mode=compile gcc -shared -c a.cpp
now I am trying to get libtest.dll or libtest.la
Code: [Select]
$ libtool --mode=link gcc -shared -g -O -o libtest.la a.lo
libtool: link: rm -fr .libs/libtest.a .libs/libtest.la .libs/libtest.lai
libtool: link: ar cru .libs/libtest.a .libs/a.o
libtool: link: ranlib .libs/libtest.a
libtool: link: ( cd ".libs" && rm -f "libtest.la" && ln -s "../libtest.la" "libtest.la" )

I have specified -shared option.
What I am doing wrong?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12121
    • Travis build status
Re: Compile CodeBlocks by Cygwin
« Reply #36 on: November 07, 2013, 06:49:03 pm »
Hm, then do you have wx.m4 file or something like this where AM_PATH_WXCONFIG or AM_OPTIONS_WXCONFIG are defined?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline PetrPetrov

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Compile CodeBlocks by Cygwin
« Reply #37 on: November 07, 2013, 06:52:35 pm »
Thank you very much!

Now I manually copied wxwin.m4 into local codeblocks source folder, and added
Code: [Select]
m4_include(wxwin.m4)at begin of configure.in...

However, it does not matter... libcompiler.a is still created...
I think that libcompiler.dll should be created to allow codeblocks.exe to load this plugin and able to create new projects....
Please see my post above about libtool problem.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12121
    • Travis build status
Re: Compile CodeBlocks by Cygwin
« Reply #38 on: November 07, 2013, 07:07:16 pm »
Can't help on libtool issues, because I don't understand it, sorry.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6671
    • My Best Post
Re: Compile CodeBlocks by Cygwin
« Reply #39 on: November 07, 2013, 08:30:28 pm »
Hm, then do you have wx.m4 file or something like this where AM_PATH_WXCONFIG or AM_OPTIONS_WXCONFIG are defined?

IIRC, I followed the steps suggested in URL to get past this error in the past.
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux

I likely did something based on this line.
Code: [Select]
export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"

Tim S
« Last Edit: November 07, 2013, 08:32:11 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 PetrPetrov

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Compile CodeBlocks by Cygwin
« Reply #40 on: November 07, 2013, 10:37:34 pm »
Bingo!
I have compiled plugins as shared libraries:

Offline PetrPetrov

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Compile CodeBlocks by Cygwin
« Reply #41 on: November 11, 2013, 06:49:38 pm »
Unfortunately, Code::Blocks does not work properly, I can create new 'Console' project in C++.
But gcc compiler is not invocaled from Code::Blocks.

Any ideas?

P.S.: I have specified paths for compiler toolchain, gcc.exe, g++.exe etc.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6671
    • My Best Post
Re: Compile CodeBlocks by Cygwin
« Reply #42 on: November 11, 2013, 09:00:23 pm »
Unfortunately, Code::Blocks does not work properly, I can create new 'Console' project in C++.
But gcc compiler is not invocaled from Code::Blocks.

Any ideas?

P.S.: I have specified paths for compiler toolchain, gcc.exe, g++.exe etc.

Other than the standard answer, no.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

What path did you use? A windows or a CygWin path?
Because, I have no idea which is more likely to work.

Tim S.
« Last Edit: November 11, 2013, 09:03:06 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 PetrPetrov

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Compile CodeBlocks by Cygwin
« Reply #43 on: July 08, 2015, 01:51:16 pm »
Sorry for the long delay.

As I can remember I specified Linux path (like /bin/gcc.exe or like /usr/bin/gcc.exe, /usr/bin/g++.exe etc).
I'll have a chance to compile it again in near future, maybe Cygwin was improved as well as C::B.