error LNK2019: unresolved external symbol "int __cdecl subMain(unsigned char *)"

  • Thread starter Thread starter Stan Huang at Taiwan
  • Start date Start date
S

Stan Huang at Taiwan

Guest
I has a subMain() function at sub.c, which was added by me to VC++2019 MFC project. It's from Linux. I called subMain() from an action routine of a button. I built it and got the below error message. CmqtestDlg::OnBnClickedOk(void) is the action routine of the button defined at VC++2019.

In the beginning of , I added one line "extern int subMain(unsigned char* ip);"

1>------ Build started: Project: mqtest, Configuration: Debug x64 ------
1>sub.c
1>mqtestDlg.obj : error LNK2019: unresolved external symbol "int __cdecl subMain(unsigned char *)" (?subMain@@YAHPEAE@Z) referenced in function "public: void __cdecl CmqtestDlg::OnBnClickedOk(void)" (?OnBnClickedOk@CmqtestDlg@@QEAAXXZ)
1> Hint on symbols that are defined and could potentially match:
1> subMain
1>D:\programs\mqtest\mqtest\x64\Debug\mqtest.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "mqtest.vcxproj" -- FAILED.

Continue reading...
 
Back
Top