User forums > Help
[Solved] Unable to build Code::Blocks under Kubuntu 17.04
cacb:
With reference to http://forums.codeblocks.org/index.php/topic,22122.msg150567.html#msg150567
I have been trying to build Code::Blocks from https://github.com/obfuscated/codeblocks_sf
Under Kubuntu 17.04 but the build fails:
Following the BUILD instructions, I did
$ git clone https://github.com/obfuscated/codeblocks_sf
$ cd codeblocks_sf/
$ ./bootstrap
$ ./configure --with-contrib-plugins=all
$ make
After a while, the linking fails
../../src/sdk/scripting/sqstdlib/libsqstdlib.la -lpthread -ldl
*** Warning: Linking the shared library libcodeblocks.la against the
*** static library /usr/local/lib/libwx_gtk2u_aui-3.0.a is not portable!
*** Warning: Linking the shared library libcodeblocks.la against the
*** static library /usr/local/lib/libwx_gtk2u_propgrid-3.0.a is not portable!
and at the end
/usr/bin/ld: /usr/local/lib/libwx_gtk2u_aui-3.0.a(auilib_framemanager.o): relocation R_X86_64_PC32 against symbol `_ZN14wxAuiRectArray5EmptyEv' 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
Makefile:851: recipe for target 'libcodeblocks.la' failed
make[3]: *** [libcodeblocks.la] Error 1
make[3]: Leaving directory '/ssd1/obfuscated/codeblocks_sf/src/sdk'
Makefile:1011: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/ssd1/obfuscated/codeblocks_sf/src/sdk'
Makefile:541: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/ssd1/obfuscated/codeblocks_sf/src'
Makefile:615: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
I am guessing this happens because I have a static lib version of wx-3.0 that I have built and use with my own code. But if this is the problem, how can I tell the Code::Blocks build to ignore it?
Any advice appreciated.
EDIT:
I am trying a modified configure which seems to work better:
./configure --with-contrib-plugins=all --with-wx-config=/usr/bin/wx-config
cacb:
Well, after changing the configure as shown, everything seems to compile. However, when I then try
$ sudo make install
This fails:
--- Code: ---/bin/mkdir -p '/usr/local/lib/codeblocks/plugins'
/bin/bash ../../../libtool --mode=install /usr/bin/install -c libAstyle.la '/usr/local/lib/codeblocks/plugins'
libtool: [color=red]warning[/color]: relinking 'libAstyle.la'
libtool: install: (cd /ssd1/obfuscated/codeblocks_sf/src/plugins/astyle; /bin/bash "/ssd1/obfuscated/codeblocks_sf/libtool" --tag CXX --mode=relink g++ -O2 -ffast-math -Winvalid-pch -fPIC -fexceptions -module -shared -version-info 0:1:0 -no-undefined -avoid-version -Wl,--no-undefined -o libAstyle.la -rpath /usr/local/lib/codeblocks/plugins asstreamiterator.lo astyleconfigdlg.lo astyleplugin.lo dlgformattersettings.lo formattersettings.lo astyle/ASBeautifier.lo astyle/ASEnhancer.lo astyle/ASFormatter.lo astyle/ASResource.lo ../../sdk/libcodeblocks.la -L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_aui-3.0 -lwx_gtk2u_propgrid-3.0 -lwx_gtk2u_richtext-3.0 -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 -lpthread -ldl )
libtool: relink: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginS.o .libs/asstreamiterator.o .libs/astyleconfigdlg.o .libs/astyleplugin.o .libs/dlgformattersettings.o .libs/formattersettings.o astyle/.libs/ASBeautifier.o astyle/.libs/ASEnhancer.o astyle/.libs/ASFormatter.o astyle/.libs/ASResource.o -L/usr/local/lib -lcodeblocks -L/usr/lib/x86_64-linux-gnu -lwx_gtk2u_aui-3.0 -lwx_gtk2u_propgrid-3.0 -lwx_gtk2u_richtext-3.0 -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 -lpthread -ldl -L/usr/lib/gcc/x86_64-linux-gnu/6 -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/6/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/6/crtfastmath.o /usr/lib/gcc/x86_64-linux-gnu/6/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o -O2 -Wl,--no-undefined -pthread -pthread -Wl,-soname -Wl,libAstyle.so -o .libs/libAstyle.so
/usr/bin/ld: /usr/local/lib/libwx_baseu-3.0.a(baselib_threadinfo.o): relocation R_X86_64_TPOFF32 against `_ZZN12_GLOBAL__N_117GetThisThreadInfoEvE16s_thisThreadInfo' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libwx_gtk2u_xrc-3.0.a(xrclib_xmlres.o): relocation R_X86_64_PC32 against symbol `_ZN12wxFileSystemC1Ev' 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
libtool: [color=red]error[/color]: error: relink 'libAstyle.la' with the above command before installing it
Makefile:585: recipe for target 'install-pluginlibLTLIBRARIES' failed
make[5]: *** [install-pluginlibLTLIBRARIES] Error 1
make[5]: Leaving directory '/ssd1/obfuscated/codeblocks_sf/src/plugins/astyle'
Makefile:853: recipe for target 'install-am' failed
make[4]: *** [install-am] Error 2
make[4]: Leaving directory '/ssd1/obfuscated/codeblocks_sf/src/plugins/astyle'
Makefile:692: recipe for target 'install-recursive' failed
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory '/ssd1/obfuscated/codeblocks_sf/src/plugins/astyle'
Makefile:531: recipe for target 'install-recursive' failed
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory '/ssd1/obfuscated/codeblocks_sf/src/plugins'
Makefile:541: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/ssd1/obfuscated/codeblocks_sf/src'
Makefile:615: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
--- End code ---
Again it seems my local wx-3.0 static build got in the way. But why does this happen under install?? And how to fix?
oBFusCATed:
Please use code or quote tags when pasting long logs.
What wx version are you using? I'm 100% sure that using the default one coming with ubuntu works fine.
And please use --prefix=/something/not/usr/local to save yourself the trouble you're in!
cacb:
--- Quote from: oBFusCATed on September 12, 2017, 08:32:38 pm ---Please use code or quote tags when pasting long logs.
--- End quote ---
Ok, sorry.
--- Quote from: oBFusCATed on September 12, 2017, 08:32:38 pm ---What wx version are you using? I'm 100% sure that using the default one coming with ubuntu works fine.
And please use --prefix=/something/not/usr/local to save yourself the trouble you're in!
--- End quote ---
I am indeed trying to build code::blocks against the default one coming with ubuntu, but it fails. I have another wx-30 installed under /usr/local/include/wx-3.0 and /usr/local/lib, but this is NOT to be used when compiling Code::Blocks, only with my own applications using wx. I thought this would be enough:
./configure --with-contrib-plugins=all --with-wx-config=/usr/bin/wx-config
so the --prefix=/something/not/usr/local you are mentioning, is that with make install then?
oBFusCATed:
Putting stuff in /usr/local is not really recommended. I have no idea why the autotools guys have decided to use it as default. It has caused lots of pain all over the world.
The prefix parameter should be passed to configure. And you should do it for everything you build with autotools. If you use the default then you won't be able to clean the files when you need to (because you'll have multiple different packages in a single prefix) and you'll end up with messed up system.
I guess the problem happens because the search paths of the compiler have /usr/local/include or /usr/local/lib before the system paths or something is mixed up...
I suppose the only way to fix this is by deleting everything in /usr/local .
I don't use /usr/local except for linking paths to binaries and I don't suffer from such problems... :)
p.s. if you're not doing development of codeblocks the best option is to build deb packages. It will take you an hour to learn how to do it, but after that you'll save tons of time, because the builds done with the deb builder are way more reliable than doing it manually.
Navigation
[0] Message Index
[#] Next page
Go to full version