小编Ric*_*ris的帖子

错误:'zmq'尚未声明

在构建/编译时,我收到此错误:

C:\Ethe\main.cpp: In function 'int main()':
C:\Ethe\main.cpp:11:4: error: 'zmq' has not been declared
C:\Ethe\main.cpp:11:19: error: expected ';' before 'context'
C:\Ethe\main.cpp:12:4: error: 'zmq' has not been declared
C:\Ethe\main.cpp:12:18: error: expected ';' before 'socket'
C:\Ethe\main.cpp:14:4: error: 'zmq' has not been declared
Run Code Online (Sandbox Code Playgroud)

main.cpp中:

#include <zmq.h>
#include <iostream>
#include <string>

int main()
{
   std::string tip;
   std::cout << "Enter Target IP: ";
   std::cin >> tip;

   zmq::context_t context (1);
   zmq::socket_t socket (context, ZMQ_REQ);
   std::cout << "Connecting to " << tip << std::endl;
   zmq::socket.connect ("tcp://"+tip+":5555");

   return 0; …
Run Code Online (Sandbox Code Playgroud)

c++ compilation declaration build zeromq

1
推荐指数
1
解决办法
2028
查看次数

标签 统计

build ×1

c++ ×1

compilation ×1

declaration ×1

zeromq ×1