Visual C++6.0でいくつかの古いコードをコンパイルしようとしています。DSWファイルが見つからなかったため、すべてのコードを新しいワークスペースに追加しています。
私は次のように持ってa.cpp
います
#include "vld.h"
#include "afx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include "b.h"
...
void function_1(char* string1)
{
char buf[2000];
strcpy_s(&buf[0], 2000, string1);
strcat_s(&buf[0], 2000, "_append");
...
}
fopen_s, strncpy_s, strncat_s
inなどの他の関数も使用さa.cpp
れます。
そしてb.h
_
#include <stdio.h>
#include <string.h>
char function_2(unsigned char * string2, int abc, int def)
{
char buf2[200];
sprintf_s(buf2, 200, "abcdef");
strcat_s(buf2, 200, "ghijkl");
}
すでにとを持っているにもかかわらずstdio.h
、string.h
私はまだエラーが発生します
'sprintf_s': undeclared identifier
'strcat_s': undeclared identifier
'strcpy_s': undeclared identifier
'fopen_s': undeclared identifier
'strncpy_s': undeclared identifier
'strncat_s': undeclared identifier
a.cpp
との両方b.h
。
省略した設定がありませんか?なぜこれらのエラーが発生するのですか?