This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc vs g++ for dlopen


Hi Kolesar,

> when compiled this test program with:
> gcc -c test_library.c -o test_library1.o

Okay, looks good.

> g++ test_library1.o -o test_library1 -ldl

Why are you using g++?  Why are you not using gcc?

Do you need g++?  Unless there is more to your example than you are
providing (e.g., it's C++ source, not C source), it seems that g++ should
not be necessary here.

> but, when i build with:
> gcc -ldl test_library.c -o test_library

Why are you specifying -ldl out of order?

What happens when you do:
gcc test_library.c -o test_library -ldl

Does that make a difference?

You used g++ before.  Do you need g++?

g++ test_library.c -o test_library -ldl

Does that make a difference?

HTH,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]