作者Kanyahi (狼爵々)
看板C_and_CPP
標題[問題] C++ 編譯時遇到的變數轉換錯誤
時間Tue Apr 26 17:50:42 2016
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++ 6.0
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
已經載入下列函數庫
#include <sstream>
#include <iostream>
#include <string>
#include <stdio.h>
#include "windows.h"
#include "mq.h"
#include "tchar.h"
#include "wchar.h"
問題(Question):
原始碼是從VS2010複製過來的
在VS2010可以正常編譯
但在VC++ 6.0編譯發生以下錯誤訊息
已上網查過必要載入函數庫
並沒有解決,
不知道是還有其他函數庫沒有載入
還是環境配置上要設定
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/QgClsAco
顯示56行 error C2065: '_snwprintf_s' : undeclared identifier
http://codepad.org/kZFqZ1IV
顯示6行 error C2065: 'CT2CA' : undeclared identifier
補充說明(Supplement):
還請各位先進不吝指教,謝謝
如果有違背版規的地方,請告知,會立即修改
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.248.200.131
※ 文章網址: https://webptt.com/m.aspx?n=bbs/C_and_CPP/M.1461664246.A.AF9.html
※ 編輯: Kanyahi (60.248.200.131), 04/26/2016 17:51:39
1F:→ kiedveian: #include <windows.h> ? 04/26 21:05
第一個code是send MSMQ
所以會用到windows.h 所以才加入
在想會不會是因為大小寫的關係?
※ 編輯: Kanyahi (220.129.51.245), 04/26/2016 21:51:28
2F:→ james732: google找那兩個東西,應該能找到需要加入哪些.h檔吧? 04/26 22:34
3F:推 TeaEEE: 這二個應該是uni-code,Vc6有支援uni-code嗎? 04/27 13:03
4F:→ colako: VC6沒_s,試試改用_snwprintf,不輸入dwBufferLength? 04/27 13:50
5F:→ colako: 沒有CT2CA macro...就自己想別的辦法轉嘍? 04/27 13:51
CT2CA 我有想到可能是因為VC6沒支援的關係 所以已經改了
改成_snwprintf有出現
cannot convert parameter 3 from 'unsigned long' to 'const unsigned short *'
把原本的第二個參數dwBufferLength刪掉就可以了
感謝回覆的幾位先進幫忙
※ 編輯: Kanyahi (60.248.200.131), 04/27/2016 14:34:52