Handling---> Error LNK2019: unresolved external symbols "~ ~ ~ ~" | The symbol "~ ~ ~" is referenced in the function _main

Source: Internet
Author: User

Handling---> Error LNK2019: unresolved external symbols "~ ~ ~ ~" | The symbol "~ ~ ~" is referenced in the function _main

--------------------------------------------------------------------------------------------------------------- -----------------

First Spit: Brother-in-law! Learning data structure (C language description), I thought you can not use the vc6++ ugly and incompetent IDE, this time to replace vs feel more comfortable, not many or encountered a little bumps, a bit annoying.

--------------------------------------------------------------------------------------------------------------- -----------------

In fact, C language to run the compilation mechanism I do not understand.

This two-day request to write a data structure job, in order to achieve interface and implementation of separation, the requirements structure is as follows:

Statement of the structure and operation method of the LinkList.h containing the linked list

Details of linklist.c containing linked list operation methods

MAIN.C main function file, including methods for linked list operations

--------------------------------------------------------------------------------------------------------------- -----------------

Internal code does not paste ....

Main.c include "LinkList.h"

LINKLIST.C because you need to reference the list, also include "LinkList.h"

--------------------------------------------------------------------------------------------------------------- -----------------

C language Compilation process reference here, http://mcuos.com/thread-3793-1-1.html

The approximate compilation process on the above four processes: precompiled, compile, assemble, link.

So here's the "wrong error LNK2019" on the link process bar.

The function declaration is always found in the main function, but the definition of the function is not found.

Grandma's, this year Google always failed, the Niang really do not give force. Most of the days have no clue.

Really two, then change the file name on the OK.

Linklist.c-->-changed to "LinkList.cpp"

MAIN.C---> Changed to "main.cpp"

Compile through ~.

--------------------------------------------------------------------------------------------------------------- -----------------

It's not effective to refer to other people's methods. For example, these few:

Method one change project properties

Right Key Item "Properties"-"Configuration Properties"-"linker"-"System" change "subsystem" to "Windows (/subsys:windows)"

Method two adds the statement #pragma comment (lib, "Ws2_32.lib") to the header file to explicitly load.

That

#include <winsock2.h>
#pragma comment (lib, "Ws2_32")

--------------------------------------------------------------------------------------------------------------- -----------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.