|
-
July 13th, 2011, 03:43 AM
#1
Converting a C Program to Compile with C++
I've got an old project written in C and I changed the project to compile with the C++ compiler. All modules were renamed .CPP and the /TP flag is set in the Advanced Options to compile as C++.
I thought I would take advantage of the more robust C++ compiler.
I'm getting a number of LNK2019 and LNK2001 errors. Here are a couple of examples:
Code:
Filer3_321.obj : error LNK2019: unresolved external symbol "short __cdecl CheckDupLists(struct HWND__ *,char *,void * *,short)" (?CheckDupLists@@YAFPAUHWND__@@PADPAPAXF@Z) referenced in function "short __cdecl MergeListFile(char *,char *,struct HWND__ *)" (?MergeListFile@@YAFPAD0PAUHWND__@@@Z)
Listsup4_321.obj : error LNK2001: unresolved external symbol "short __cdecl CheckDupLists(struct HWND__ *,char *,void * *,short)" (?CheckDupLists@@YAFPAUHWND__@@PADPAPAXF@Z)
Listsup3_32.obj : error LNK2001: unresolved external symbol "short __cdecl CheckDupLists(struct HWND__ *,char *,void * *,short)" (?CheckDupLists@@YAFPAUHWND__@@PADPAPAXF@Z)
I also don't know why the compiler is adding a 1 to the end of the file name when creating the object file. The CPP file for the first example is filer3_32.cpp. I cleaned out all the old OBJ files before recompiling. That's not a major issue if the whole thing links OK.
CheckDupLists is in another module in the program that is included in the project. Each module that calls CheckDupLists has an extern declaration for the function. I have double checked and the extern declaration exactly matches the function definition.
The C version compiled without any issues. This should be obvious, I've figured these out before, but this one has me stumped. Any ideas?
Bill
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|