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;
}
***
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;
}