Build from Source Linux: error sort is not a member of std.

CodeLite installation/troubleshooting forum
analog_G
CodeLite Curious
Posts: 3
Joined: Tue Jun 17, 2008 7:59 am
Contact:

Build from Source Linux: error sort is not a member of std.

Post by analog_G »

while attempting to build from source (svn r1690).
I receive an error from make.
LiteEditor/acceltabledlg.cpp: "sort" is not a member of "std"
after some simple googling, I tried to add "#include <algorithm>" to acceltabledlg.cpp. Now make continues past this file without error.
I am not very familiar with C++. Is there something I am missing?
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Build from Source Linux: error sort is not a member of std.

Post by eranif »

On which OS are you trying to build CodeLite?

I have built it under many OSs (including Linux, FreeBSD, Windows & Mac OS X) and I never encountered this error before, AFAIK sort *is* a member of std, unless you are using an old version of the std.
- What is the compiler version that you are using? (g++ --version)
- What OS?
- Please paste here the completed make error

Eran
Make sure you have read the HOW TO POST thread
dtranche
CodeLite Curious
Posts: 1
Joined: Tue Jun 17, 2008 2:57 pm
Contact:

Re: Build from Source Linux: error sort is not a member of std.

Post by dtranche »

Eran I saw the same thing, the following is the compile output
g++ -O3 -DREGEXP_UNICODE -Wall -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -fno-strict-aliasing -DASTYLE_LIB -DYY_NEVER_INTERACTIVE=1 -DGTK -DSCI_LEXER -DLINK_LEXERS -D__WX__ -ILiteEditor -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I./sdk/wxsqlite3/include -I./sdk/wxsqlite3/sqlite3/include -I./sdk/wxscintilla/include -I./sdk/wxscintilla/src/scintilla/include -I./sdk/wxscintilla/src/scintilla/src -I./Interfaces -I./Debugger -I./Plugin -I./CodeLite -I./sdk/wxflatnotebook/include -c LiteEditor/acceltabledlg.cpp -o Release_gcc_unicode/acceltabledlg.o
LiteEditor/acceltabledlg.cpp: In member function ‘void AccelTableDlg::PopulateTable()’:
LiteEditor/acceltabledlg.cpp:128: error: ‘sort’ is not a member of ‘std’
make: *** [Release_gcc_unicode/acceltabledlg.o] Error 1

besides acceltabledlg.cpp also gizmos.cpp and debuggergdb.cpp had the same errror. Adding #include <algorithm> to the file work

Also in compiling astyle.h there is a reference to strlen, which was not defined, I need to add #include <string.h> to that (maybe I could have done something different, but it was late)

This was run on Fedora Core 9, using
g++ -O3 -DREGEXP_UNICODE -Wall -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -fno-strict-aliasing -DASTYLE_LIB -DYY_NEVER_INTERACTIVE=1 -DGTK -DSCI_LEXER -DLINK_LEXERS -D__WX__ -ILiteEditor -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I./sdk/wxsqlite3/include -I./sdk/wxsqlite3/sqlite3/include -I./sdk/wxscintilla/include -I./sdk/wxscintilla/src/scintilla/include -I./sdk/wxscintilla/src/scintilla/src -I./Interfaces -I./Debugger -I./Plugin -I./CodeLite -I./sdk/wxflatnotebook/include -c LiteEditor/acceltabledlg.cpp -o Release_gcc_unicode/acceltabledlg.o
LiteEditor/acceltabledlg.cpp: In member function ‘void AccelTableDlg::PopulateTable()’:
LiteEditor/acceltabledlg.cpp:128: error: ‘sort’ is not a member of ‘std’
make: *** [Release_gcc_unicode/acceltabledlg.o] Error 1

Btw, it looks pretty nice and I'll play with it more the next couple of days.

Denis
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Build from Source Linux: error sort is not a member of std.

Post by eranif »

Ok, so it must be something environmental (Different OS / compiler), the fact that you are compiling it on FC9 - may imply something.

I compiled CL on FC6 8 months ago (all of the files that you mentioned, did not exist back then)

So, I it will great if you could send me list of files with list of missing headers, so I could fix it in the trunk ( I dont have access to FC )

WBR,
Eran
Make sure you have read the HOW TO POST thread
analog_G
CodeLite Curious
Posts: 3
Joined: Tue Jun 17, 2008 7:59 am
Contact:

Re: Build from Source Linux: error sort is not a member of std.

Post by analog_G »

Thanks for the replies,
I am experiencing basically the same issues as dtranche. (also had issues with gizmos, debugger, and astyle). I will try to including string.h and I'll let you know if I'm successful. I am building on Linux (archlinux) with g++ v4.3.0.
analog_G
CodeLite Curious
Posts: 3
Joined: Tue Jun 17, 2008 7:59 am
Contact:

Re: Build from Source Linux: error sort is not a member of std.

Post by analog_G »

thank you dtranche,
I added the line
#include <algoritm>
to acceltabledbg.cpp, gizmos.cpp, and debuggergdb.cpp.
I also added the line
#include <string.h>
to astyle.h
Now CodeLite will build successfully. When I tried to run CodeLight the first time I got an error that
libwx_gtk2u-2.8.so.0 could not be found in shared libraries.
my libwx_gtk2u-2.8 files are located in /usr/local/lib so I had to create a symlink:
> sudo ln -s /usr/local/lib/libwx_gtk2u-2.8.so.0 /usr/lib/libwx_gtk2u-2.8.so.0
Now I can run CodeLite in archlinux. Thanks.
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Build from Source Linux: error sort is not a member of std.

Post by eranif »

analog_G wrote:I added the line
#include <algoritm>
to acceltabledbg.cpp, gizmos.cpp, and debuggergdb.cpp.
I also added the line
#include <string.h>
to astyle.h
Thanks, I updated the SVN accordingly.

Eran
Make sure you have read the HOW TO POST thread
Post Reply