Re: [IBPP-DISCUSS] Compiling IBPP with MSVC6 problem
IBPP is a C++ client class library for FirebirdSQL
Status: Inactive
Brought to you by:
epocman
From: Olivier M. <om...@ti...> - 2003-02-25 16:12:58
|
Tuesday 25 Feb 2003, 17:42, Emilio Blanco =E9crivait : > Hi, i'm new to IBPP. Welcome ! > I get the following when compiling a test app in Visual C++ 6.0: > PruebaDlg.obj : error LNK2001: unresolved external symbol "class=20 > IBPP::IDatabase * __cdecl IBPP::DatabaseFactory(class=20 > std::basic_string<char,struct std::char_traits<char>,class=20 > std::allocator<char> > const &,class std::basic_string<char,struct std: >=20 > My code is very simple... just to test if it compiles: > =20 > void CPruebaDlg::OnButton1()=20 > { > IBPP::Database ib =3D IBPP::DatabaseFactory("","","",""); > ib->Create(); > ib->Connect(); > } > =20 > I have included Ibpp.h and ibpp.lib into my project directory, and in the= top=20 > of the file i #include "ibpp.h" and defined the IBPP_WINDOWS IBPP_MSVC > =20 > What am i doing wrong? Assuming you're using the precompiled .LIB file available for download with the 2.0 version, maybe you have not used compilation options for your code compatible with those used for building the library. I think MSVC 6 don't use __cdecl by default, but I suspect the prebuilt library uses such (cause it's my habit to do so). Recompile your own project with /Gd switch. Should solve it. And now ladies and gentlemen, the good advice ! Please compile the library by yourself. Don't use the precompiled binaries. I will stop providing those, this can too easily be the source of problems for people. By compiling the library yourself, you get a better confidence in what your doing. You can tweak (a bit - not too much) the compiler settings used to compile IBPP to fit the needs of your project. To compile with MSVC, get the source code unzipped to a directory of your choice, get the ibase.h and iberror.h from your firebird installation 'include' subdir and put them in that ibpp directory, run the VCVARS32.BAT from your MSVC installation in a command prompt, then type : nmake -fmake-msvc to build the production library and : nmake -fmake-msvc DEBUG=3D1 to build the debug version of the library. The make-msvc makefile is pretty clean and anybody with minimal knowledge of MSVC command-line switches can tweak the compiler settings easily. [If there are slight errors or ommissions in the above recipe, excuse-me, I just typed the above from memory without the tools right here]. --=20 Best Regards, Olivier Mascia <om...@ti...> icq#25233042 |