The project I was working on needed to use the Subversion feature. I posted this article on Tianya, and I will repeat it here today.
When I configure the header files and dependent libraries required for compiling subversion, the compilation can be passed, but there is always a problem with the link. At that time, I wanted to find a guide document on subversion client API programming. It was very difficult. There were very few articles on the Internet, and people around me were not familiar with subversion. I had a hard time exploring for more than a week, finally, we took the most difficult first step. To sum up, I hope you can give me some advice.
At that time, my environment was as follows:
[OS]
Windows XP Professional 2002 Service Pack 2
[Ide]
Visual c ++ 6.0
[Subversion1.4.2]
Http://subversion.tigris.org/downloads/subversion-1.4.2.zip
[Tortoisesvn1.4.1]
Http://nchc.dl.sourceforge.net... win32-svn-1.4.2.msi
[Required header files and static libraries]
1) Subversion API header files and static libraries:
Http://subversion.tigris.org/downloads/svn-win32-1.4.2_dev.zip
2) header files and libraries dependent on Subversion:
Http://subversion.tigris.org/downloads/subversion-deps-1.4.2.zip
Http://subversion.tigris.org/fil... n-win32-libintl.zip
Http://subversion.tigris.org/fil... db-4.4.20-win32.zip
[Lib files that need to be added to the VC dynamic link library]
Ibsvn_client-1.lib
Libsvn_delta-1.lib
Libsvn_diff-1.lib
Libsvn_fs-1.lib
Libsvn_fs_base-1.lib
Libsvn_fs_fs-1.lib
Libsvn_ra-1.lib
Libsvn_ra_dav-1.lib
Libsvn_ra_local-1.lib
Libsvn_ra_svn-1.lib
Libsvn_repos-1.lib
Libsvn_subr-1.lib
Libsvn_wc-1.lib
Libapr. Lib
Libaprutil. Lib
XML. Lib
Libneon. Lib
Intl3_svn.lib
Libdb44s. Lib
Ws2_32.lib
Shfolder. Lib
Note:I did not joinShfolder. LibThe following error occurs when the result is linked:
Libsvn_subr-1.lib (config_win.obj): Error lnk2001: unresolved external symbol _ imp _ shgetfolderpatha @ 20
Libsvn_subr-1.lib (config_win.obj): Error lnk2001: unresolved external symbol _ imp _ shgetfolderpathw @ 20
Debug/mini_client.exe: Fatal error lnk1120: 2 unresolved externals
This has plagued me for a long time. Later I found out with the help of Lao Zhang that shgetfolderpath is a function of the windwos dynamic link library shell32.dll. Msdn2005 has the following comments on this function:
This function is a superset of shgetspecialfolderpath, encoded with earlier versions of the shell. on systems preceeding those including shell32.dll version 5.0 (Windows Millennium Edition (Windows ME) and Windows 2000), shgetfolderpath was obtained through shfolder. DLL, distributed with Microsoft Internet Explorer 4.0 and later versions. shfolder. DLL always callthe current platform's version of this function. if that fails, it will try to simulate the appropriate behavior. shfolder. DLL continues to be supported ded for backward compatibility, though the function is now implemented in shell32.dll.
Note
On older systems that require the redistributable shfolder. dll, you must explicitly link to shfolder. Lib before you link to shell32.lib.
This is why shfolder. Lib must be added.
Note the following:
You must select "Debug multithreaded DLL" from the "Project setting" dialog box> "C/C ++" option> "use Runtime Library" drop-down menu of VC "; that is, change the second parameter of project options to/MDD. Otherwise, the following error occurs:
Linking...
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strncmp already defined in libc. Lib (strncmp. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ free already defined in libc. Lib (free. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strchr already defined in libc. Lib (strchr. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ calloc already defined in libc. Lib (calloc. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ malloc already defined in libc. Lib (malloc. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ close already defined in libc. Lib (close. OBJ)
......
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ write already defined in libc. Lib (write. OBJ)
Link: Warning lnk4098: defaultlib "msvcrt" conflicts with use of other libs; Use/nodefaultlib: Library
Debug/mini_client.exe: Fatal error lnk1169: one or more multiply defined symbols found
Error executing link.exe.
OK! Now download minimal_client.c (a small subversion client API demo) from the http://svn.collab.net/repos/svn/tags/1.3.2/tools/examples/ to compile and run it.
O (distinct _ distinct) O ~~
Dangdang buys books at a lower price, delivers goods to the door, and delivers on delivery.