'link.exe -verbose' noise

34 views
Skip to first unread message

Gisle Vanem

unread,
Mar 11, 2024, 5:09:22 AMMar 11
to wx-users
When linking with "link.exe -debug -verbose ...", I get a large
number of messages like this from MS 'link.exe':

  wxmsw33u.lib(monolib_framecmn.obj) : warning LNK4099: PDB '' was not found with
  'wxmsw33u.lib(monolib_framecmn.obj)' or at ''; linking object as if no debug info

I'd like full debug-info in my .exe.

Adding -libpath:$(WXWIDGETS)/build/msw/vc_mswu to the linker flags
does not help. So what should I do?



Gisle Vanem

unread,
Mar 11, 2024, 5:42:55 AMMar 11
to wx-users

>  Adding -libpath:$(WXWIDGETS)/build/msw/vc_mswu to the linker flags

This was wrong, should be Adding -libpath:$(WXWIDGETS)/build/msw/vc_x64_mswu.
But it didn't help with the problem either.

Vadim Zeitlin

unread,
Mar 11, 2024, 11:20:49 AMMar 11
to wx-u...@googlegroups.com
On Mon, 11 Mar 2024 02:09:21 -0700 (PDT) 'Gisle Vanem' via wx-users wrote:

GV> When linking with "*link.exe -debug -verbose ..."*, I get a large
GV> number of messages like this from MS 'link.exe':
GV>
GV> * wxmsw33u.lib(monolib_framecmn.obj) : warning LNK4099: PDB '' was not
GV> found with 'wxmsw33u.lib(monolib_framecmn.obj)' or at ''; linking object
GV> as if no debug info*
GV> I'd like full debug-info in my .exe.

How do you build the library and your application? Have you already tried
rebuilding everything? Normally you shouldn't have to do anything and it
should just work. Clearly it doesn't in your case, but it's very difficult
to know why without having any idea of what you're doing.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/

Gisle Vanem

unread,
Mar 12, 2024, 2:04:39 AMMar 12
to wx-u...@googlegroups.com
Vadim Zeitlin wrote:

> On Mon, 11 Mar 2024 02:09:21 -0700 (PDT) 'Gisle Vanem' via wx-users wrote:
>
> GV> When linking with "*link.exe -debug -verbose ..."*, I get a large
> GV> number of messages like this from MS 'link.exe':
> GV>
> GV> * wxmsw33u.lib(monolib_framecmn.obj) : warning LNK4099: PDB '' was not
> GV> found with 'wxmsw33u.lib(monolib_framecmn.obj)' or at ''; linking object
> GV> as if no debug info*
> GV> I'd like full debug-info in my .exe.
>
> How do you build the library and your application? Have you already tried
> rebuilding everything? Normally you shouldn't have to do anything and it
> should just work. Clearly it doesn't in your case, but it's very difficult
> to know why without having any idea of what you're doing.

I build wxWidgets using the Makefile.vc files. But cleaning
everything and rebuilding with the 'x64 cl.exe' first in my PATH:

cd build\msw
nmake -f Makefile.vc TARGET_CPU=x64 USE_OPENGL=1 ^
DEBUG_INFO=1 VENDOR= MONOLITHIC=1 BUILD=release ^
SHARED=0 UNICODE=1 clean all

the issue is solved. No more 'LNK4099:' warnings in
my application.

Then I switched to the 'x86 cl.exe' first in my PATH
and rebuilt wxWidgets:

cd build\msw
nmake -f Makefile.vc TARGET_CPU=x86 USE_OPENGL=1 ^
DEBUG_INFO=1 VENDOR= MONOLITHIC=1 BUILD=release ^
SHARED=0 UNICODE=1 clean all

Then rebuilding my application with the 'x64 cl.exe'
first in my PATH, the issue came back?!

So based on 2nd answer here:
https://stackoverflow.com/questions/25843883/how-to-remove-warning-lnk4099-pdb-lib-pdb-was-not-found

I did:
cd %WXWIN%\lib\vc_x64_lib
lib -list wxmsw33u.lib | grep monolib_framecmn\.obj
lib -extract:vc_x64_mswu\monolib_framecmn.obj wxmsw33u.lib
dumpbin -nologo -section:.debug$T monolib_framecmn.obj

I saw no reference to any .PDB-file:

SECTION HEADER #5F9
.debug$T name
0 physical address
0 virtual address
58 size of raw data
57323 file pointer to raw data (00057323 to 0005737A)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
42100040 flags
Initialized Data
Discardable
1 byte align
Read Only

Summary

58 .debug$T

There should be a RAW section with the .PDB-name.
Hence the LNK4099 warning.

So it seems the x86 build overwrites some .PDB-files
from the x64 build.

--
--gv

Vadim Zeitlin

unread,
Mar 12, 2024, 1:15:33 PMMar 12
to wx-u...@googlegroups.com
On Tue, 12 Mar 2024 07:04:29 +0100 'Gisle Vanem' via wx-users wrote:

GV> I build wxWidgets using the Makefile.vc files. But cleaning
GV> everything and rebuilding with the 'x64 cl.exe' first in my PATH:
GV>
GV> cd build\msw
GV> nmake -f Makefile.vc TARGET_CPU=x64 USE_OPENGL=1 ^
GV> DEBUG_INFO=1 VENDOR= MONOLITHIC=1 BUILD=release ^
GV> SHARED=0 UNICODE=1 clean all
GV>
GV> the issue is solved. No more 'LNK4099:' warnings in
GV> my application.
GV>
GV> Then I switched to the 'x86 cl.exe' first in my PATH
GV> and rebuilt wxWidgets:
GV>
GV> cd build\msw
GV> nmake -f Makefile.vc TARGET_CPU=x86 USE_OPENGL=1 ^
GV> DEBUG_INFO=1 VENDOR= MONOLITHIC=1 BUILD=release ^
GV> SHARED=0 UNICODE=1 clean all
GV>
GV> Then rebuilding my application with the 'x64 cl.exe'
GV> first in my PATH, the issue came back?!

Sorry, but I don't understand why would you be mixing different compilers,
this seems to be just asking for trouble. In any case, I'd recommend:

1. Using msbuild.exe instead of nmake to build wxWidgets (if nothing else,
this is going to be at least 10 times faster on any modern machine).
2. If you really need to use nmake, at least don't change paths in the
middle, but do it from x64 command line prompt window.
Reply all
Reply to author
Forward
0 new messages