Problem with function returning uuid_t

Apr 29, 2015 at 8:40pm
Can someone help me with this?

1
2
3
4
5
6
7
8
#include <uuid/uuid.h>

uuid_t getUuid() {
	uuid_t uuid;
	uuid_generate(uuid);

	return uuid;
}


../main.cpp:10:16: error: ‘getUuid’ declared as function returning an array
 uuid_t getUuid() {
                ^


Thanks in advance, Stefan
Last edited on Apr 29, 2015 at 8:42pm
Apr 30, 2015 at 8:23am
You cannot return an array. Provide the data like uuid_generate(...).

1
2
3
void getUuid(uuid_t &uuid) {
	uuid_generate(uuid);
}
May 1, 2015 at 12:48pm
Thank you for the answer. I have got a segmentation fault, but I have found another solution.

Stefan
Topic archived. No new replies allowed.