Hej
Jeg har nu fået compilet en lille fil, der bruger lidt sockets, men nu får
jeg bare disse to fejl, selvom at programmet kompilere fint nok:
[Linker error] undefined reference to `htons@4'
[Linker error] undefined reference to `inet_addr@4'
Koden er som følger:
#include <cstdlib>
#include <iostream>
#include <map>
#include <fstream>
#include <winsock2.h>
#include <cstdio>
#include <string>
#include "connect.h"
int main(int argc, char *argv[])
{
int _socketfd;
typedef struct sockaddr_in socket;
socket address;
address.sin_family = AF_INET;
address.sin_port = htons(110);
address.sin_addr.s_addr = inet_addr("mail.dht.dk");
ofstream file("irclog.txt",ios::out);
if(file.bad()){
cerr << "An error occured!" << endl;
exit(0);
}
else{
// try to connect here
}
file.close();
cout << endl;
system("PAUSE");
}
mvh.
Mads
--
Mads Jensen
http://www.ddfr.dk Dansk Donaldist-Forening