NO

Author Topic: Linker 6.0.1 fails to open fullpath/file.lib  (Read 2733 times)

sapero

  • Guest
Linker 6.0.1 fails to open fullpath/file.lib
« on: August 25, 2010, 08:39:54 PM »
It happended today. When specifying a valid, full path to library file in linker's command line, the linker is ignoring the path, and starts to search for the extracted file name in additional search directories (filemon tool from Sysinternals is showing this).
Final linker message:
Code: [Select]
POLINK: fatal error: File not found: 'sdkincludes.lib'.
My Full command line is

"D:\Aurora\projects\aurora ide\bin\polink.exe" "/LIBPATH:D:\Aurora\projects\aurora ide\libs\Ebasic" "/LIBPATH:D:\Aurora\projects\aurora ide\libs" /machine:x86 /nologo /map /nodefaultlib:crt.lib crtdll.lib oleaut32.lib /ALTERNATENAME:_sprintf=sprintf /ALTERNATENAME:_swprintf=swprintf /ALTERNATENAME:__strnicmp=_strnicmp /ALTERNATENAME:__hypot=_hypot /ALTERNATENAME:_strncpy=strncpy /ALTERNATENAME:_memcmp=memcmp /subsystem:windows /base:0x400000 /entry:_main "/out:D:\Aurora\projects\aurora ide\Projects\CHotkeysEditor.exe" ebstd.lib kernel32.lib user32.lib gdi32.lib advapi32.lib comctl32.lib ole32.lib uuid.lib shell32.lib Comdlg32.lib olepro32.lib D:\EBDev\libs\winmain.o winmm.lib dinput2.lib eb3d.lib ebdb.lib "D:\Aurora\projects\aurora ide\libs\sdk\uuid.lib" eb2d.lib urlmon.lib "D:\Aurora\projects\aurora ide\libs\custom\sdkincludes.lib" "D:\Aurora\projects\aurora ide\Projects\CHotkeysEditor.obj" ws2_32.lib odbc32.lib CHotkeysEditor_demo.res version.lib Msimg32.lib _crtdll.lib Mswsock.lib dx3d9r.lib "D:\Aurora\projects\aurora ide\Projects\CHotkeysEditor.res" controlpak.lib

As you see, the file "sdkincludes.lib" is specified using a full path. All the directories and files exists.

This is my log from Filemon:

// the IDE is searching for sdkincludes.lib in known locations, to generate full path for the linker
1 20:04:31 adev2.exe:1928 QUERY INFORMATION D:\Aurora\projects\aurora ide\Projects\custom\sdkincludes.lib PATH NOT FOUND Attributes: Error
2 20:04:31 adev2.exe:1928 QUERY INFORMATION D:\Aurora\projects\aurora ide\libs\Ebasic\custom\sdkincludes.lib PATH NOT FOUND Attributes: Error
3 20:04:31 adev2.exe:1928 QUERY INFORMATION D:\Aurora\projects\aurora ide\libs\custom\sdkincludes.lib SUCCESS Attributes: A
// linker part
4 20:04:31 polink.exe:1596 OPEN D:\AURORA\PROJECTS\AURORA IDE\LIBS\CUSTOM\SDKINCLUDES.LIB SUCCESS Options: Open Access: All
5 20:04:31 polink.exe:1596 QUERY INFORMATION D:\AURORA\PROJECTS\AURORA IDE\LIBS\CUSTOM\SDKINCLUDES.LIB SUCCESS Length: 470484
6 20:04:31 polink.exe:1596 DIRECTORY D:\Aurora\projects\aurora ide\libs\custom\ SUCCESS FileBothDirectoryInformation: sdkincludes.lib
7 20:04:31 polink.exe:1596 OPEN D:\Aurora\projects\aurora ide\libs\custom\sdkincludes.lib SUCCESS Options: Open Access: All
8 20:04:31 polink.exe:1596 QUERY INFORMATION D:\Aurora\projects\aurora ide\libs\custom\sdkincludes.lib SUCCESS Length: 470484
9 20:04:32 polink.exe:1596 DIRECTORY D:\Aurora\projects\aurora ide\Projects\ NO SUCH FILE FileBothDirectoryInformation: sdkincludes.lib
10 20:04:32 polink.exe:1596 DIRECTORY D:\Aurora\projects\aurora ide\libs\ NO SUCH FILE FileBothDirectoryInformation: sdkincludes.lib
11 20:04:32 polink.exe:1596 DIRECTORY D:\Aurora\projects\aurora ide\libs\Ebasic\ NO SUCH FILE FileBothDirectoryInformation: sdkincludes.lib
12 20:04:32 polink.exe:1596 DIRECTORY D:\Aurora\projects\aurora ide\Projects\ NO SUCH FILE FileBothDirectoryInformation: sdkincludes.lib
13 20:04:32 polink.exe:1596 CLOSE D:\Aurora\projects\aurora ide\libs\custom\sdkincludes.lib SUCCESS

4,7 - linker opened the file
9,10,11,12 - linker is searching for sdkincludes.lib. Why?

My temporary solution: add /libs/custom to additional linker search paths.
I was sure, when you specify a full path to a libray, the linker will not search for the file in other locations. Is this true for Polink?

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Linker 6.0.1 fails to open fullpath/file.lib
« Reply #1 on: August 27, 2010, 09:07:30 AM »
What happens if you put /NODEFAULTLIB to polink.exe commandline ?
Is it possible that there is reference to sdkincludes.lib some of those objs or libs from #pragma lib or #pragma comment(lib ,) ?
« Last Edit: August 27, 2010, 09:10:20 AM by timovjl »
May the source be with you

sapero

  • Guest
Re: Linker 6.0.1 fails to open fullpath/file.lib
« Reply #2 on: August 28, 2010, 02:42:18 AM »
The compiler I'm trying to interface with PoLink, does not create .drectve sections, instead it writes all the dependencies to a separate text file.

But you gave me really accurate direction, the sdkincludes library and startup objects contained .drectve section, where "sdkincludes.lib" string was present.

/nodefaultlib does not help, even if specified as the first switch. I need to rebuild some object files and then update libraries, or just keep passing additional directory to the linker.

So I think my problem is solved, thank you for this ideal hint.