LNK:2019 Link Error Using C++ to compile C program
-
Am having difficulty getting C++ 2008 to LINK to the strcopy function. I get compiler errors on other function calls too, but they all get resolved by the linker .. all but strcopy. I am clueless .. here is the compiler/linker output. Thanks for looking. --Roger ----------------- 1>------ Build started: Project: GuessingGame, Configuration: Debug Win32 ------ 1>Compiling... 1>GuessingGame.c 1>r:\guessinggame\guessinggame\guessinggame.c(18) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(306) : see declaration of 'scanf' 1>r:\guessinggame\guessinggame\guessinggame.c(20) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(306) : see declaration of 'scanf' 1>r:\guessinggame\guessinggame\guessinggame.c(22) : warning C4013: 'time' undefined; assuming extern returning int 1>r:\guessinggame\guessinggame\guessinggame.c(26) : warning C4013: 'strcopy' undefined; assuming extern returning int 1>r:\guessinggame\guessinggame\guessinggame.c(39) : warning C4013: 'getch' undefined; assuming extern returning int 1>Linking... 1>GuessingGame.obj : error LNK2019: unresolved external symbol _strcopy referenced in function _main 1>R:\GuessingGame\Debug\GuessingGame.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://r:\GuessingGame\GuessingGame\Debug\BuildLog.htm" 1>GuessingGame - 2 error(s), 5 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
-
Am having difficulty getting C++ 2008 to LINK to the strcopy function. I get compiler errors on other function calls too, but they all get resolved by the linker .. all but strcopy. I am clueless .. here is the compiler/linker output. Thanks for looking. --Roger ----------------- 1>------ Build started: Project: GuessingGame, Configuration: Debug Win32 ------ 1>Compiling... 1>GuessingGame.c 1>r:\guessinggame\guessinggame\guessinggame.c(18) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(306) : see declaration of 'scanf' 1>r:\guessinggame\guessinggame\guessinggame.c(20) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(306) : see declaration of 'scanf' 1>r:\guessinggame\guessinggame\guessinggame.c(22) : warning C4013: 'time' undefined; assuming extern returning int 1>r:\guessinggame\guessinggame\guessinggame.c(26) : warning C4013: 'strcopy' undefined; assuming extern returning int 1>r:\guessinggame\guessinggame\guessinggame.c(39) : warning C4013: 'getch' undefined; assuming extern returning int 1>Linking... 1>GuessingGame.obj : error LNK2019: unresolved external symbol _strcopy referenced in function _main 1>R:\GuessingGame\Debug\GuessingGame.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://r:\GuessingGame\GuessingGame\Debug\BuildLog.htm" 1>GuessingGame - 2 error(s), 5 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
You could try removing the o from strcopy() :) "Undefined" warnings mean what they say - the compiler doesn't know how the symbol is defined. Check the documentation for each undefined function and make sure you're #including the header file containing the definition. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
You could try removing the o from strcopy() :) "Undefined" warnings mean what they say - the compiler doesn't know how the symbol is defined. Check the documentation for each undefined function and make sure you're #including the header file containing the definition. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
LOL ... <<huge BLUSH>> ... thanks for the 'o', Mark