AH , tenia "Link an Objective C program: No", lo cambié a "Yes"
Y ahora solo me tira este error:
"cannot find -lobjc "
Y ahora solo me tira este error:
"cannot find -lobjc "
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCitar[Linker error] undefined reference to `UPNPNAT::init(int, int)'
[Linker error] undefined reference to `UPNPNAT::discovery()'
[Linker error] undefined reference to `UPNPNAT::add_port_mapping(char*, char*, unsigned short, unsigned short, char*)'
ld returned 1 exit status
C:\Users\...\Makefile.win [Build Error] [UPNP.dll] Error 1
#include "dll.h"
#include <windows.h>
export double AddPortMap()
{
UPNPNAT nat;
nat.init(5,10);
if(!nat.discovery())
{
return 0;
}
if(!nat.add_port_mapping("NewPort", "192.168.1.65", 1234, 1234, "TCP"))
{
return 0;
}
return 1;
}
#ifndef _DLL_H_
#define export extern "C" __declspec (dllexport)
#define _DLL_H_
#include <string>
#include <vector>
#pragma warning(disable: 4251)
#define DefaultTimeOut 10
#define DefaultInterval 200
class __declspec (dllexport) UPNPNAT
{
public:
bool init(int time_out=DefaultTimeOut,int interval=DefaultInterval); //init
bool discovery();//find router
/****
**** _description: port mapping name
**** _destination_ip: internal ip address
**** _port_ex:external: external listen port
**** _destination_port: internal port
**** _protocal: TCP or UDP
***/
bool add_port_mapping(
char * _description, char * _destination_ip, unsigned short int _port_ex,
unsigned short int _destination_port, char * _protocal);//add port mapping
const char * get_last_error(){ return last_error.c_str();}//get last error
private:
bool get_description(); //
bool parser_description(); //
bool tcp_connect(const char * _addr,unsigned short int _port);
bool parse_mapping_info();
int udp_socket_fd;
int tcp_socket_fd;
typedef enum
{
NAT_INIT=0,
NAT_FOUND,
NAT_TCP_CONNECTED,
NAT_GETDESCRIPTION,
NAT_GETCONTROL,
NAT_ADD,
NAT_DEL,
NAT_GET,
NAT_ERROR
} NAT_STAT;
NAT_STAT status;
int time_out;
int interval;
std::string service_type;
std::string describe_url;
std::string control_url;
std::string base_url;
std::string service_describe_url;
std::string description_info;
std::string last_error;
std::string mapping_info;
};
#endif /* _DLL_H_ */