Re: writing a FreeBSD C library

2009-11-04 Thread KAYVEN RIESE
On Wed, 4 Nov 2009, Harald Servat wrote: Oh, yes! You're right DES. They look the same to me here in the web-browser :) Oh, no. shoulda used a serif font! {:P Oliver, regarding the Dag-Erling correction, the -I option in gcc refers to include header files (typically files ended with .h), n

Re: writing a FreeBSD C library

2009-11-04 Thread Harald Servat
Oh, yes! You're right DES. They look the same to me here in the web-browser :) Oliver, regarding the Dag-Erling correction, the -I option in gcc refers to include header files (typically files ended with .h), not for naming libraries as I mentioned. Regards. 2009/11/4 Dag-Erling Smørgrav > Har

Re: writing a FreeBSD C library

2009-11-04 Thread Dag-Erling Smørgrav
Harald Servat writes: > In addition, the -l X option in the gcc compiler looks for libX.[a|so] in > the all specified paths defined by -L, so in your first command > gcc -o aprog aprog.c -I ~/mylib/ > you're making gcc to look for for something called lib~/mylib/.[a|so] > which I doubt it ca

Re: writing a FreeBSD C library

2009-11-04 Thread Harald Servat
Hello Oliver, 2009/11/4 Oliver Mahmoudi > Thank you for your emails. > Neither one of the methods that you two suggested brought about the desired > solution, but I have solved it. > > using gcc for the plain source with the -I switch gives: > % gcc -o aprog aprog.c -I ~/mylib/ > /var/tmp//ccHrD

Re: writing a FreeBSD C library

2009-11-04 Thread Oliver Mahmoudi
Thank you for your emails. Neither one of the methods that you two suggested brought about the desired solution, but I have solved it. using gcc for the plain source with the -I switch gives: % gcc -o aprog aprog.c -I ~/mylib/ /var/tmp//ccHrDiyd.o(.text+0x19): In function `main': : undefined refer

Re: writing a FreeBSD C library

2009-10-26 Thread Gabor Kovesdan
Oliver Mahmoudi escribió: I compiled the library file in the following way. % gcc -I../include -Wall -c lb.c % ar rsv mylib.a lb.o You can study bsd.lib.mk and bsd.prog.mk in /usr/share/mk. With these two includes you can deal easily with your C programs/libraries. It will serve you very we

Re: writing a FreeBSD C library

2009-10-26 Thread Florian Loeber
Hi, you have to link your executable to your library. The command-line option is -l. % gcc -o testfile -lmylib source.c Without it, your program doesn't know that this library exists (somewhere, /usr/lib, ...) Regards, Florian ___ freebsd-hackers@free

writing a FreeBSD C library

2009-10-26 Thread Oliver Mahmoudi
Hello all y'all Kernel Hackers, Trying to get a deeper understanding of the FreeBSD kernel I am currently I am studying C library files. For this reason I wrote a very simple library, just to understand how it works. Below are my source codes for: 1. the header 2. the library file 3. a simple C