By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,191 Members | 1,064 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,191 IT Pros & Developers. It's quick & easy.

Error in C++ on linux: error: uninitialized const in 'new' of 'const TCHAR'

P: n/a
I have the following code.

const TCHAR * pTemp = X->Fn(index);

X is an object of a class and Fn is a method in it which returns a const TCHAR *.

Building this in Windows is fine, but not in linux.
It throws an error as follows.
error: uninitialized const in 'new' of 'const TCHAR'

Please help me resolve the issue.
Oct 23 '10 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
I didn't know you could use TCHAR in linux.

TCHAR is a Windows prop to switch between ASCII/Unicode based on a compiler setting.

If you are attemptiong to port code from Windows tio Linux, I would find a library that does these ooncersion for you.

Linux uses char and wchar_t where Windows uses TCHAR.
Oct 23 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.