PDA

View Full Version : Dynamic link libraries



nareshqt
16th April 2008, 11:40
Hi Friends,

I am trying to port one apllication from windows to Mac.
In windows shared libraries i.e dll concept is used.

can any one explain whether it work in the same way in mAc or any other way to work with dynamic libraries.How to implement it in Mac Os


Thanks,
knrcse

wysota
16th April 2008, 14:14
The technique is similar.

nareshqt
16th April 2008, 14:43
Hi,
thanks for quick reply,

Actually till now i have worked on Objective-C where we develop framework and we can use it wherever required by linkung it,
so is ther a way here also to develop as a framework instead of dll.

thanks,
knrcse

wysota
16th April 2008, 15:06
I don't know the concept of 'framework' in Objective C, so it's hard to say. A general answer is that you can use code by providing a statically or dynamically linked library, a plugin (which is a dynamic library as well) or simply by including the source code in another project.

nareshqt
21st April 2008, 07:51
Can any One explain me the process of Developing and Using Shared Libraries on Mac using QT Classes,
I tried developing a .dylib. but while building it gave fallowing error



cd /Users/administrator/DemoDylib
/Developer/usr/bin/g++-4.0 -o /Users/administrator/DemoDylib/build/DemoDylib.build/Release/DemoDylib.build/Objects-normal/i386/libDemoDylib.dylib -L/Users/administrator/DemoDylib/build/Release -F/Users/administrator/DemoDylib/build/Release -F/Users/administrator/DemoDylib -filelist /Users/administrator/DemoDylib/build/DemoDylib.build/Release/DemoDylib.build/Objects-normal/i386/libDemoDylib.LinkFileList -framework Carbon -framework QtGui -framework QtCore -arch i386 -Wl,-single_module -compatibility_version 1 -current_version 1 -install_name /usr/local/lib/libDemoDylib.dylib -Wl,-Y,1455 -dynamiclib -mmacosx-version-min=10.4 -Wl,-dead_strip -no_dead_strip_inits_and_terms -isysroot /Developer/SDKs/MacOSX10.4u.sdk
ld: Undefined symbols:
__ZN7QString4freeEPNS_4DataE
__ZN7QWidget6resizeERK5QSize
/Users/administrator/DemoDylib/build/DemoDylib.build/Release/DemoDylib.build/Objects-normal/i386/Demo.o reference to undefined __ZN11QPushButtonC1ERK7QStringP7QWidget
/Users/administrator/DemoDylib/build/DemoDylib.build/Release/DemoDylib.build/Objects-normal/i386/Demo.o reference to undefined __ZN11QPushButtonD1Ev
/Users/administrator/DemoDylib/build/DemoDylib.build/Release/DemoDylib.build/Objects-normal/i386/Demo.o reference to undefined __ZN7QDialogC2EP7QWidget6QFlagsIN2Qt10WindowTypeEE
/Users/administrator/DemoDylib/build/DemoDylib.build/Release/DemoDylib.build/Objects-normal/i386/Demo.o reference to undefined __ZN7QDialogD2Ev
/Users/administrator/DemoDylib/build/DemoDylib.build/Release/DemoDylib.build/Objects-normal/i386/Demo.o reference to undefined __ZN7QObject7connectEPKS_PKcS1_S3_N2Qt14Connection TypeE
/Users/administrator/DemoDylib/build/DemoDylib.build/Release/DemoDylib.build/Objects-normal/i386/Demo.o reference to undefined __ZN7QString16fromAscii_helperEPKci
/Users/administrator/DemoDylib/build/DemoDylib.build/Release/DemoDylib.build/Objects-normal/i386/Demo.o reference to undefined __ZN7QString4freeEPNS_4DataE
/Users/administrator/DemoDylib/build/DemoDylib.build/Release/DemoDylib.build/Objects-normal/i386/Demo.o reference to undefined __ZN7QWidget6resizeERK5QSize
/Users/administrator/DemoDylib/build/DemoDylib.build/Release/DemoDylib.build/Objects-normal/i386/Demo.o reference to undefined __ZTV4Demo
/Developer/usr/bin/../libexec/gcc/i686-apple-darwin8/4.0.1/libtool: internal link edit command failed



please tell me how to do it,

Thanks,
knrcse

wysota
21st April 2008, 08:55
Looks like you forgot to link against Qt libraries. Did you use qmake to build the library?

nareshqt
22nd April 2008, 07:20
Hi,

how we will mention which symbols are to be exported and not.
is ther any option in qmake command.

thanks,
knrcse