Open wzhsunn opened 7 years ago
Have you installed the library on your system? (make install
)
@dermesser I have the same issue and I installed the library on my system.
Are you sure that the library is in a place that the linker can find it, i.e. in your LDPATH?
@dermesser I did "ldconfig" command as well. C library is working fine when I write in c language and compile with gcc. But when I tried to use C++ library or C library with c++ language while compiling with g++, it doesn't work.
Just to make sure, I also tried both of -lsocket++ and -lsocket as well.
I can't reproduce the issue; on my system it links and runs well. Do you have more information?
I cannot understand...... after a few days, the compiling suddenly work properly......
By the way, how can I use C library in C++?
so is it working or is it not?
for the C library from C++, you can try this:
extern "C" {
#include <libsocket/libinetsocket.h>
}
and then use the symbols normally.
I made a very very huge mistake..... I made put my -lsocket in front of the source code names in Makefile. This is why Makefile doesn't work.
This is quite embarrassing but I'll leave it for other people.
ah well, I didn't see it either :)
os info: