This is the mail archive of the 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]

Re: what is equivilant to dll in linux writes:

>  HI all
> i had the code of a program written in VC++
> it consist of exe file and many dll files
> how can i port this to LINUX ..

The equivalent (roughly) of a DLL is a shared library.

To make one, be sure to have gcc documentation handy. Any reasonable
distribution should have it. Try

info gcc 

from the commandline to get the standalone info browser, or

Control-h i

in emacs.

> how to compile

You must compile your C files position-independently. For example,

gcc -g -fPIC -o file.o -c file.c


g++ -g -fPIC -o file.o -c file.c

(depends on the language.)

> how to build

(Still don't know how you guys define 'build'.)

You link a shared library consisting of the object file file1.o
file2.o about as follows.

gcc -shared -o program file1.o file2.o -llibrary1 -llibrary2


g++ -shared -fPIC -o program file1.o file2.o -llibrary1 -llibrary2

You need to pass -fPIC here because C++ linking requires compiling
internal extra files to have the global ctors called.

> how to debug

gdb is your program of choice. As always, `info gdb`. There is a
graphical frontend available, xxgdb, but I'm not used to it.

> how to profile

info gprof

> how to port this large amount of code i have..

I'm afraid I can't help you with this (:-).

> please send me any URLs talking in that ..or

is a good starting point. I don't know of others as the extensive
documentation that comes with all the tools mostly sufficed. If it
doesn't, this newsgroup is a good place to ask.

Have fun,

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