我昨天问了同样的问题,答案不适用.
如果我进入类标题,右键单击该函数并单击"转到定义",这使我在我的其他.CPP文件中使用了我的函数.它看到它,可以链接到它,但我仍然得到错误,表明我看不到它.
有人有什么建议吗?我会尝试任何事情.
这是错误.
zdll.lib(d000050.o):警告LNK4078:
'.text'找到具有不同属性的多个部分(E0300020)WLD.obj:错误LNK2019:
"public: void __thiscall WLD::fragment_03(unsigned char *,int)" (?fragment_03@WLD@@QAEXPAEH@Z)函数中引用的未解析的外部符号"public: bool __thiscall WLD::init(unsigned char *)" (?init@WLD@@QAE_NPAE@Z)
编辑:另外,我正在使用MSVC++.我应该尝试创建新解决方案并导入文件吗?可能会有所帮助,因为我觉得我没有选择......
编辑:这是代码:
#include "WLD.h"
inline void WLD::fragment_03(uchar* location, int frag_num)
{
// Read the struct into memory and create a temporary pointer
struct_frag03 temp03;
memcpy(&temp03, location, sizeof(struct_frag03));
uchar* temp_p = location;
// Advance the pointer to the encoded bytes (filename)
temp_p += sizeof(long) + sizeof(short);
// Grab the encoded filename and decode it
uchar* …Run Code Online (Sandbox Code Playgroud)