Обсуждение: reg: Errors on Windows application(urgent)

Поиск
Список
Период
Сортировка

reg: Errors on Windows application(urgent)

От
"sandhya"
Дата:
 
hi.......
 
When i am using libpq on .net (vc7) I am getting the following errors.Mine is a simple C program in which just trying to
connect to the database and testing it for connection.This Application also includes so many other functions.
Anything wrong to include postgres in such an application......
I tried in someother application which deals with only postgres function.....It worked fine.When i added this in the above mentioned application I am facing problems......
 
Without including libpq.lib in (project-> properties->Linker->Input->Additional dependencies )
I just started learning to work on MFC/.Net
Please suggest me how to proceed
 
webs error LNK2019: unresolved external symbol _PQfinish referenced in function _WinMain@16
webs error LNK2019: unresolved external symbol _PQerrorMessage referenced in function _WinMain@16
 
webs error LNK2019: unresolved external symbol _PQstatus referenced in function _WinMain@16
 
webs error LNK2019: unresolved external symbol _PQsetdbLogin referenced in function _WinMain@16
 
 
After including libpq.lib in (project-> properties->Linker->Input->Additional dependencies )
These are the errors
webs error LNK2005: _free already defined in LIBCMTD.lib(dbgheap.obj)
webs error LNK2005: _malloc already defined in LIBCMTD.lib(dbgheap.obj)
webs error LNK2005: _strncpy already defined in LIBCMTD.lib(strncpy.obj)
webs error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
webs error LNK2005: _fflush already defined in LIBCMTD.lib(fflush.obj)
webs error LNK2005: _fprintf already defined in LIBCMTD.lib(fprintf.obj)
webs error LNK2005: __snprintf already defined in LIBCMTD.lib(snprintf.obj)
webs error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
webs error LNK2005: _strchr already defined in LIBCMTD.lib(strchr.obj)
webs error LNK2005: _strncmp already defined in LIBCMTD.lib(strncmp.obj)
webs error LNK2005: _isspace already defined in LIBCMTD.lib(_ctype.obj)
webs error LNK2005: _getenv already defined in LIBCMTD.lib(getenv.obj)
webs error LNK2005: _isalpha already defined in LIBCMTD.lib(_ctype.obj)
webs error LNK2005: _atoi already defined in LIBCMTD.lib(atox.obj)
webs error LNK2005: _time already defined in LIBCMTD.lib(time.obj)
webs error LNK2005: _realloc already defined in LIBCMTD.lib(dbgheap.obj)
webs error LNK2005: __vsnprintf already defined in LIBCMTD.lib(vsnprint.obj)
webs error LNK2005: _strtol already defined in LIBCMTD.lib(strtol.obj)
webs error LNK2005: _sscanf already defined in LIBCMTD.lib(sscanf.obj)
webs error LNK2005: __errno already defined in LIBCMTD.lib(dosmap.obj)
webs error LNK2005: _strtoul already defined in LIBCMTD.lib(strtol.obj)
webs error LNK2005: _memmove already defined in LIBCMTD.lib(memmove.obj)
webs error LNK2005: _isalnum already defined in LIBCMTD.lib(_ctype.obj)
webs error LNK2005: _strstr already defined in LIBCMTD.lib(strstr.obj)
webs error LNK2005: _tolower already defined in LIBCMTD.lib(tolower.obj)
webs error LNK2005: _isupper already defined in LIBCMTD.lib(_ctype.obj)
webs error LNK2005: _toupper already defined in LIBCMTD.lib(toupper.obj)
webs error LNK2005: _islower already defined in LIBCMTD.lib(_ctype.obj)
webs error LNK2005: _isxdigit already defined in LIBCMTD.lib(_ctype.obj)
webs error LNK2005: _isdigit already defined in LIBCMTD.lib(_ctype.obj)
webs warning LNK4006: _free already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored
webs warning LNK4006: _malloc already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored
webs warning LNK4006: _strncpy already defined in LIBCMTD.lib(strncpy.obj); second definition ignored
webs warning LNK4006: _sprintf already defined in LIBCMTD.lib(sprintf.obj); second definition ignored
webs warning LNK4006: _fflush already defined in LIBCMTD.lib(fflush.obj); second definition ignored
webs warning LNK4006: _fprintf already defined in LIBCMTD.lib(fprintf.obj); second definition ignored
webs warning LNK4006: __snprintf already defined in LIBCMTD.lib(snprintf.obj); second definition ignored
webs warning LNK4006: _fclose already defined in LIBCMTD.lib(fclose.obj); second definition ignored
webs warning LNK4006: _strchr already defined in LIBCMTD.lib(strchr.obj); second definition ignored
webs warning LNK4006: _strncmp already defined in LIBCMTD.lib(strncmp.obj); second definition ignored
webs warning LNK4006: _isspace already defined in LIBCMTD.lib(_ctype.obj); second definition ignored
webs warning LNK4006: _getenv already defined in LIBCMTD.lib(getenv.obj); second definition ignored
webs warning LNK4006: _isalpha already defined in LIBCMTD.lib(_ctype.obj); second definition ignored
webs warning LNK4006: _atoi already defined in LIBCMTD.lib(atox.obj); second definition ignored
webs warning LNK4006: _time already defined in LIBCMTD.lib(time.obj); second definition ignored
webs warning LNK4006: _realloc already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored
webs warning LNK4006: __vsnprintf already defined in LIBCMTD.lib(vsnprint.obj); second definition ignored
webs warning LNK4006: _strtol already defined in LIBCMTD.lib(strtol.obj); second definition ignored
webs warning LNK4006: _sscanf already defined in LIBCMTD.lib(sscanf.obj); second definition ignored
webs warning LNK4006: __errno already defined in LIBCMTD.lib(dosmap.obj); second definition ignored
webs warning LNK4006: _strtoul already defined in LIBCMTD.lib(strtol.obj); second definition ignored
webs warning LNK4006: _memmove already defined in LIBCMTD.lib(memmove.obj); second definition ignored
webs warning LNK4006: _isalnum already defined in LIBCMTD.lib(_ctype.obj); second definition ignored
webs warning LNK4006: _strstr already defined in LIBCMTD.lib(strstr.obj); second definition ignored
webs warning LNK4006: _tolower already defined in LIBCMTD.lib(tolower.obj); second definition ignored
webs warning LNK4006: _isupper already defined in LIBCMTD.lib(_ctype.obj); second definition ignored
webs warning LNK4006: _toupper already defined in LIBCMTD.lib(toupper.obj); second definition ignored
webs warning LNK4006: _islower already defined in LIBCMTD.lib(_ctype.obj); second definition ignored
webs warning LNK4006: _isxdigit already defined in LIBCMTD.lib(_ctype.obj); second definition ignored
webs warning LNK4006: _isdigit already defined in LIBCMTD.lib(_ctype.obj); second definition ignored
   Creating library ./Debug/webs.lib and object ./Debug/webs.exp
webs warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
webs fatal error LNK1169: one or more multiply defined symbols found
 
 
Please tell me how to rectify........I am very much in need of this.
help me...
 
 
-Sandhya
 
 
 
 

Re: reg: Errors on Windows application(urgent)

От
"Magnus Hagander"
Дата:
> Without including libpq.lib in (project->
> properties->Linker->Input->Additional dependencies ) I just
> started learning to work on MFC/.Net Please suggest me how to proceed
>
> webs error LNK2019: unresolved external symbol _PQfinish
> referenced in function _WinMain@16 webs error LNK2019:
> unresolved external symbol _PQerrorMessage referenced in
> function _WinMain@16
>
> webs error LNK2019: unresolved external symbol _PQstatus
> referenced in function _WinMain@16
>
> webs error LNK2019: unresolved external symbol _PQsetdbLogin
> referenced in function _WinMain@16


This is consistent with not including libpq, so nothing weird there.
Note: You can just add the lib file as a dependency in your project
explorer if I'm not mistaken - that easier than going through project
properties.


> After including libpq.lib in (project->
> properties->Linker->Input->Additional dependencies ) These
> are the errors webs error LNK2005: _free already defined in
> LIBCMTD.lib(dbgheap.obj) webs error LNK2005: _malloc already
> defined in LIBCMTD.lib(dbgheap.obj) webs

Your project is set to use "Debug Multithreaded". That conflicts with
libpq. You will need to use "Multithreaded using DLL" (it may work with
"Debug Mulithread ed using DLL" - I'm not sure about that).

If that's not pssible, you will need to recompile libpq with the same
settings your program uses.

(For further information, see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore9
8/HTML/lnk4098.asp)


//Magnus

Re: reg: Errors on Windows application(urgent)

От
"sandhya"
Дата:
hi Magnus.....

Thank you verymuch.Problem is solved
It is because of "Debug Mulithread ed using DLL"  only.....

-Sandhya

----- Original Message -----
From: "Magnus Hagander" <mha@sollentuna.net>
To: "sandhya" <sandhyar@amiindia.co.in>; "postgre"
<pgsql-admin@postgresql.org>
Sent: Wednesday, December 14, 2005 2:41 PM
Subject: Re: [ADMIN] reg: Errors on Windows application(urgent)


> > Without including libpq.lib in (project->
> > properties->Linker->Input->Additional dependencies ) I just
> > started learning to work on MFC/.Net Please suggest me how to proceed
> >
> > webs error LNK2019: unresolved external symbol _PQfinish
> > referenced in function _WinMain@16 webs error LNK2019:
> > unresolved external symbol _PQerrorMessage referenced in
> > function _WinMain@16
> >
> > webs error LNK2019: unresolved external symbol _PQstatus
> > referenced in function _WinMain@16
> >
> > webs error LNK2019: unresolved external symbol _PQsetdbLogin
> > referenced in function _WinMain@16
>
>
> This is consistent with not including libpq, so nothing weird there.
> Note: You can just add the lib file as a dependency in your project
> explorer if I'm not mistaken - that easier than going through project
> properties.
>
>
> > After including libpq.lib in (project->
> > properties->Linker->Input->Additional dependencies ) These
> > are the errors webs error LNK2005: _free already defined in
> > LIBCMTD.lib(dbgheap.obj) webs error LNK2005: _malloc already
> > defined in LIBCMTD.lib(dbgheap.obj) webs
>
> Your project is set to use "Debug Multithreaded". That conflicts with
> libpq. You will need to use "Multithreaded using DLL" (it may work with
> "Debug Mulithread ed using DLL" - I'm not sure about that).
>
> If that's not pssible, you will need to recompile libpq with the same
> settings your program uses.
>
> (For further information, see
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore9
> 8/HTML/lnk4098.asp)
>
>
> //Magnus
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>



Re: reg: Errors on Windows application(urgent)

От
"sandhya"
Дата:
hi Magnus....

It compiled and Linked properly after mentioning "Debug Multithread ed using
DLL"But i faced problem while executing it....
Simply i gave in Configuration properties-> Linker->Input-> ignore library
the library name "LIBCMTD.lib"
Then it worked fine.......
Any thing wrong in this?
Just to inform the solution to your view.....

Thanks,
Sandhya



----- Original Message -----
From: "Magnus Hagander" <mha@sollentuna.net>
To: "sandhya" <sandhyar@amiindia.co.in>; "postgre"
<pgsql-admin@postgresql.org>
Sent: Wednesday, December 14, 2005 2:41 PM
Subject: Re: [ADMIN] reg: Errors on Windows application(urgent)


> > Without including libpq.lib in (project->
> > properties->Linker->Input->Additional dependencies ) I just
> > started learning to work on MFC/.Net Please suggest me how to proceed
> >
> > webs error LNK2019: unresolved external symbol _PQfinish
> > referenced in function _WinMain@16 webs error LNK2019:
> > unresolved external symbol _PQerrorMessage referenced in
> > function _WinMain@16
> >
> > webs error LNK2019: unresolved external symbol _PQstatus
> > referenced in function _WinMain@16
> >
> > webs error LNK2019: unresolved external symbol _PQsetdbLogin
> > referenced in function _WinMain@16
>
>
> This is consistent with not including libpq, so nothing weird there.
> Note: You can just add the lib file as a dependency in your project
> explorer if I'm not mistaken - that easier than going through project
> properties.
>
>
> > After including libpq.lib in (project->
> > properties->Linker->Input->Additional dependencies ) These
> > are the errors webs error LNK2005: _free already defined in
> > LIBCMTD.lib(dbgheap.obj) webs error LNK2005: _malloc already
> > defined in LIBCMTD.lib(dbgheap.obj) webs
>
> Your project is set to use "Debug Multithreaded". That conflicts with
> libpq. You will need to use "Multithreaded using DLL" (it may work with
> "Debug Mulithread ed using DLL" - I'm not sure about that).
>
> If that's not pssible, you will need to recompile libpq with the same
> settings your program uses.
>
> (For further information, see
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore9
> 8/HTML/lnk4098.asp)
>
>
> //Magnus
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>