User forums > Help

Trouble Complining CB with CB under Linux

(1/3) > >>

tigerbeard:
I am trying to compoile the current trunk under Linux using CB.

In the updated SVN sources I found two workspaces for UNIX, both having 3.0 in the name and rigged for 3.0. I did not see any 3.2 versions.

--- Code: --- CodeBlocks_wx30-unix.workspace
 ContribPlugins_wx30-unix.workspace
--- End code ---

I opened the first one CodeBlocks_wx30-unix.workspace and tried to compile the "All" target. The wxWidgets version was a repository installed "3.0-dev", so it should fit with the project settings with "3.0".

I got only into the first prokect "Code::Blocks wx3.0.x - Unix" and got strange compile errors I had not seen anywhere before (see below).
It compiled the TinyXML files and before linking them I get this "/bin/sh syntax error". I did not find out where a batch file comes into this compile process.

--- Code: ---g++ -Wall -std=c++11 -fPIC (invalid) -fmessage-length=0 -fexceptions -Winvalid-pch -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -DcbDEBUG -DCB_PRECOMP -iquote.objs30/include -I.objs30/include -I. -Isdk/wxscintilla/include -Iinclude/tinyxml -Iinclude/tinyxml -c /home/%USER/data/codeblocks_svn/trunk/src/base/tinyxml/tinyxmlparser.cpp -o .objs30/base/tinyxml/tinyxmlparser.o
/bin/sh: 1: Syntax error: "(" unexpected
Process terminated with status 2 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

--- End code ---

Does someone have successfully compiled CB from another CB in Linux recently?

To rule out that this might be connected to the wx3.0 version, I downloaded and installed wx3.2.4, installed it as root in /usr/bin and installed CB from the downloaded sources using the standard autotools approach.
The gave me a running and working CB with this spec

--- Code: ---Name                   : Code::Blocks
Version                : svn-r13403
SDK Version            : 2.25.0
Scintilla Version      : 3.7.5
Author                 : The Code::Blocks Team
E-mail                 : info@codeblocks.org
Website                : https://www.codeblocks.org
OS                     : Linux 4.15.0-213-generic x86_64
Scaling factor         : 1,000000
Detected scaling factor: 1,000000
Display PPI            : 96x96
Display count          : 1
Display 0              : XY=[0,0]; Size=[1920,1080]; Primary

wxWidgets Library (wxGTK port)
Version 3.2.4 (Unicode: wchar_t, debug level: 1),
compiled at Dec  9 2023 18:26:36

Runtime version of toolkit used is 3.22.
Compile-time GTK+ version is 3.22.30.
--- End code ---

Then I repeated the procedure with the newly and with the new "wx3.2" installed.
Result: the same errors.

Next I tried to set the project file to wx3.2 by changing the "build options/custom variables" to fit 3.2 as wxWidget version.
Same result.

So I am getting out of ideas. Any suggestions?

Thanks!

PS: The autotools would compile the trunk fine with wx3.0, but I got "undefined references" at runtime. The first I got was "UserVariableManager::ParseCommandLine" which in the sources I found in a libcodeblocks class. I did not see any unusual wxWidget code in there. I'd be interested to know the oldest compatible wxVersion to run CB (I do not care about optimizsations), because usually 3.2 is not part of the default repositories yet (e.g. the current UbuntuLTS 22.04 still ships with 3.0). I'd be much nicer w/o downloading and comiling wx manually. 

PPS: I checked the forum and wiki for info on Building CB with CB, The only section I found in the wiki was https://wiki.codeblocks.org/index.php/Installing_Code::Blocks#Working_on_Code::Blocks_sources_from_within_Code::Blocks.21. According to this it should work right out of the box.


Miguel Gimenez:

--- Code: ---/bin/sh: 1: Syntax error: "(" unexpected
--- End code ---
is due to the (invalid) parameter in the invocation of gcc:

--- Code: ---g++ -Wall -std=c++11 -fPIC (invalid) -fmessage-length=0...
--- End code ---
Review the compiler settings to see where this come from.

EDIT: Parts of UserVariableManager were moved around by r13245, may be related.

tigerbeard:
Thanks,I would not have seen that. Good to know next time I see a "/bin/sh" error.

The additional compiler flags showed that I did not set the GlobalVar

--- Code: ---$(#CB_RELEASE_TYPE)                   # cause of error. Was set by default to "(invalid)"

--- End code ---
I found that I could not set it to "" but " " worked.

I changed the the custom variables to this
 
--- Code: --- WX_VERSION = 32
 WX_CONFIG =/usr/local/bin/wx-config --version=3.2

--- End code ---
The default settings did not compile, I got compiler/linker errors like "double declaration" and "undefined symbols".

Now I still have an undefined ref from AUI in the wxSmith plugin, but the basic code run. Hopefully the last obstacle is the dialog "Cannot find resources..."

--- Code: ---Code::Blocks was configured to be installed in '/home/user/data/codeblocks_svn/trunk/src/devel30/share/codeblocks'.
Please use the command-line switch '--prefix' or set the CODEBLOCKS_DATA_DIR environment variable to point where Code::Blocks is installed,

--- End code ---

I tried both and keep getting the same dialog. Maybe again something stupid, but I am not getting it.

"/home/user/data/codeblocks_svn/trunk/src/devel30" has the codeblocks executable,
"/home/user/data/codeblocks_svn/trunk/src/devel30/share/codeblocks" only has the plugins SO's. 
Isn't then "/home/user/data/codeblocks_svn/trunk/src/devel30" the correct "point where Code::Blocks is installed"?

I tried to set "--prefix" and data dir but I keep getting the same Dialog and it would not start.

These are my start parameters

--- Code: ---
  /start parameters
   -ns -ni -v -p  --prefix="/home/user/data/codeblocks_svn/trunk/src/devel30"

   CODEBLOCKS_DATA_DIR in Settings/GlobalVariables
    /home/user/data/codeblocks_svn/trunk/src/devel30

--- End code ---

stahta01:
Did you run the correct "update" script to copy the resource and other files?

Edit2: likely update30 or update32

Tim S.

omlk:
maybe this is your case? As example on attached screenshot

Navigation

[0] Message Index

[#] Next page

Go to full version