zint / zint-gpl-only

Zint Barcode Generator
https://zint.org.uk/
GNU General Public License v3.0
525 stars 138 forks source link

.so library, test examples and development environment details #57

Closed digiajay closed 2 years ago

digiajay commented 7 years ago

Hi There,

I'm planning to use zint library for one of my application. I understand it's built in Linux but I'm new to Linux. I would like to get .so library and some examples to use the library api's. I can explore myself for some time if you can give me points like the platform I need to run it, development environment I would require, etc..,

Thanks Ajay.

denisdemaisbr commented 7 years ago

did you know more about gcc and ld (library static/dynamic linking)

digiajay commented 7 years ago

I do not much about gcc/ld. Now, I have done building the zint with eclipse CDT.

denisdemaisbr commented 7 years ago

@digiajay maybe did you can try a ide 'native' in C [or cmake, make] ide x lib x linking x compiller = too complex

suggestion: you can uses a static library (.a) to simplify. dynamic linking vary depends os/compiller/ ...

digiajay commented 7 years ago

@denisdemaisbr I don't understand. You mean using native binaries like C,CC for compiling and building executable/library? What do you mean by static library?

denisdemaisbr commented 7 years ago

@digiajay try it

example:

compile ordinary files

gcc -c y.c gcc -c x.c

make a static library with 2 object-files

ar cru libXY.a y.o x.o

make a dinamic library

gcc -shared -wl,-soname,libxy.so.1 -o libxy.so.1.0.1 y.o x.o

compile z.c and link with a static library

gcc -o z z.c libXY.a

compile z.c and link with a dinamic library

note: man ldconfig

gcc -o z z.c -lxy

gitlost commented 2 years ago

As this fork is no longer in use, am closing this. Please raise a ticket at https://sourceforge.net/p/zint/tickets/ if you require further help. Thanks all!