2010-06-03 66 views
0

工作,我有這樣的代碼:與WCHAR用C

#include <stdio.h> 
#include <wchar.h> 

int main() 
{ 
    wchar_t *foo = L"ðħ"; 
    wprintf(L"[%ls]\n", foo);  return 0; 
} 

當我編譯它,它給我的implicit declaration of function ‘wprintf’警告。我知道我應該在編譯期間鏈接wchar庫,但我該怎麼做?

+0

您使用的編譯器是什麼? – 2010-06-03 21:04:45

+0

他的問題被標記爲GCC。 – Puppy 2010-06-03 21:09:07

+0

我想馬特想知道什麼版本的GCC。 – jmucchiello 2010-06-03 21:16:01

回答

3

您是否嘗試過使用-std = c99調用編譯器?

0

我在編譯程序時沒有收到任何警告。我在OS X上使用gcc版本4.2.1(Apple Inc. build 5646)(dot 1)。