Doing simple I/O in clntsrv example

Marcus Hähnel mhaehnel at os.inf.tu-dresden.de
Mon May 19 13:06:49 CEST 2014


https://os.inf.tu-dresden.de/pipermail/l4-hackers/2014/006453.html
https://os.inf.tu-dresden.de/pipermail/l4-hackers/2014/006454.html

- Marcus

On 2014-05-19 10:18, Valentin Hauner wrote:
> Hi!
> 
> I'm having some trouble with doing simple I/O actions in the clntsrv
> example (/src/l4/pkg/examples/clntsrv).
> I want the client to enter minuend and subtrahend himself, so I've 
> added
> the following code to client.cc:
>> printf("Please enter minuend and subtrahend: \n");
>> l4_uint32_t val1, val2;
>> std::cin >> val1 >> val2;
> 
> iostream is included at the beginning of the file.
> 
> However, the linker has some serious problems:
>> ==> Linking ex_clntsrv-client
>> client.o: In function `main':
>> 
> /home/hnr/l4re-core-2014022818/src/l4/pkg/examples/clntsrv/client.cc:60:
> undefined reference to `std::cin'
>> 
> /home/hnr/l4re-core-2014022818/src/l4/pkg/examples/clntsrv/client.cc:60:
> undefined reference to `std::istream::operator>>(int&)'
>> 
> /home/hnr/l4re-core-2014022818/src/l4/pkg/examples/clntsrv/client.cc:60:
> undefined reference to `std::istream::operator>>(int&)'
>> client.o: In function `__static_initialization_and_destruction_0':
>> /home/hnr/l4reb/include/contrib/libstdc++-v3/iostream:72: undefined
> reference to `std::ios_base::Init::Init()'
>> /home/hnr/l4reb/include/contrib/libstdc++-v3/iostream:72: undefined
> reference to `std::ios_base::Init::~Init()'
>> make[1]: *** [ex_clntsrv-client] Error 1
>> make: *** [/home/hnr/l4reb/pkg/examples/clntsrv/OBJ-x86_586-l4f] 
>> Error 2
> 
> I did not change the Makefile, so g++ is used for compiling (and not
> gcc). I've added
>> CXX_FLAGS = -lstdc++
> but that doesn't help.
> 
> I'm using update-alternatives to have different versions of g++
> installed simultaneously. Currently, the link points to g++-4.7. But
> using g++-4.4 does not solve the problem either.
> 
> Thanks in advance for support!
> 
> _______________________________________________
> l4-hackers mailing list
> l4-hackers at os.inf.tu-dresden.de
> http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers




More information about the l4-hackers mailing list