News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Compile CodeBlocks by Cygwin

Started by PetrPetrov, November 05, 2013, 06:34:00 PM

Previous topic - Next topic

PetrPetrov

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.


stahta01

#31
I am trying this Configure Command for wxWidgets (wxGTK) (I am using wx 2.8 SVN Branch)

../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.

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

./bootstrap
export CXXFLAGS="-DWXMAKINGDLL_SCI -Wno-attributes"
./configure



Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

PetrPetrov

Sorry, I did not run ./bootstrap never....

Petr@WS4 /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?

oBFusCATed

Quote from: PetrPetrov on November 07, 2013, 06:13:12 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!]

PetrPetrov

my output is:

Petr@WS4 ~
$ 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


PetrPetrov

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:
__attribute__ ((dllexport)) int fn(int a)
{
  return a + 19;
}


and compile it by libtool (just wrapper for gcc)
libtool --mode=compile gcc -shared -c a.cpp

now I am trying to get libtest.dll or libtest.la
$ 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?

oBFusCATed

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!]

PetrPetrov

Thank you very much!

Now I manually copied wxwin.m4 into local codeblocks source folder, and added
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.

oBFusCATed

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!]

stahta01

#39
Quote from: oBFusCATed 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?

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.
export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

PetrPetrov

Bingo!
I have compiled plugins as shared libraries:

PetrPetrov

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.

stahta01

#42
Quote from: PetrPetrov 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.

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

PetrPetrov

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.