Help with std::locale

J

jalkadir

When compiling this progra, I get an error that reads:
***
Compiler : GNU GCC Compiler (called directly)
--------------------------------------------------------------------------------
..objs\exception.o(.bss+0x0):exception.cpp: multiple definition of
`jme::native_loc'
..objs\main.o(.bss+0x0):main.cpp: first defined here
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 4 seconds)
***

Can anybody please tell me what I am doing wrong?

TIA

/* I hope that this is not another shortcoming of GCC */

-- someheader.hpp
#include <locale>
namespace{
std::locale native_loc("");
}

-- main.cpp
int main(){
std::cout << jme::native_loc.name() << std::endl;
std::cout << "\a \a \a" << "Done..." << std::endl;
std::cin.get();

return 0;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,198
Latest member
JaimieWan8

Latest Threads

Top