2009年3月17日 星期二

[C++] error LNK2001: unresolved external symbol ___wargv

若你的專案混和了 C 和 C++ 的程式, 那你可能會遇到這個問題. 這個問題的發生原因可能是編譯順序的問題. 下面是最笨的解決方法.

 

If your project mixed C and C++ codes (or files), this error message maybe appear. The following steps solved my problem.

        error LNK2001: unresolved external symbol ___wargv 
        error LNK2001: unresolved external symbol ___argc

<sol>
//         Step 1: Goto Solution Explorer at the right tab
//         Step 2: Remove (not Delete!) the C source file. ex: abc.c
//         Step 3: Rebuild the project (yes, you will get linking error)
//         Step 4: Again, add back the abc.c in your solution. (from Solution Explorer),
                             and rebuild the project again.

//         or

//          Step 1: Goto Solution Explorer at the right tab
//          Step 2: Re-add the C source file. (Yes, I know. It has alread exist in the solution)
//          Step 3: Rebuild again.

 

 

by Jing (井民全)

沒有留言:

張貼留言