![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I am new to Berkeley DB. I am using VC++ 6.0 to run the examples provided, but i am getting this error I have created a new Console application and trying to Build the project, but i am get the below error. How do i overcome this? Thanks & Regds, Gururaj --------------------Configuration: berkeley1 - Win32 Debug-------------------- Compiling... excxx_example_database_load.cpp Linking... excxx_example_database_load.obj : error LNK2001: unresolved external symbol _optarg excxx_example_database_load.obj : error LNK2001: unresolved external symbol _getopt Debug/berkeley1.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. berkeley1.exe - 3 error(s), 0 warning(s) |
#3
| |||
| |||
|
|
Hello Gururaj, getopt is a utility function from the Unix library, and optarg is a global variable associated with this function. Try including clib/getopt.c from the Berkeley DB source distribution, it's a replacement for systems that don't have getopt. You might also look at the build_windows/ex_access.dsp project file in the source distribution, it is used to build the examples, and it includes getopt.c. - Don On Apr 10, 7:46 am, "Guru" <parva... (AT) gmail (DOT) com> wrote: Hi, I am new to Berkeley DB. I am using VC++ 6.0 to run the examples provided, but i am getting this error I have created a new Console application and trying to Build the project, but i am get the below error. How do i overcome this? Thanks & Regds, Gururaj --------------------Configuration: berkeley1 - Win32 Debug-------------------- Compiling... excxx_example_database_load.cpp Linking... excxx_example_database_load.obj : error LNK2001: unresolved external symbol _optarg excxx_example_database_load.obj : error LNK2001: unresolved external symbol _getopt Debug/berkeley1.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. berkeley1.exe - 3 error(s), 0 warning(s)- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
|
Hi Don, I tried including "clib/getopt.c" but i am getting the below errors, i looked into the file "getopt.c" as well, but cud not find any identifiable errors, if i am compiling just the "getopt.c" then it compiles fine except for some warnings _______________________________ excxx_example_database_load.cpp c:\berkeleydb\db-4.5.20\examples_cxx\getting_started\getopt.c(89) : error C2664: '__db_rpath' : cannot convert parameter 1 from 'char' to 'const char *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast c:\berkeleydb\db-4.5.20\examples_cxx\getting_started\getopt.c(90) : error C2440: '=' : cannot convert from 'char' to 'char *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast c:\berkeleydb\db-4.5.20\examples_cxx\getting_started\getopt.c(97) : error C2440: '=' : cannot convert from 'char' to 'char *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast c:\berkeleydb\db-4.5.20\examples_cxx\getting_started\getopt.c(141) : error C2440: '=' : cannot convert from 'char' to 'char *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast Error executing cl.exe. berkeley1.exe - 4 error(s), 0 warning(s) On Apr 10, 8:34 pm, "Don Anderson" <don.ander... (AT) gmail (DOT) com> wrote: Hello Gururaj, getopt is a utility function from the Unix library, and optarg is a global variable associated with this function. Try including clib/getopt.c from the Berkeley DB source distribution, it's a replacement for systems that don't have getopt. You might also look at the build_windows/ex_access.dsp project file in the source distribution, it is used to build the examples, and it includes getopt.c. - Don On Apr 10, 7:46 am, "Guru" <parva... (AT) gmail (DOT) com> wrote: Hi, I am new to Berkeley DB. I am using VC++ 6.0 to run the examples provided, but i am getting this error I have created a new Console application and trying to Build the project, but i am get the below error. How do i overcome this? Thanks & Regds, Gururaj --------------------Configuration: berkeley1 - Win32 Debug-------------------- Compiling... excxx_example_database_load.cpp Linking... excxx_example_database_load.obj : error LNK2001: unresolved external symbol _optarg excxx_example_database_load.obj : error LNK2001: unresolved external symbol _getopt Debug/berkeley1.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. berkeley1.exe - 3 error(s), 0 warning(s)- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
| |