Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: archman007 on March 16, 2019, 09:53:33 pm

Title: Installing from Source Code
Post by: archman007 on March 16, 2019, 09:53:33 pm
Compiling from svn trunk source I get this error.


/usr/bin/ld: /usr/local/lib/libwx_gtk3u_aui-3.1.a(auilib_framemanager.o): relocation R_X86_64_PC32 against symbol `_ZN17wxAuiManagerEvent12ms_classInfoE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:939: libcodeblocks.la] Error 1
make[3]: Leaving directory '/home/archman/devel/codeblocks-code/src/sdk'
make[2]: *** [Makefile:1105: all-recursive] Error 1
make[2]: Leaving directory '/home/archman/devel/codeblocks-code/src/sdk'
make[1]: *** [Makefile:543: all-recursive] Error 1
make[1]: Leaving directory '/home/archman/devel/codeblocks-code/src'
make: *** [Makefile:674: all-recursive] Error 1
archman@archman-B360M-DS3H:~/devel/codeblocks-code$ \

Here is my configuration.

*************************************************
* Code::Blocks source tree has been configured. *
*************************************************

You can now build Code::Blocks by issuing 'make'.
When the build is complete, become root and install
it by issuing 'make install'.

   CFLAGS:     -fPIC -fPIC -std=c90
   CXXFLAGS:    -Winvalid-pch -fPIC -fexceptions
   CPPFLAGS:   -DCB_AUTOCONF  -DCB_PRECOMP -DPIC -I$(top_srcdir)/src/include/tinyxml -DTIXML_USE_STL=YES
   LDFLAGS:    -Wl,--no-undefined
   CXX:        g++
   CC:         gcc

archman@archman-B360M-DS3H:~/devel/codeblocks-code$

I would like to move on to make install but I cannot.
Thanks a ton folks.
Title: Re: Installing from Source Code
Post by: oBFusCATed on March 16, 2019, 11:12:56 pm
Most probably you're trying to use a statically build wxgtk.
Why are you trying to use a self-build wxgtk? Why don't you use the system package?
Title: Re: Installing from Source Code
Post by: archman007 on March 17, 2019, 03:43:32 am
Where are the code blocks system packages?  The ones I have tried are busted also.  Need version 17.xx.  The 16.xx version is janky!
Title: Re: Installing from Source Code
Post by: oBFusCATed on March 17, 2019, 08:07:44 am
It seems that you've built yourself wxgtk instead of installing wxgtk-dev and using those. On debian there is an easy way to create packages. Search the internet how to do it. Or inspect our travis file for the commands needed to build a package: https://github.com/obfuscated/codeblocks_sf/blob/master/.travis.yml
Title: Re: Installing from Source Code
Post by: archman007 on March 17, 2019, 01:36:30 pm
Reply oBufsCATed

WxWidgets version 3.1 is loaded and operational.  wxWidgets is not the problem here.
Title: Re: Installing from Source Code
Post by: oBFusCATed on March 17, 2019, 02:51:33 pm
wxWidgets is not the problem here.
I hope you'll find the time later to update this topic when you find out that it is in fact the problem. :)
Title: Re: Installing from Source Code
Post by: stahta01 on March 17, 2019, 11:42:17 pm
What does wx list return?
Code
wx-config --list
Title: Re: Installing from Source Code
Post by: archman007 on March 18, 2019, 12:29:31 am
Here is the output to

archman@archman-B360M-DS3H:~/codeblocks/codeblocks-code$ wx-config --list

    Default config is gtk3-unicode-static-3.1

  Default config will be used for output

Now what do you say is the problem?
Title: Re: Installing from Source Code
Post by: oBFusCATed on March 18, 2019, 12:45:48 am
gtk3-unicode-static-3.1
Title: Re: Installing from Source Code
Post by: tigerbeard on March 19, 2019, 12:33:35 pm
Where are the code blocks system packages?  The ones I have tried are busted also.  Need version 17.xx.  The 16.xx version is janky!

Buidling CodeBlocks itself under Linux is easy. The tricky part is to get wxWidgets Prerequisite right. I found the best resource to be this https://github.com/bluehazzard/codeblocks_sf/wiki/build_linux_mint_18

Its very detailed. If you go though that and compare with what you already have done, you might see what is still missing.
From that description I have successfully build V17.01 based on wxGTK 2.8.12 on a Debian based system (was not Mint).


 
Title: Re: Installing from Source Code
Post by: oBFusCATed on March 19, 2019, 07:31:13 pm
The tricky part is to get wxWidgets Prerequisite right.
This statement is wrong. Checking out wx-master and building with almost default settings gives you perfectly fine wxgtk which could be used for C::B. You have to just use non-default prefix and also pass --with-wx-config which points to this non default prefix.
Title: Re: Installing from Source Code
Post by: sodev on March 19, 2019, 08:02:56 pm
Can't confirm that for CentOS 7. To get a fairly standard build with

Code
./configure --libdir=/usr/local/lib64 --with-gtk=3 --with-cxx=11 --enable-ipv6 --disable-compat30 --disable-unsafe_conv_in_wxstring

i had an extensive try-and-error to figure out the following missing packages:

Code
gtk3-devel
webkitgtk3-devel
libX11-devel
libXinerama-devel
libXxf86vm-devel
libXtst-devel
libSM-devel
mesa-libGL-devel
mesa-libGLU-devel
libsecret-devel
libnotify-devel
cairo-devel
gstreamer1-devel
gstreamer1-plugins-base-devel

Without these i either got hard errors or soft warnings about missing components.
Title: Re: Installing from Source Code
Post by: oBFusCATed on March 19, 2019, 08:12:15 pm
For centos there is wxgtk-devel. For ubuntu libwxgtk-dev. Today I've compiled wx-master on a clean ubuntu just by installing libgtk-3-dev...
Title: Re: Installing from Source Code
Post by: tigerbeard on March 20, 2019, 12:02:07 am
The tricky part is to get wxWidgets Prerequisite right.
This statement is wrong. Checking out wx-master and building with almost default settings gives you perfectly fine wxgtk which could be used for C::B. You have to just use non-default prefix and also pass --with-wx-config which points to this non default prefix.


Well, I think its not wrong. I have been referring to wxGtk2.8.12. As its a good idea to install that to a non default folder According to BlueHazzrads notes (which worked for me) , you need to patch the configure file , manually, change PATH, edit /etc/ld.so.conf, optionally temporarily purge an old libwxgtk3.0, and do the normal install stuff. At least that counts as tricky for me.  8)

If you have a 3 liner (or whatever liner) working in a clean Ubuntu, as you say would you mind to post it?
Title: Re: Installing from Source Code
Post by: oBFusCATed on March 20, 2019, 12:18:43 am
https://github.com/obfuscated/codeblocks_sf/blob/master/.travis.yml

Doing the steps from this file will give you installable .deb files...It lists all the deps and at the bottom you have the two commands that you have to execute to get them.
Title: Re: Installing from Source Code
Post by: tigerbeard on March 20, 2019, 11:03:32 am
https://github.com/obfuscated/codeblocks_sf/blob/master/.travis.yml

Doing the steps from this file will give you installable .deb files...It lists all the deps and at the bottom you have the two commands that you have to execute to get them.

Nice. I always learn interesting stuff here. Was not aware that C::B uses "Trevis" for continuous integration (just new Jenkins). Guessing from the file syntax I understood that you mean this (Debian style Linux)

Code
# installation on Debian systems
 [unpack tar.gz sources and go into that folder]
$ apt install libwxgtk3.0-dev libboost-system-dev fakeroot debhelper cdbs libgtk2.0-dev libgamin-dev libboost-dev libhunspell-dev
$ ./bootstrap
$ ./debian/setup_control.sh 
$ dpkg-buildpackage -us -uc
cd ..
sudo apt remove codeblocks
sudo apt install ./codeblocks_20.03svn0_amd64.deb ./codeblocks-common_20.03svn0_all.deb ./libcodeblocks0_20.03svn0_amd64.deb ./codeblocks-dev_20.03svn0_amd64.deb ./codeblocks-headers_20.03svn0_all.deb ./*wx*.deb

Thats dead esay C::B buid. Doesn't address the libwxgtk2.X-dev, though.

Title: Re: Installing from Source Code
Post by: sodev on March 20, 2019, 07:44:08 pm
For centos there is wxgtk-devel. For ubuntu libwxgtk-dev.
Nice trick to install the system library to get the requirements, but at least on CentOS 7 this is still wxWidgets 2.8.12 which might not depend on everything that newer releases do. Plus i didn't want the system library on my system.

Quote
Today I've compiled wx-master on a clean ubuntu just by installing libgtk-3-dev...
I don't know the situation on Ubuntu, but me too could get wxWidgets to compile with less than my listed dependencies, but then the configure script spills out warnings about disabling certain components because of missing requirements.