S
stenasc
Hi,
I have created an C based application in linux that uses a number of
dlls. Within the dlls themselves, the code calls sub functions e.g
dll_1 (Main dll function is called Return_Answer. The code within the
Return_Answer function called another function called Timer which is
in dll_1)
dll2 (Main dll function is called Calculate_Best_Result. The code
within the Calculate_Best_Result function called another function
called Timer which is in dll_2)
The Timer functions in each dll are completely different. However,
when I debug dll_1 in gdb, and am stepping through the code, I see
that it jumps to the dll_2 Timer function instead of it's own.
Anyone got any ideas. I have the same code working fine in MSVC. Never
had a problem with it. The commands, I use to compile and link to the
main executable are...
gcc -ggdb -c -fPIC dll_1.c
gcc -ggdb -shared -o libdll_1.so dll_1.o
gcc -ggdb -c -fPIC dll_2.c
gcc -ggdb -shared -o libdll_2.so dll_2.o
The main code file is called test.c
gcc -ggdb -c test.c
gcc -o test -lm test.o -L. -ldll_1 -ldll_2 -ldl
Everything compiles and links fine, so I am at a loss. Any help is
much appreciated.
Regards
Bob
I have created an C based application in linux that uses a number of
dlls. Within the dlls themselves, the code calls sub functions e.g
dll_1 (Main dll function is called Return_Answer. The code within the
Return_Answer function called another function called Timer which is
in dll_1)
dll2 (Main dll function is called Calculate_Best_Result. The code
within the Calculate_Best_Result function called another function
called Timer which is in dll_2)
The Timer functions in each dll are completely different. However,
when I debug dll_1 in gdb, and am stepping through the code, I see
that it jumps to the dll_2 Timer function instead of it's own.
Anyone got any ideas. I have the same code working fine in MSVC. Never
had a problem with it. The commands, I use to compile and link to the
main executable are...
gcc -ggdb -c -fPIC dll_1.c
gcc -ggdb -shared -o libdll_1.so dll_1.o
gcc -ggdb -c -fPIC dll_2.c
gcc -ggdb -shared -o libdll_2.so dll_2.o
The main code file is called test.c
gcc -ggdb -c test.c
gcc -o test -lm test.o -L. -ldll_1 -ldll_2 -ldl
Everything compiles and links fine, so I am at a loss. Any help is
much appreciated.
Regards
Bob