Speaking only for myself,
Joe Durusau
Just a thought; try:
g++ -o test test.o -luuid
-- Fred
> Hi , please help me , I am using linux slakware 7 and egcs 2.91.66
> in my c++ program I want to use standard function -
> uuid_generate_random(unsigned char*) , from libuuid library , header -
> <uuid/uuid.h>
> when using it in C - it's ok , but when I use this function in equivalent
> C++ code - g++ COMPLAINS :
> tiger:~$ g++ -c test.cpp
> tiger:~$ g++ -luuid -o test test.o
> test.o: In function `main':
> test.o(.text+0xb): undefined reference to `uuid_generate_random(unsigned
> char *)
> Thanx in advance.
The header file is a pure C header file. You have to encapsluate it in an
extern "C" statement:
extern "C" {
#include <uuid/uuid.h>
}
Then the names will be correctly (de)mangeled.
Juergen
> Hi , please help me , I am using linux slakware 7 and egcs 2.91.66
> in my c++ program I want to use standard function -
> uuid_generate_random(unsigned char*) , from libuuid library , header -
> <uuid/uuid.h>
> when using it in C - it's ok , but when I use this function in equivalent
> C++ code - g++ COMPLAINS :
> tiger:~$ g++ -c test.cpp
> tiger:~$ g++ -luuid -o test test.o
> test.o: In function `main':
> test.o(.text+0xb): undefined reference to `uuid_generate_random(unsigned
> char *)
> Thanx in advance.
try wrapping the #include in extern "C" { ... }:
extern "C" {
#include <uuid/uuid.h>
}
--
Felix Natter