xtd icon indicating copy to clipboard operation
xtd copied to clipboard

[BUG] debug information not generated for Windows

Open hros opened this issue 1 year ago • 8 comments

Describe the bug

Windows debug information files (*.pdb) not built during installation. This prevents building Debug targets in Visual Studio.

Additionally, a couple of issues with xtdc-gui:

  1. creating an empty console application generates the project, and it builds successfully in Visual Studio (version 17.11). But trying to run or debug the project from Visual Studio results in an error: "Unable to start program .... Access is denied" even though the executable is in a directory under my home directory. I can run the application from the command line.
  2. Since the examples are installed under c:\Program Files (x86), I can't build the examples using my user. I have to open xtdc-gui as administrator (and still can't run them from Visual Studio_

To Reproduce

Steps to reproduce the behavior:

  1. cd \src
  2. git clone https://github.com/gammasoft71/xtd.git
  3. cd xtd
  4. install (using Administrator cmd window)

Expected behaviour

A clear and concise description of what you expected to happen.

Screenshots

snippet of install output wxmsw32ud_core.lib(image.obj) : warning LNK4099: PDB '' was not found with 'wxmsw32ud_core.lib(image.obj)' or at ''; li nking object as if no debug info [C:\src\xtd\build\tools\guidgen-gui\guidgen-gui.vcxproj] wxmsw32ud_core.lib(dpycmn.obj) : warning LNK4099: PDB '' was not found with 'wxmsw32ud_core.lib(dpycmn.obj)' or at ''; linking object as if no debug info [C:\src\xtd\build\tools\guidgen-gui\guidgen-gui.vcxproj] wxmsw32ud_core.lib(settings.obj) : warning LNK4099: PDB '' was not found with 'wxmsw32ud_core.lib(settings.obj)' or at ''; linking object as if no debug info [C:\src\xtd\build\tools\guidgen-gui\guidgen-gui.vcxproj] wxmsw32ud_core.lib(imaglist.obj) : warning LNK4099: PDB '' was not found with 'wxmsw32ud_core.lib(imaglist.obj)' or at ''; linking object as if no debug info [C:\src\xtd\build\tools\guidgen-gui\guidgen-gui.vcxproj] wxmsw32ud_core.lib(appcmn.obj) : warning LNK4099: PDB '' was not found with 'wxmsw32ud_core.lib(appcmn.obj)' or at ''; linking object as if no debug info [C:\src\xtd\build\tools\guidgen-gui\guidgen-gui.vcxproj] wxmsw32ud_core.lib(app.obj) : warning LNK4099: PDB '' was not found with 'wxmsw32ud_core.lib(app.obj)' or at ''; linkin g object as if no debug info [C:\src\xtd\build\tools\guidgen-gui\guidgen-gui.vcxproj] wxmsw32ud_core.lib(imagall.obj) : warning LNK4099: PDB '' was not found with 'wxmsw32ud_core.lib(imagall.obj)' or at '' ; linking object as if no debug info [C:\src\xtd\build\tools\guidgen-gui\guidgen-gui.vcxproj] wxmsw32ud_core.lib(settcmn.obj) : warning LNK4099: PDB '' was not found with 'wxmsw32ud_core.lib(settcmn.obj)' or at '' ; linking object as if no debug info [C:\src\xtd\build\tools\guidgen-gui\guidgen-gui.vcxproj] wxmsw32ud_core.lib(fontenumcmn.obj) : warning LNK4099: PDB '' was not found with 'wxmsw32ud_core.lib(fontenumcmn.obj)' or at ''; linking object as if no debug info [C:\src\xtd\build\tools\guidgen-gui\guidgen-gui.vcxproj] wxmsw32ud_core.lib(brush.obj) : warning LNK4099: PDB '' was not found with 'wxmsw32ud_core.lib(brush.obj)' or at ''; li nking object as if no debug info [C:\src\xtd\build\tools\guidgen-gui\guidgen-gui.vcxproj] wxmsw32ud_core.lib(rgncmn.obj) : warning LNK4099: PDB '' was not found with 'wxmsw32ud_core.lib(rgncmn.obj)' or at ''; wxjpegd.lib(jdmaster.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jdmaster.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jmemnobs.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jmemnobs.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jcmaster.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jcmaster.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jcmainct.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jcmainct.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jcprepct.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jcprepct.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jccoefct.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jccoefct.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jccolor.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jccolor.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jcsample.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jcsample.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jcdctmgr.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jcdctmgr.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jchuff.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jchuff.obj)' or at ''; linking object as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jcarith.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jcarith.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jdmainct.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jdmainct.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jdcoefct.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jdcoefct.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jdpostct.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jdpostct.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jdhuff.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jdhuff.obj)' or at ''; linking object as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jdarith.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jdarith.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jddctmgr.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jddctmgr.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jdsample.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jdsample.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jdcolor.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jdcolor.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jquant1.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jquant1.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jquant2.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jquant2.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jdmerge.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jdmerge.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jfdctint.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jfdctint.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jfdctfst.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jfdctfst.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jfdctflt.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jfdctflt.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jaricom.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jaricom.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jidctint.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jidctint.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jidctfst.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jidctfst.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxjpegd.lib(jidctflt.obj) : warning LNK4099: PDB '' was not found with 'wxjpegd.lib(jidctflt.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxzlibd.lib(inflate.obj) : warning LNK4099: PDB '' was not found with 'wxzlibd.lib(inflate.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxzlibd.lib(deflate.obj) : warning LNK4099: PDB '' was not found with 'wxzlibd.lib(deflate.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxzlibd.lib(adler32.obj) : warning LNK4099: PDB '' was not found with 'wxzlibd.lib(adler32.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxzlibd.lib(crc32.obj) : warning LNK4099: PDB '' was not found with 'wxzlibd.lib(crc32.obj)' or at ''; linking object a s if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxzlibd.lib(zutil.obj) : warning LNK4099: PDB '' was not found with 'wxzlibd.lib(zutil.obj)' or at ''; linking object a s if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxzlibd.lib(inftrees.obj) : warning LNK4099: PDB '' was not found with 'wxzlibd.lib(inftrees.obj)' or at ''; linking ob ject as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxzlibd.lib(inffast.obj) : warning LNK4099: PDB '' was not found with 'wxzlibd.lib(inffast.obj)' or at ''; linking obje ct as if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] wxzlibd.lib(trees.obj) : warning LNK4099: PDB '' was not found with 'wxzlibd.lib(trees.obj)' or at ''; linking object a s if no debug info [C:\src\xtd\build\tools\keycodes\keycodes.vcxproj] keycodes.vcxproj -> C:\src\xtd\build\tools\keycodes\Debug\keycodes.exe Building Custom Rule C:/src/xtd/tools/set_environment_variable/CMakeLists.txt

Desktop (please complete the following information)

  • OS: Windows 11
  • Version: 23H2
  • xtd version: #master

Additional context

Add any other context about the problem here.

Workaround

Add a workaround if there is one here.

hros avatar Aug 27 '24 10:08 hros

Hi,

You are right, when wxwidgets (the actual default backend used by xtd) is generated and installed with CMake, the .pdb files are not copied with the .lib files. (See the issue in wxWidgets).

Remarks

The backend wxWidgets will be replaced by Win32 backend in the future (see roadmap for more information).

For points 1. and 2. I will install an xtd on a new Windows 11 VM and check the behaviors with xtdc-gui and xtdc. On my current VM it works normally. I'll get back to you when I'm done.

gammasoft71 avatar Aug 28 '24 13:08 gammasoft71

Thanks for your prompt reply and your hard work I hope that the Windows issues will be resolved. I want to practice using Visual Studio as a C++ development environment.

In the meantime, I'll use either the Mac or Linux versions of xtd, and go over the examples.

hnnq avatar Aug 28 '24 13:08 hnnq

Hi again,

For point 1, are you sure you've selected the right target? By default, the ALL_BUILD target is selected. Right-click on the console_app1 project and select Set as Startup Project and press F5 to run the project in debug mode.

gammasoft71 avatar Aug 28 '24 13:08 gammasoft71

As far as the wxWidgets pdb files are concerned, don't let this stop you from working on and debugging your project and, if necessary, xtd. After all, wxWidgets isn't accessible through xtd anyway, it's just a backend.

image

gammasoft71 avatar Aug 28 '24 13:08 gammasoft71

thanks. that did the trick... I never used Visual Studio before (mostly VS Code and vim) Is there a way to do it automatically, or should I set the startup project manually for each new project?

hros avatar Aug 28 '24 20:08 hros

Visual Studio can manage multiple projects in a single solution. CMake can also manage multiple projects within a single project. The same applies to VS Code and Xcode with CMake projects.

There's no way of choosing the startup project other than manually.

With Visual Studio, the 'ALL_BUILD' meta-project is always defined by default when a project is generated with CMake.

gammasoft71 avatar Aug 28 '24 21:08 gammasoft71

For your information, I found the problem when xtdc-gui tries to open a selected xtd example. The problem comes from the new version of CMake, since version 3.30, it generates the configuration types MinSizeRel and RelWithDebInfo. And generates errors for these configurations. The process is stopped before launching Visual Studio with the selected example.

I'll continue my research and let you know when I've found a solution.

gammasoft71 avatar Aug 28 '24 21:08 gammasoft71

For point 2. of your questions. You're right you can't edit and use the xtd examples installed under c:\Program Files (x86)\xtd\share\xtd\examples. This is to ensure that the examples are not corrupted by mistake.

To run / manipulate / modify examples, you have several options:

  • Easy mode - Use xtdc-gui which will make a copy of the desired example in your system's temporary folder. It will automatically open the exaple in the default IDE.
  • Medium mode - Copy the desired example yourself into the folder of your choice. Open a terminal, move to the folder where you copied the example and execute the following command:
xtdc open .
  • Expert mode - Copy the example yourself to the folder of your choice. Open a terminal, move to the folder where you copied the example and execute the following command (or use CMake gui) and then open the example yourself in the associated IDE:
mkdir build && cd build
cmake .. -G "the generator you want"

[!CAUTION] The xtdc-gui application was not working for opening examples. I have corrected this in commit 55cc14e You need to reinstall xtd to benefit from xtdc-gui functionality.

This issue has been fixed. Please let me know if it works for you now.

gammasoft71 avatar Aug 29 '24 11:08 gammasoft71