Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. LNK:2019 Link Error Using C++ to compile C program

LNK:2019 Link Error Using C++ to compile C program

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++visual-studiodebugging
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IceWater42
    wrote on last edited by
    #1

    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 ==========

    M 1 Reply Last reply
    0
    • I IceWater42

      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 ==========

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      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:

      I 1 Reply Last reply
      0
      • M Mark Salsbery

        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:

        I Offline
        I Offline
        IceWater42
        wrote on last edited by
        #3

        LOL ... <<huge BLUSH>> ... thanks for the 'o', Mark

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups