cirosantilli/cpp-cheat

how to have a executable in cpp-cheat/shared_library/basic/

Closed this issue · 3 comments

I tried to change the make file but it doesn't work. I want to have an executable instead of a library file.

I don't understand, why do you expect to get an executable from the shared_library directory, which is basically one of the only directories in this project that generates libraries and not executables?

cd shared_library/basic
make

does produce a few executables for me on Ubuntu 21.10, e.g. maina.out, mainso.out and mainso_fullpath.out.

Since it was a c training, I was trying to make an executable that uses dlopen inside itself.

OK. Didn't https://github.com/************/cpp-cheat/blob/master/shared_library/basic/dlopen.c work? Just worked for me. Gotta run as:

LD_LIBRARY_PATH=`pwd` ./dlopen.out