I have created a program consisting of a zeromq client (in C), like so:
I installed libzmq-nc on my OpenWrt router (18.0.2) and libzmq on my computer.
However, when I compile the C file on my computer (same architecture as the router: x86_64) and transfer the executable to the router, even after giving permissions for execution (chmod +x), the terminal tells me:
root@OpenWrt:~# ./zmq_client
-ash: ./zmq_client: not found
So, I thought that maybe I should use the SDK to compile this program of mine. Inside the SDK folder, I created a folder under "packages" named "zeromq_client", with the following Makefile:
and a "src" folder inside that "zeromq_client" folder, that contained the source (.C file - my program) and the Makefile presented next:
# build helloworld executable when user executes "make"
zmq_client: zmq_client.o
$(CC) $(LDFLAGS) zmq_client.o -lzmq -o zmq_client
zmq_client.o: zmq_client.c
$(CC) $(CFLAGS) -c zmq_client.c
# remove object files and executable when user executes "make clean"
clean:
rm *.o zmq_client
I did all this following some tutorials on the Internet. The only thing that is different in my solution is the name of the package in the Makefiles, which I changed to the name of my own and I added a link to the -lbzmq library in the third line of the above Makefile.
When I run "make -j1 V=s", it results in errors:
Does anyone have a clue on what the problem could be? It's not that I need to cross-compile, as the architectures are the same. I don't know if it might be a problem with the Makefile structure, or maybe the way I'm linking the libzmq...
This is a program I can compile on my computer (I've tested the Makefile inside the src and the program executes without errors). Also, none of the the lines of the error above mention my program, I'm confused.
Note: 3 of the outputs were too long and I couldn't get them to format here quickly, so I used pastebin.