Example doesn't compile (MacOS)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- documentation
Research direction
Start by reproducing the linked zeromq.org C++ example in testprogram.cpp with the Homebrew libzmq 4.3.5 and cppzmq 4.10.0 versions and the shown compiler command. Compare the example's API usage with the installed headers; done means the published example compiles successfully on macOS.
Written by the indexing model from the issue text.
Description
The example program here:
#include <string>
#include <zmq.hpp>
int main()
{
zmq::context_t ctx;
zmq::socket_t sock(ctx, zmq::socket_type::push);
sock.bind("inproc://test");
const std::string_view m = "Hello, world";
sock.send(zmq::buffer(m), zmq::send_flags::dontwait);
}
Doesn't seem to compile, due to multiple errors:
g++ -I/opt/homebrew/Cellar/cppzmq/4.10.0/include -I/opt/homebrew/Cellar/zeromq/4.3.5_1/include testprogram.cpp -L/opt/homebrew/Cellar/zeromq/4.3.5_1/lib -lzmq
testprogram.cpp:6:33: error: no member named 'socket_type' in namespace 'zmq'; did you mean 'socket_t'?
zmq::socket_t sock(ctx, zmq::socket_type::push);
~~~~~^~~~~~~~~~~
socket_t
/opt/homebrew/Cellar/cppzmq/4.10.0/include/zmq.hpp:2181:7: note: 'socket_t' declared here
class socket_t : public detail::socket_base
^
testprogram.cpp:6:46: error: no member named 'push' in 'zmq::socket_t'
zmq::socket_t sock(ctx, zmq::socket_type::push);
~~~~~~~~~~~~~~~~~~^
testprogram.cpp:9:35: error: no member named 'send_flags' in namespace 'zmq'
sock.send(zmq::buffer(m), zmq::send_flags::dontwait);
~~~~~^
testprogram.cpp:9:19: error: no member named 'buffer' in namespace 'zmq'
sock.send(zmq::buffer(m), zmq::send_flags::dontwait);
~~~~~^
4 errors generated.
Platform details:
Platform: MacOS Ventura
Installed via: homebrew
zmq version: 4.3.5 (latest available)
cppzmq version: 4.10.0 (latest available)
- Dominant language
- C++
- Stars
- 2.3k
- Forks
- 799
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from zeromq/cppzmq
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Add CURVE default keys constantsPossibly taken @cacharle claimed this 255 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
-
Difficulty 1/5 Under an hour Newbie friendliness 15/100
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Similar issues
-
[request] vsg/1.1.16Openupstream update
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
conan-io/conan-center-index#31142 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
NVIDIA/DeepStream#78 ·