multiple definition of `__start__Z

mytest/lib/libtest.a(utils.r): In function `__stop__ZN9__gnu_cxx13new_allocatorISt4pairIKSsSsEE9constructEPS3_RKS3_':
/local/jsn/utils/Buffer.cpp:159: multiple definition of `__start__ZnwjPv'
collect2: ld returned 1 exit status

I have a class Buffer contained only static methods as follow

File: Buffer.h
class Buffer{
....
static int foo();
....
};

File: Buffer.cpp
...
int Buffer::foo(){
...
}

Could some one explain what this means?

1. `__stop__'
2. multiple definition of `__start__ZnwjPv' What does __start imply?

Thanks
Make sure your Buffer.h file has the following structure:
1
2
3
4
5
6
7
8
9
#pragma once
#ifndef BUFFER_H
#define BUFFER_H

class Buffer {
  ...
};

#endif 

Let us know if that does not solve your problem. (There are other, more obscure, reasons it could happen.)
Buffer.h already has "prama once", but still having the same error
Last edited on
Topic archived. No new replies allowed.