A couple of days ago one of my users reported a “Duplicate Symbol” compile error. He thought this had something to do with one of my Clarion accessories, but it turns out the problem is actually caused by Clarion 6.3.9058. Here’s an example of the error..

This blog post explains what causes this compile error, and how to go about fixing it.
Buried away in the Clarion 6.3.9058 change log, SoftVelocity added this entry:
CHANGE: Win32.lib – Update list of entries used for SHELL32.DLL
What? You don’t read the change logs! Don’t worry, you’re not alone..
What does that entry actually mean? In the past certain Windows API functions had to be manually “added” to Clarion APPs, but using LibMaker to create a LIB file from the Windows DLL, adding that LIB to your APPs project includes, and then manually prototyping the functions in your global map.
In Clarion 6.3.9058 SoftVelocity added a bunch of new functions into the Clarion LIB files. So, if you had manually created your own LIBs and added them to your APP, Clarion would now regard your prototyped functions as duplicates. Make sense?
Unfortunately there’s no published list of which new functions were added! So I took it upon myself to publish such a list. Here it is..
First, the following two functions have been deprecated:
Shl1632_ThunkData32 and Shl3216_ThunkData32
The following 226 functions have been added:
Activate_RunDLL, AppCompat_RunDLLW, CallCPLEntry16, CDefFolderMenu_Create, CDefFolderMenu_Create2, Control_FillCache_RunDLLA, Control_FillCache_RunDLLW, Control_RunDLLA, Control_RunDLLAsUserW, Control_RunDLLW, DAD_AutoScroll, DAD_DragEnterEx, DAD_DragEnterEx2, DAD_DragLeave, DAD_DragMove, DAD_SetDragImage, DAD_ShowDragImage, DllCanUnloadNow, DllGetClassObject, DllGetVersion, DllInstall, DllRegisterServer, DllUnregisterServer, DriveType, ExtractIconExW, FindExeDlgProc, GetFileNameFromBrowse, ILAppendID, ILClone, ILCloneFirst, ILCombine, ILCreateFromPath, ILCreateFromPathA, ILCreateFromPathW, ILFindChild, ILFindLastID, ILFree, ILGetNext, ILGetSize, ILIsEqual, ILIsParent, ILLoadFromStream, ILRemoveLastID, ILSaveToStream, IsLFNDrive, IsLFNDriveA, IsLFNDriveW, IsNetDrive, IsUserAnAdmin, OpenAs_RunDLLA, OpenAs_RunDLLW, OpenRegStream, Options_RunDLL, Options_RunDLLA, Options_RunDLLW, PathCleanupSpec, PathGetShortPath, PathIsExe, PathIsSlowA, PathIsSlowW, PathMakeUniqueName, PathProcessCommand, PathQualify, PathResolve, PathYetAnotherMakeUniqueName, PickIconDlg, PifMgr_CloseProperties, PifMgr_GetProperties, PifMgr_OpenProperties, PifMgr_SetProperties, PrintersGetCommand_RunDLLA, PrintersGetCommand_RunDLLW, ReadCabinetState, RealDriveType, RestartDialog, RestartDialogEx, SHAddFromPropSheetExtArray, SHAlloc, SHAllocShared, SHBindToParent, SHBrowseForFolderW, SHChangeNotification_Lock, SHChangeNotification_Unlock, SHChangeNotifyDeregister, SHChangeNotifyRegister, SHChangeNotifySuspendResume, SHCloneSpecialIDList, SHCLSIDFromString, SHCoCreateInstance, SHCreateDirectory, SHCreateDirectoryExA, SHCreateDirectoryExW, SHCreateFileExtractIconW, SHCreateLocalServerRunDll, SHCreateProcessAsUserW, SHCreatePropSheetExtArray, SHCreateQueryCancelAutoPlayMoniker, SHCreateShellFolderView, SHCreateShellFolderViewEx, SHCreateShellItem, SHCreateStdEnumFmtEtc, SHDefExtractIconA, SHDefExtractIconW, SHDestroyPropSheetExtArray, SHDoDragDrop, Shell_GetCachedImageIndex, Shell_GetImageLists, Shell_MergeMenus, Shell_NotifyIconW, ShellExec_RunDLL, ShellExec_RunDLLA, ShellExec_RunDLLW, ShellExecuteExW, ShellHookProc, ShellMessageBoxA, ShellMessageBoxW, SHEmptyRecycleBinA, SHEmptyRecycleBinW, SHEnableServiceObject, SHEnumerateUnreadMailAccountsW, SHExtractIconsW, SHFileOperationW, SHFind_InitMenuPopup, SHFindFiles, SHFlushClipboard, SHFlushSFCache, SHFree, SHFreeShared, SHGetAttributesFromDataObject, SHGetDataFromIDListW, SHGetDiskFreeSpaceA, SHGetDiskFreeSpaceExA, SHGetDiskFreeSpaceExW, SHGetFileInfoW, SHGetFolderLocation, SHGetFolderPathA, SHGetFolderPathAndSubDirA, SHGetFolderPathAndSubDirW, SHGetFolderPathW, SHGetIconOverlayIndexA, SHGetIconOverlayIndexW, SHGetImageList, SHGetNewLinkInfo, SHGetNewLinkInfoA, SHGetNewLinkInfoW, SHGetPathFromIDListW, SHGetRealIDL, SHGetSetFolderCustomSettingsW, SHGetSetSettings, SHGetSettings, SHGetShellStyleHInstance, SHGetSpecialFolderPathA, SHGetSpecialFolderPathW, SHGetUnreadMailCountW, SHHandleUpdateImage, SHHelpShortcuts_RunDLLA, SHHelpShortcuts_RunDLLW, SHILCreateFromPath, SHInvokePrinterCommandA, SHInvokePrinterCommandW, SHIsFileAvailableOffline, SHLimitInputEdit, SHLoadNonloadedIconOverlayIdentifiers, SHLoadOLE, SHLockShared, SHMapIDListToImageListIndexAsync, SHMapPIDLToSystemImageListIndex, SHMultiFileProperties, SHObjectProperties, SHOpenFolderAndSelectItems, SHOpenPropSheetW, SHParseDisplayName, SHPathPrepareForWriteA, SHPathPrepareForWriteW, SHPropStgCreate, SHPropStgReadMultiple, SHPropStgWriteMultiple, SHQueryRecycleBinA, SHQueryRecycleBinW, SHReplaceFromPropSheetExtArray, SHRestricted, SHRunControlPanel, SHSetInstanceExplorer, SHSetLocalizedName, SHSetUnreadMailCountW, SHShellFolderView_Message, SHSimpleIDListFromPath, SHStartNetConnectionDialogW, SHTestTokenMembership, SHUnlockShared, SHUpdateImageA, SHUpdateImageW, SHUpdateRecycleBinIcon, SHValidateUNC, SignalFileOpen, StrChrA, StrChrIA, StrChrIW, StrChrW, StrCmpNA, StrCmpNIA, StrCmpNIW, StrCmpNW, StrCpyNA, StrCpyNW, StrNCmpA, StrNCmpIA, StrNCmpIW, StrNCmpW, StrNCpyA, StrNCpyW, StrRChrA, StrRChrIA, StrRChrIW, StrRChrW, StrRStrA, StrRStrIA, StrRStrIW, StrRStrW, StrStrA, StrStrIA, StrStrIW, StrStrW, Win32DeleteFile, WOWShellExecute, WriteCabinetState
If you have been manually “adding” any of these functions into your APPs by creating your own LIBs, you will now receive duplicate symbol errors. You need to remove your LIB to fix this compile error. And you need to change your function prototypes in your global map as follows:
From:
module(‘shell32.lib’)
SHGetFolderPath(long,long,long,long,*cstring),long,pascal,raw,name(‘SHGetFolderPathA’)
end
To:
module(‘Clarion Internal’)
SHGetFolderPath(long,long,long,long,*cstring),long,pascal,raw,name(‘SHGetFolderPathA’)
end
That should fix the problem!



Nice! Less than 11 hours since I wrote this, and 31 people have read it so far! Why no comments guys!!!
Thanks Gary. Can you say, why one get these errors, and other (me) not? One clarion version, one template set (i think), one project.
Thanks for the info
Thanks for the information. I have for years been “prefixing” my APIs for just tis reason and so never ran into this problem. But using the ones defined by Clarion has advantages and disadvantages. Clarion has a long record of not getting their API definitions 100% correct and tracking down a prototype bug can be time consuming. The LONG vs ULONG problem comes to mind. To each their own.
Kevin.
Hi Mike,
You’ll only see these errors if you’re using Clarion 6.3.9058 (or possibly later – time will tell). And, you’ll only see these errors if you have manually created / added your own Win32 API LIB files, or if you’re using a 3rdParty product that hasn’t yet made their code 9058 “compatible” (as outlined above).
Does that help?
Best Regards,
Gary.
Hi Kevin,
Agreed, if all 3rdParty suppliers would prefix their functions using supplier-unique id’s that would really help all of us.
I must say, over the past 18 months I’ve seen a big improvement in this area.
I’m not sure that prefixing functions will fix this problem though, because the “name” still needs to map to the LIB, and if you’re using your own LIB that will still result in compiler errors, not? Ultimately we all need to change our templates to use the Clarion LIBs where applicable in 9058 and later.
Cheers,
Gary.
Hi Guys,
We’re still using Clarion 6.9056 for our APPs. For those who need to compile Organize365 using 9058, I’ve modified the C6.9058 win32.lib file, just replace the existing one with this one.
The download link is: http://www.heldersoft.com/ftp/public/C6_9058_WIN32.zip
This is the full 9058 lib file, with four functions removed: DllRegisterServer, SHGetFolderPathA, DllGetVersion and DllInstall.
Cheers,
Gary.
Thanks guys ,
just saved me as well…
I am not a user of Organize365… so I do not know I may ask this here (but if I do not ask it it is sure that I do not know it…)
Today I updated my Clarion with 9058 update. I now have the duplicate symbol error
It is probably caused by a template (xxPPopup by Seal-soft).
The question: can I use the modified win32.lib ?
Thanks
Hi Piet,
Feel free to use the modified win32.lib, I’m sure it will solve your problem. Let me know if you need anything else..
Best Regards,
Gary.