libmsg.so depends on libnet.so. I want to load two libraries at the same time, but this will cause errors.
dynlib only allows one library.
proc create_message*(version: cint) {.cdecl, importc, dynlib: "libnet.so libmsg.so".}
Just load libmsg.so and get the address of the symbols that you need.
If libmsg.so depends on libnet.so then the OS loader (ld) should load automatically libnet.so if libmsg.so is implicitly linked with libnet.so (you can check the .dynamic section of libmsg.so with readelf (readelf -d libmsg.so | grep NEEDED) or use ldd to see its dynamic dependencies (ldd libmsg.so)).
If libmsg.so is not implicitly linked with libnet.so then libmsg.so should load libnet.so explicitly.