致命错误LNK1120:1个未解析的外部c ++

时间:2014-03-03 18:31:55

标签: c++ visual-c++ fatal-error

#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdio.h>
#include <iostream>

using namespace std;


SOCKET socketOne, socketTwo;

int main()
{
socketOne = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
}

尝试学习winsock套接字编程,无论你想要什么,当我尝试创建一个套接字时会弹出这个错误。提前谢谢。

此外,这是完整的错误消息:

1>------ Build started: Project: Hmwk.1.Assignment, Configuration: Debug Win32 ------
1>hmwk.1.obj : error LNK2019: unresolved external symbol "void __cdecl loadBackground(class            std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int &,int *     const,int * const)" (?loadBackground@@YAXV?$basic_string@DU?$char_traits@D@std@@V?    $allocator@D@2@@std@@AAHQAH2@Z) referenced in function _SDL_main
1>hmwk.1.obj : error LNK2019: unresolved external symbol "void __cdecl randomPlayer(int &,int     &,int &,int,int,int)" (?randomPlayer@@YAXAAH00HHH@Z) referenced in function _SDL_main
1>C:\Users\tmars_000\Desktop\Fall 2014\Intro to Game     Prog\Hmwk.1.Released\Debug\Hmwk.1.Assignment.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

0 个答案:

没有答案