[fprint] Linking shared libraries

Guus Ellenkamp guus at activediscovery.net
Wed Sep 8 07:22:30 BST 2010


Am not familiar with gcc/g++. I'm just using c. What would be the makefile when using gcc?

Active Discovery Designs
Dutch quality web development at affordable prices


-----Original Message-----
From: Kunal Gangakhedkar [mailto:kunal.gangakhedkar at gmail.com] 
Sent: Wednesday, September 08, 2010 2:07 PM
To: fprint at reactivated.net
Cc: Guus Ellenkamp; 'Bastien Nocera'
Subject: Re: [fprint] Linking shared libraries

On Wednesday 08 Sep 2010 8:24:17 am Guus Ellenkamp wrote:
> Hi,
> 
> Thanks for your reply.
> 
> I am trying to use the version that comes with my package. I'm using Ubuntu and just installed 'libfprint-dev'. Tried the IDE and now tried just using a makefile.
> 
> Errors I get are 'undefined reference to fp_init(), fp_discover_devs() and fp_dscv_free(fp_dscv_dev**). The code compiles ok.
> 
> My makefile is:
> 
> all: test
> 
> test: test.o devicehandling.o
> 	g++ test.o devicehandling.o -lfprint -o test
> 
> test.o: test.c
> 	g++ -c test.c
> 
> devicehandling.o: devicehandling.c
> 	g++ -c devicehandling.c
> 
> clean: 
> 	rm -rf *o hello
> 
> I am familiar with programming, mostly using IDE, but not with using makefiles and shared libraries and not with Linux.
> 

Don't use g++ (the C++ front-end) - it's trying to do name-mangling.
The fprint.h file doesn't have C++ guards like:

#ifdef __cplusplus
extern "C" {
#endif
....
....
#ifdef __cplusplus
}
#endif

Check this for more information on how to mix C++ and C code:
http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html

Kunal



More information about the fprint mailing list