Hi Francesco,

There are a bunch of samples in user/cxxtest.

These should show how to set up build lines for building c++ apps with STLport (which is the standard C library used in the uClinux- dist). But these are broken at the moment - I'll send a patch in later.

This is what you need to do.

Step 1
You need to make sure that you are building STLport, this is in libs/ STLport and is enabled by selecting Build STLport in the Library Configuration of the vendor/user settings.

STLPort needs to be built statically at the moment (i'll fix it soon) so you'll need turn off 'build shared'.

Step 2
Add the location of the STLport includes to the build line in your makefile. The location for the header files is found in the variable -I$(STL_INCDIR). the lib files are found in -L$(STL_LIBDIR)

Step 3
The whole thing mind end up looking like this:

EXE1 = cxx_helloworld

CCOBJS1=helloworld.o

CXXFLAGS += -I$(STL_INCDIR)
CXX_LDFLAGS += -L$(STL_LIBDIR)

all: $(EXE1)

$(EXE1): $(CCOBJS1)
        $(CXX) $(CXX_LDFLAGS) -o $@ $(CCOBJS1) $(LIBM) $(CXXLIBS)

romfs:
        $(ROMFSINST)  /bin/$(EXE1)

clean:
        rm -f *.o $(EXE1) *.gdb

I Hope this helps

Regard,

Matt

On 07/02/2007, at 8:54 PM, Francesco Lodi wrote:

Hi all!
I am trying to use the c++ string class within an application I am writing for
a uClinux system.
The code is the classic:

#include <strings>

std::string myString;

I am using the arm-linux toolchain from snapgear and I have those errors:

string: No such file or directory
error: `string' is not a member of `std'

does this mean that the c++ string class is not supported by the uClinux
compiler? Or maybe it is a Makefile problem?
I am compiling using uclinux-front- and this is my simple makefile rule:

$(EXEC): $(OBJS)
        $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS) -lpthread -lstdc++

Thanks and best regards!
Francesco
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


---
WorkWare Systems Pty Ltd
W: www.workware.net.au
P: +61 434 916 185
F: +61 7 3102 9221
E: [EMAIL PROTECTED]



_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to