Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Опубликовано:

1>d4rkl1ght.obj : error LNK2019: unresolved external symbol _closesocket@4 referenced in function _WinMain@16
1>d4rkl1ght.obj : error LNK2019: unresolved external symbol _recv@16 referenced in function _WinMain@16
1>d4rkl1ght.obj : error LNK2019: unresolved external symbol _send@16 referenced in function _WinMain@16
1>d4rkl1ght.obj : error LNK2019: unresolved external symbol _connect@12 referenced in function _WinMain@16
1>d4rkl1ght.obj : error LNK2019: unresolved external symbol _htons@4 referenced in function _WinMain@16
1>d4rkl1ght.obj : error LNK2019: unresolved external symbol _inet_addr@4 referenced in function _WinMain@16
1>d4rkl1ght.obj : error LNK2019: unresolved external symbol _WSACleanup@0 referenced in function _WinMain@16
1>d4rkl1ght.obj : error LNK2019: unresolved external symbol _socket@12 referenced in function _WinMain@16
1>d4rkl1ght.obj : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function _WinMain@16

 

there were various other errors with it , i solved most of them and when i finished WTF too many errors came UP , help me out with this

 

Program Source

 

// d4rkl1ght.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "d4rkl1ght.h"
#include 
#define NETWORK_ERROR -1
#define NETWORK_OK 0

int _stdcall WinMain(HINSTANCE hlinstance,HINSTANCE hPrevlinstance,LPSTR IpCmdLine,int nShowCmd) //Creating an Instance
{
MessageBox(0,L"\t v1.0.1 \nStarting Whois Lookup... \n Devloped And Maintained By |LuD KiLlEr|",L"d4rk l1ght",0);
WSADATA ws;
int nret;

//intialize Winsock
WSAStartup(0x0101,&ws);

//create socket
SOCKET comm;
comm=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(comm==INVALID_SOCKET)
{
	MessageBox(0,L"Failed to Create A Socket",L"Error!",0);
	WSACleanup();
	return NETWORK_ERROR;
}
SOCKADDR_IN serverinfo;
serverinfo.sin_family=AF_INET;
/*Whois IP whois.networksolutions.com */
serverinfo.sin_addr.s_addr=inet_addr("205.178.188.12");
serverinfo.sin_port=htons(43);
nret=connect(comm,(LPSOCKADDR)&serverinfo,sizeof(struct sockaddr));
if(nret==SOCKET_ERROR)
{
	MessageBox(0,L"Failed TO Connect TO Server",L"Error!!",0);
	WSACleanup();
	return NETWORK_ERROR;
}
char sbuffer[256]="fourdeltaone.net\r\n";
char rbuffer[5000];

nret=send(comm,sbuffer,strlen(sbuffer),0);
if(nret==SOCKET_ERROR)
{
	MessageBox(0,L"Could not Send Request TO Server ",L"Error!",0);
	WSACleanup();
	return NETWORK_ERROR;
}
nret=recv(comm,rbuffer,sizeof(rbuffer),0);
if(nret!=SOCKET_ERROR)
	MessageBox(0,(LPCWSTR)rbuffer,L"Whois Look Up Success",0);  //typecast char to LPCWSTR ...it doesnt accept char shows error find an alternate
closesocket(comm);
WSACleanup();
return NETWORK_OK;
}



 

i am new to Visual C++ .....:) know C++ so started with Sockets .

 

EDITi tried linking winsock.h but it shows

cannot open file 'winsock.h'

 

EDIT 2 : Solved that one too :? but now it shows some unwanted result ??

error.png

Featured Replies

Опубликовано:
  • Автор
you need the proper libs. either use #pragma comment(lib,"whatever winsock lib is called") or manually specify via project settings.

 

i did that that solved most part of it, but :) 1 more problem

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.