Home > Back-end >  There is a string, there are a number of characters, an input character, application remove the char
There is a string, there are a number of characters, an input character, application remove the char

Time:05-24

Compile program written completely in accordance with the book, but the result is wrong, I don't know where is wrong? Please everyone a great god

CodePudding user response:

Link error, guess, several files should be compiled separately and then build, you may not have compiled several other files,

CodePudding user response:

Have to let him have a connection between several files, otherwise it doesn't know where to find the statement as the function of external, no choice,

CodePudding user response:

Have been using extern al ah

CodePudding user response:

reference weixin_58044954 reply: 3/f
already with extern al ah
extern declarations in this file just for this a few function is external, told this a few function is not in the department, as for the outside the scope of it and I don't know?

CodePudding user response:

Several files must compile all the success to link generated exe program, your second four files, because there is no header file compiling failure, this kind of situation should be to correct compiler error,

CodePudding user response:

1. File2. CPP: should first # include & lt; Stdio. H> , otherwise the compilation fails, thus unable to generate enter_string symbol, will lead to the final link failure,
2. File4. CPP: should first # include & lt; Stdio. H> , otherwise the compilation fails, thus unable to generate print_string symbol, will lead to the final link failure,
3. Set when the project is set to Win32 or Windows applications? Should be set to the Console or a Console application, can appear otherwise can't find the WinMain function link errors,
  • Related