473,322 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Linking error

HI
I'm using Berkeley DB and VC ++.
when i debug my program i got this error.

error C2664: 'strlen' : cannot convert parameter 1 from 'void *' to 'const char *'

from this line
skey->size = (u_int32_t)strlen((skey->data)) + 1;

so i changed this line
skey->size = (u_int32_t)strlen((const char *)(skey->data)) + 1;

it gives me this linking error
Linking...
load.obj : error LNK2001: unresolved external symbol "char * optarg" (?optarg@@3PADA)
load.obj : error LNK2019: unresolved external symbol "int __cdecl getopt(int,char * const *,char const *)" (?getopt@@YAHHPBQADPBD@Z) referenced in function _main


any ideas please,
please explain me with simple examples because I'm newbie !!!


Thanks
Kevin
Feb 28 '11 #1

✓ answered by Banfa

getopt is not a standard C library function but rather part of POSIX.

Presumably you are trying to port a program from Unix/Linux/BSD to Windows.

*nix implements POSIX and supports getopt, as well as all the C standard library. Windows does not fully support POSIX but does implement the C standard library, plus its own system libraries.

getopt parses the command line so you will need to write your own command line parsing code.

2 1131
Banfa
9,065 Expert Mod 8TB
getopt is not a standard C library function but rather part of POSIX.

Presumably you are trying to port a program from Unix/Linux/BSD to Windows.

*nix implements POSIX and supports getopt, as well as all the C standard library. Windows does not fully support POSIX but does implement the C standard library, plus its own system libraries.

getopt parses the command line so you will need to write your own command line parsing code.
Feb 28 '11 #2
Thank for you reply.
I'll try to write my own.
:D
Mar 1 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Yoon-Soo Lee | last post by:
I am using Visual C++ .NET 2003 and running into some linking error from the following template code. The error messages is error LNK2019: unresolved external symbol "class...
1
by: manish | last post by:
Hi, I am a fresher in the programming field i.e although I have done programming at the basic level but at professional level I am very new and I am facing many problems. These probllems are...
0
by: Shawn | last post by:
I get a linking error when building an openGl program under Visual C++ 6. I've set the entry point symbol to wWinMainCRTStartup as per the solution posted but still no luck The error message i...
4
by: Sanjay Kumar | last post by:
Folks ! I am working with VC++ after a long time and having problem linking latest xerces 2.7 in VC++ 2005 Express Edition. I have done following: 1. downloaded and unpacked the the...
1
by: sharmadeep1980 | last post by:
Hi All, I am facing a very unique problem while compling my project in "Release" build. The project is building in DEBUG mode but giving linking error on Release build. Here is the error:...
1
by: g35rider | last post by:
Hi, I am trying to understand from C++ point of view what the problem is. I have a file called. Controllers.h in which I have a base class Controller and couple of other sub classes...
7
by: bajichuan | last post by:
Hello! I have the world's strangest linking error, and I'm hoping that someone can help me sort it out. I recently installed and compiled a library called LinBox without a problem. I have an...
1
by: tomb | last post by:
I haven't worked with Visual C++ before, so I'm in a little over my head on a project I'm doing. I'm using VC++ 2003 unmanaged code, and I am getting this linking error that I don't understand:...
1
by: Angela Yan | last post by:
Hi all, I have a dll compiled using DDK 3790.1218 WNet environment. Everything works fine until recently I need to link a Lib file that is complied using C++ in VS2005. After I add the Lib file...
2
by: mdubey82 | last post by:
Dear Friends I am new to vc++; While debugging my vc++ project which is calling c# method (by referencing c# project) I got the linking error I just cant understand how to get rid of...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.