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!
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@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Hi Marcus,
thanks for your reply!
On 05/17/2014 05:47 PM, Marcus Hähnel wrote:
Do not forget to also link against libc_be_file_stdin (in the same way
as above) if you want to have keyboard interactions.
Adding libstdc++ to REQUIRES_LIBS works like a charm, but adding libc_be_file_stdin gives me the following error:
Library dependencies missing: libc_be_file_stdin in directory
'/home/hnr/l4re-core-2014022818/src/l4/pkg/examples/clntsrv'; aborting.
/home/hnr/l4re-core-2014022818/src/l4/mk/binary.inc:348: *** Cflags
dependencies missing: libc_be_file_stdin in directory '/home/hnr/l4re-core-2014022818/src/l4/pkg/examples/clntsrv'; aborting.. Stop.
I've executed (in l4 dir): make O=... oldconfig make O=... -j4
l4defs.mk.inc is located there, too.
What's wrong again?
Best regards, Valentin
Hi,
On 2014-05-19 18:16, Valentin Hauner wrote:
Adding libstdc++ to REQUIRES_LIBS works like a charm, but adding libc_be_file_stdin gives me the following error:
Library dependencies missing: libc_be_file_stdin in directory
'/home/hnr/l4re-core-2014022818/src/l4/pkg/examples/clntsrv'; aborting.
/home/hnr/l4re-core-2014022818/src/l4/mk/binary.inc:348: *** Cflags
dependencies missing: libc_be_file_stdin in directory '/home/hnr/l4re-core-2014022818/src/l4/pkg/examples/clntsrv'; aborting.. Stop.
The package can not be found because it is not currently checked out. You need to check out the libc_be_stdin package from the svn repository.
Do 'svn up libc_be_stdin' in the pkg/ directory. Then build the new package and you can link against it.
- Marcus
I've executed (in l4 dir): make O=... oldconfig make O=... -j4
l4defs.mk.inc is located there, too.
What's wrong again?
Best regards, Valentin
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
On 05/19/2014 08:00 PM, Marcus Hähnel wrote:
Do 'svn up libc_be_stdin' in the pkg/ directory. Then build the new
package and you can link against it.
Thanks, compiling and linking works fine now. But when running the application with qemu (either directly via 'make qemu E=... MODULE_SEARCH_PATH=...' or via Qemulator), it does not stop for user input but goes on to the next line of code.
Best regards, Valentin
Does anyone have an idea? I need to get it to work until next Monday.
Here, a similar problem is discussed, but no solution was found then: http://os.inf.tu-dresden.de/pipermail/l4-hackers/2014/006323.html
Best regards, Valentin
On 05/20/2014 11:11 AM, Valentin Hauner wrote:
On 05/19/2014 08:00 PM, Marcus Hähnel wrote:
Do 'svn up libc_be_stdin' in the pkg/ directory. Then build the new package and you can link against it.
Thanks, compiling and linking works fine now. But when running the application with qemu (either directly via 'make qemu E=... MODULE_SEARCH_PATH=...' or via Qemulator), it does not stop for user input but goes on to the next line of code.
Best regards, Valentin
On 2014-05-22 15:32, Valentin Hauner wrote:
Does anyone have an idea? I need to get it to work until next Monday.
Here, a similar problem is discussed, but no solution was found then: http://os.inf.tu-dresden.de/pipermail/l4-hackers/2014/006323.html
Sorry. Forgot to reply to the previous mail. Is this for a 64-bit or 32-bit system?
- Marcus
Best regards, Valentin
On 05/20/2014 11:11 AM, Valentin Hauner wrote:
On 05/19/2014 08:00 PM, Marcus Hähnel wrote:
Do 'svn up libc_be_stdin' in the pkg/ directory. Then build the new package and you can link against it.
Thanks, compiling and linking works fine now. But when running the application with qemu (either directly via 'make qemu E=... MODULE_SEARCH_PATH=...' or via Qemulator), it does not stop for user input but goes on to the next line of code.
Best regards, Valentin
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
l4-hackers@os.inf.tu-dresden.de