Issue
I'm trying to compile my project that has a library utilizing sstream using gcc with CodeLite. But for some reason the compiler can't find sstream fatal error :sstream: No such file or directory
CodeLite is using the same installation of gcc as Devc++ and TurboC++, Which have no problem compiling the same code.
Solution
In general, when asking such questions, its a good idea to also provide the build output from the Output View -> Build
tab of CodeLite.
Assuming your code is written correctly, I would guess that your file is named file.c
(change file
to the real file name here)
By default, CodeLite will invoke gcc
for .c
and g++
for the following file extensions:
cpp
.cxx
.cc
.c++
Make sure your file name extension is set to cpp
and not c
Alternatively (not recommended), you can change CodeLite settings and tell it to invoke g++
for either c
or c++
file.
This can be done from:
Settings -> Build Settings -> Compilers -> YOUR PROJECT COMPILER -> File Types tab
You will see there list of file extensions and the compile line using macros. For example for a c
file this is the line used by CodeLite:
$(CC) $(SourceSwitch) "$(FileFullPath)" $(CFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/$(ObjectName)$(ObjectSuffix) $(IncludePath)
You can double click the c
file entry and change $(CC)
into $(CXX)
(or copy the line from the cpp
entry)
Again, this is not recommended :)
Eran
Answered By - Eran