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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • swkr

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

    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.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    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.

    Comment

    Working...