Discussion:
Need your help
(too old to reply)
Guru
2007-04-10 11:46:16 UTC
Permalink
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)
Don Anderson
2007-04-10 15:34:34 UTC
Permalink
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
Post by Guru
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)
Guru
2007-04-11 05:54:29 UTC
Permalink
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)
Post by Don Anderson
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
Post by Guru
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 -
Guru
2007-04-11 09:02:15 UTC
Permalink
Post by Guru
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
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
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 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 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)
Post by Don Anderson
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
Post by Guru
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 -
Hi Don,
Thanks for ur help, i was able to fix the problem, the "clib/getopt.c"
had some problems so i just added these function definitions into my
code and now it works fine.

Thanks,
Gururaj

Loading...