Build fails in release mode

Bryan Kelly 486 Reputation points
2022-07-17T20:36:26.227+00:00

I am far from expert in VS so please be explicit
Windows 11, Visual Studio 2019, C++

Trying to learn wxWidgets. The basic Hello World file compiles in debug but not in release.
The first few lines look like this.
221557-wxwidget-first-few.png
I have tried changing PATH, and the properties pages
221626-widget-properties.png

For example wxprec.h is found here:

C:\WXWIDGETS\3.2.0\include\wx\wxprec.h

Environment variable WXWIN is set to C:\WXWIDGETS\3.2.0

What needs to be different?

Developer technologies C++
{count} votes

20 answers

Sort by: Most helpful
  1. Bryan Kelly 486 Reputation points
    2022-07-24T02:56:27.177+00:00

    Not seeing any wxWidget anything two additions were made to: Additional Library Directories.
    C:\WXWIDGETS\3.2.0\lib
    C:\WXWIDGETS\3.2.0\lib\vc_dll

    There was no discernable effect.
    I am suspecting it is not looking for libraries. But I don't know where to find those unresolved references. Indeed, as I look some of the error lines, I cannot determine the exact reference that is unresolved.

    If this was Linux, we can create a command line to search all the files and find the one, or many, that contains those specific references. I don't know how to do that in Windows. Maybe write a program that open every stinking file and searches for phrases.


  2. Bryan Kelly 486 Reputation points
    2022-07-24T16:27:26.873+00:00

    I compared your list from vc_dll with this computer. Yours had 23 files, this had about 130 items.
    Delete the library, open ws_vc16 solution, set DLL Debug and Win 32. Clean then Build Solution.

    ========== Build: 24 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

    Directory C:\WXWIDGETS\3.2.0\lib\vc_dll was recreated with 79 items.
    All the files in your list are present. In addition there are many files of the same name with .pdb and some .exp.

    Returned to Hello World, Debug, x86, Clean, Build, same list of errors.
    I don’t care to pay Microsoft every month to keep my stuff on their servers so have never used onedrive. I will look that up and try to find what you mentioned.

    0 comments No comments

  3. Bryan Kelly 486 Reputation points
    2022-07-24T17:39:46.057+00:00

    I am unable to find your post in onedrive. I need assistance there please.

    Let's try to find the core problem. This is the first error message, parsed in an attempt to see the components.
    A few comments are added in an attempt to understand this message.
    The format gets changed a bit, but I added three comments.
    Best guess, it cannot find wxOnAssert

    1>hello_world_10.obj : error LNK2019: unresolved external symbol
    "__declspec declalration specification ?
    (
    dllimport import a dll?
    )
    void __cdecl wxOnAssert the dll to import? find this in a dll somewhere?
    (
    char const *,
    int,
    char const *,
    char const *,
    char const *
    )"

    (
    __imp_?wxOnAssert@@YAXPBDH000@Z
    )
    referenced in function

    "public: __thiscall wxEventFunctorMethod
    <
    class wxEventTypeTag
    <
    class wxCommandEvent
    >,
    class MyFrame,
    class wxCommandEvent,
    class MyFrame
    >
    ::
    wxEventFunctorMethod
    <
    class wxEventTypeTag
    <
    class wxCommandEvent
    >,
    class MyFrame,
    class wxCommandEvent,
    class MyFrame
    >
    (
    void
    (
    __thiscall MyFrame::*
    )
    (class wxCommandEvent &
    ),
    class MyFrame *
    )"
    (
    ??0?$wxEventFunctorMethod@V?$wxEventTypeTag@VwxCommandEvent@@@@VMyFrame@@VwxCommandEvent@@V2@@@QAE@P8MyFrame@@AEXAAVwxCommandEvent@@@ZPAV1@@Z
    )


  4. Bryan Kelly 486 Reputation points
    2022-07-24T21:01:58.323+00:00

    I was unaware of the blocking concept, but it makes sense.
    Opened it up, built it, exactly the same problem.
    I don't know what has gone wrong. The next action is to delete everything in my WX directories, the read and re-read the install instructions. Then write down each step as I do it. When I still have problems, go to the wxWidgets site and post my steps there. Maybe someone will see my errors.

    All in all, I am extremely grateful for the time you have spent working with me and the patience you have shown.

    Thank you very much.

    0 comments No comments

  5. Bryan Kelly 486 Reputation points
    2022-07-29T23:13:09.273+00:00

    I had several problems that seem to have culminated in this thread.
    https://learn.microsoft.com/en-us/answers/questions/941709/environment-variable-is-wrong-in-vs.html?childToView=948280#answer-948280

    Marking this as resolved.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.