how to link an external lib on Windows
От | chaoyong wang |
---|---|
Тема | how to link an external lib on Windows |
Дата | |
Msg-id | BAY119-W444FD565006575E32D8CF8E5270@phx.gbl обсуждение исходный текст |
Ответы |
Re: how to link an external lib on Windows
|
Список | pgsql-hackers |
<style> .hmmessage P {margin:0px;padding:0px;} body.hmmessage {font-size:10pt;font-family:Verdana;} </style><br /><style> .ExternalClass .ecxhmmessage P {padding:0px;} </style>Hi,<br /> I build PG on VS2005, which files should I change to use a external lib in my own contrib, for example,Berkeley DB 4.8.26?<br /> <br /> Until now, I have tried the following 2 ways, but both failed.<br /><br /> 1. Add the target include and lib<br /> 1). src/tools/msvc/config.pl<br /> add a new line: db48=>'C:\ProgramFiles\Oracle\Berkeley DB 4.8.26' <br /> 2). src/Makefile.global.in<br /> Add a new lineafter line 435 "LIBS := -lpgport $(LIBS)" (maybe not exactly same with different versions): LIBS := -ldb48 $(LIBS)<br/> 3). contrib/mycontrib/Makefile<br /> SHLIB_LINK += $(filter -ldb48, ($LIBS))<br /> ThenI build DEBUG in Visual Studio 2005 Command Prompt, it reports db.h not found.<br /><br /> 2. The first error reportshows that the include file is not accessed<br /> I changed the congiture option "--with-libxml" to yes, andadd the files of include and lib under Berkeley DB 4.8.26 to libxml folder. <br /> When I build, it reports: fatalerror LNK1120: 2 unresolved externals<br /> Then I check the single project on VS2005, there is no libdb48.libin the Linker input, after I added BDB_DIR\lib\libdb48.lib to it. It build successfully.<br /><br /> But Iwant to build the whole PG source with mycontrib, Had someone ever encounter a problem like this? <img alt="" height="19"src="http://gfx2.hotmail.com/mail/w4/pr01/ltr/emoticons/smile_regular.gif" width="19" />Thanks~<br /><br /><br/><br />Best Regards<br />Chaoyong Wang<br /><br /><hr />Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.<a href="https://signup.live.com/signup.aspx?id=60969" target="_new">Sign up now.</a>
В списке pgsql-hackers по дате отправления: