Code::Blocks Forums

User forums => Help => Topic started by: MasterAlexei on March 13, 2013, 12:36:18 pm

Title: [Solved]Problem Building CB on Linux Mageia 64 bit
Post by: MasterAlexei on March 13, 2013, 12:36:18 pm
Hello all,
I did search the forum and in Google too about the problem, and did try all the solutions, but nothing helps me to build CB.

I get error:
Code
*** Warning: Linking the shared library libcodeblocks.la against the
*** static library /opt/wxWidgets/lib/libwx_gtk2u-2.8.a is not portable!
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../lib64/crti.o /usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/crtbeginS.o  .libs/annoyingdialog.o .libs/autodetectcompilers.o .libs/base64.o .libs/blockallocated.o .libs/cbauibook.o .libs/cbcolourmanager.o .libs/cbdebugger_interfaces.o .libs/cbeditor.o .libs/cbeditorprintout.o .libs/cbexception.o .libs/cbplugin.o .libs/cbproject.o .libs/cbstatusbar.o .libs/cbstyledtextctrl.o .libs/cbthreadpool.o .libs/cbtreectrl.o .libs/cbworkspace.o .libs/compileoptionsbase.o .libs/compiler.o .libs/compilercommandgenerator.o .libs/compilerfactory.o .libs/compileroptions.o .libs/compiletargetbase.o .libs/configmanager-revision.o .libs/configmanager.o .libs/configurationpanel.o .libs/configuretoolsdlg.o .libs/confirmreplacedlg.o .libs/crc32.o .libs/debuggermanager.o .libs/editarrayfiledlg.o .libs/editarrayorderdlg.o .libs/editarraystringdlg.o .libs/editkeywordsdlg.o .libs/editor_hooks.o .libs/editorbase.o .libs/editorcolourset.o .libs/editorconfigurationdlg.o .libs/editorlexerloader.o .libs/editormanager.o .libs/editpairdlg.o .libs/editpathdlg.o .libs/edittooldlg.o .libs/encodingdetector.o .libs/externaldepsdlg.o .libs/filefilters.o .libs/filegroupsandmasks.o .libs/filemanager.o .libs/findreplacedlg.o .libs/genericmultilinenotesdlg.o .libs/globals.o .libs/importers_globals.o .libs/incrementalselectlistdlg.o .libs/infowindow.o .libs/loggers.o .libs/logmanager.o .libs/macrosmanager.o .libs/managedthread.o .libs/manager.o .libs/menuitemsmanager.o .libs/multiselectdlg.o .libs/newfromtemplatedlg.o .libs/personalitymanager.o .libs/pipedprocess.o .libs/pluginmanager.o .libs/pluginsconfigurationdlg.o .libs/printing_types.o .libs/projectbuildtarget.o .libs/projectdepsdlg.o .libs/projectfile.o .libs/projectfileoptionsdlg.o .libs/projectlayoutloader.o .libs/projectloader.o .libs/projectloader_hooks.o .libs/projectmanager.o .libs/projectoptionsdlg.o .libs/projectsfilemasksdlg.o .libs/projecttemplateloader.o .libs/scriptingmanager.o .libs/scriptsecuritywarningdlg.o .libs/scrollingdialog.o .libs/sdk_events.o .libs/searchresultslog.o .libs/selecttargetdlg.o .libs/templatemanager.o .libs/toolsmanager.o .libs/uservarmanager.o .libs/virtualbuildtargetsdlg.o .libs/workspaceloader.o .libs/xtra_res.o .libs/CharDistribution.o .libs/JpCntx.o .libs/LangBulgarianModel.o .libs/LangCyrillicModel.o .libs/LangGreekModel.o .libs/LangHebrewModel.o .libs/LangHungarianModel.o .libs/LangThaiModel.o .libs/nsBig5Prober.o .libs/nsCharSetProber.o .libs/nsEscCharsetProber.o .libs/nsEscSM.o .libs/nsEUCJPProber.o .libs/nsEUCKRProber.o .libs/nsEUCTWProber.o .libs/nsGB2312Prober.o .libs/nsHebrewProber.o .libs/nsLatin1Prober.o .libs/nsMBCSGroupProber.o .libs/nsMBCSSM.o .libs/nsSBCharSetProber.o .libs/nsSBCSGroupProber.o .libs/nsSJISProber.o .libs/nsUniversalDetector.o .libs/nsUTF8Prober.o  -Wl,--whole-archive scripting/bindings/.libs/libsqbindings.a scripting/sqplus/.libs/libsqplus.a scripting/sqstdlib/.libs/libsqstdlib.a scripting/squirrel/.libs/libsquirrel.a ../base/tinyxml/.libs/libtinyxml.a wxscintilla/.libs/libwxscintilla.a wxpropgrid/.libs/libwxpropgrid.a -Wl,--no-whole-archive  -L/opt/wxWidgets/lib -L/usr/lib64 -lX11 /opt/wxWidgets/lib/libwx_gtk2u-2.8.a -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lgmodule-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lXinerama -lXxf86vm -lSM -lpng -ljpeg -ltiff -lwxregexu-2.8 -lz -lpthread -ldl -L/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3 -L/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/crtfastmath.o /usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/crtendS.o /usr/lib/gcc/x86_64-mageia-linux-gnu/4.6.3/../../../../lib64/crtn.o  -O2 -pthread -Wl,--export-dynamic -pthread   -pthread -Wl,-soname -Wl,libcodeblocks.so.0 -o .libs/libcodeblocks.so.0.0.1
/usr/bin/ld: /opt/wxWidgets/lib/libwx_gtk2u-2.8.a(monolib_appbase.o): relocation R_X86_64_32S against `vtable for wxMessageOutputStderr' can not be used when making a shared object; recompile with -fPIC
/opt/wxWidgets/lib/libwx_gtk2u-2.8.a: could not read symbols: Bad value
I did try to build the SVN Rev 8909, wxWidgets are 2.8.12
the configure command for CB:
Quote
./configure --with-contrib-plugins=all,-help CPFLAGS='-fPIC'
The configure command for wxWidgets:
Quote
./configure --prefix=/opt/wxWidgets --enable-monolithic  --disable-shared --enable-aui --enable-propgrid LDFLAGS='-L/usr/lib64 -lX11' CPFLAGS='-fPIC' --with-regex=builtin --enable-unicode
The output of wx-config --list
Quote
 Default config is gtk2-unicode-release-static-2.8

  Default config will be used for output

Does any one knows the solution of the problem?

Thanks in advance,

Alexey
Title: Re: Problem Building CB on Linux Mageia 64 bit
Post by: stahta01 on March 13, 2013, 01:06:47 pm
"gtk2-unicode-release-static-2.8"

I believe Code::Blocks requires dynamic version of wxWidgets; instead of static version.

Why did you use this option "--disable-shared"?

Note: I believe "--enable-monolithic" is suggested; but, not required for Linux CB Builds.

Links to read http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks)
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux)

Tim S.
Title: Re: Problem Building CB on Linux Mageia 64 bit
Post by: MasterAlexei on March 13, 2013, 01:43:50 pm
Quote
I believe Code::Blocks requires dynamic version of wxWidgets; instead of static version.
sorry, your are right. I did mixed it with monolithic.

But the problem was, that I did have more builds of wxWidgets, and the dynamic monolith was there too, but build process did not see it. It builds now, when I did removed all other builds of wxWidgets, and build only one monolithic shared. Seems that CB build process does not like more than one build of wxW. in system.

Regards,

Alexey
Title: Re: [Solved]Problem Building CB on Linux Mageia 64 bit
Post by: stahta01 on March 13, 2013, 01:51:06 pm
All you need to do is select the correct wx-config is seen; you did not have to remove the other wxWidgets.

Finally found the common method for Linux Users.
http://forums.wxwidgets.org/viewtopic.php?f=19&t=18164 (http://forums.wxwidgets.org/viewtopic.php?f=19&t=18164)

Tim S.