7c3 Subj : Re: [For expert] Linker error To : borland.public.cpp.borlandcpp From : Martin Gaeckler Date : Wed Jun 08 2005 11:13 pm remo schrieb: > Hi, > I have Borland c++ Builder 6. > My application use a proprietary library for manage a camera. > In my source code I use: > ..... > long myerror = GetDevicePar(A, B); > .... > When I build the program I have this linker error: > [Linker Error] Unresolved external '__stdcall GetDevicePar(.....) referenced > from C:\....\Unit1.Obj > > Now, I add to project the manage camera library, CAMERA.LIB, and build > again. But I have a new error: > > [Linker Error] C:\....\CAMERA.LIB contains invalid OMF record, type > 0x21(possibly COFF) > > So I use from console: > > implib camera.DLL camera2.LIB > > but the new library camera2.LIB = 11 KB > , the old camera.LIB = 28 KB???? > > Now I add to project the new lib camera2.LIB and build again. > But I have again the first linker Error : > [Linker Error] Unresolved external '__stdcall GetDevicePar(.....) referenced > from C:\....\Unit1.Obj > > Last note: if I use from console: omf2coff camera.LIB camera3.LIB the > camera3.LIB = 3 KB!!???!!! and it NOT work. > > I'M GOING CRAZY!!! HELP ME, PLEASE. Hello, I have to guess: Try the following option: Advanced Compiler -> Generate underscores If this does not help, you may have run into a name mangling problem. To solve this: check the header file of your library: You need the following extensions: #ifdef __cplusplus extern "C" { #endif // your prototypes: long GetDevicePar( A, B); #ifdef __cplusplus }; #endif Hope this helps. Martin -- Phone: +49-89-65 30 95 63 Fax: +49-89-65 30 95 64 WWW: http://www.cresd.de S-Mail: Freibadstr. 14, D-81543 München PGP-Key: http://www.cresd.de/edv/pgpkey.txt . 0