Identifier "wxZipStreamLink" is undefined + unresolved externals Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by Tapsa » Thu Dec 15, 2016 11:23 am

I am trying to build my app using Visual Studio 14. Before I have built it using GCC.
I have built the adv library of wx (which updates 10 targets), then I have added all of the libs into AdditionalDependencies tag as
wxmsw31ud_adv.lib;wxmsw31ud_core.lib;wxbase31ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib
Compilation ends with these errors.
Error (active) identifier "wxZipStreamLink" is undefined Kuvastin c:\Cpp\wxWidgets\include\wx\zipstrm.h 407

Error LNK2001 unresolved external symbols
"void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" ([email protected]@[email protected]@[email protected]) Kuvastin C:\Prog\frame.obj 1
"void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" ([email protected]@[email protected]@[email protected]) Kuvastin C:\Prog\main.obj 1
"bool wxTrapInAssert" ([email protected]@3_NA) Kuvastin C:\Prog\frame.obj 1
"bool wxTrapInAssert" ([email protected]@3_NA) Kuvastin C:\Prog\main.obj 1
"class wxMBConv * wxConvLibcPtr" ([email protected]@[email protected]@A) Kuvastin C:\Prog\frame.obj 1
"class wxMBConv * wxConvLibcPtr" ([email protected]@[email protected]@A) Kuvastin C:\Prog\main.obj 1
"class wxCSConv * wxConvLocalPtr" ([email protected]@[email protected]@A) Kuvastin C:\Prog\frame.obj 1
"wchar_t const * const wxEmptyString" ([email protected]@3PB_WB) Kuvastin C:\Prog\frame.obj 1
"wchar_t const * const wxEmptyString" ([email protected]@3PB_WB) Kuvastin C:\Prog\main.obj 1
"public: static unsigned int const wxString::npos" ([email protected]@@2IB) Kuvastin C:\Prog\frame.obj 1
"public: static unsigned int const wxString::npos" ([email protected]@@2IB) Kuvastin C:\Prog\main.obj 1
"private: static unsigned long wxThread::ms_idMainThread" ([email protected]@@0KA) Kuvastin C:\Prog\frame.obj 1
"private: static bool wxLog::ms_doLog" ([email protected]@@0_NA) Kuvastin C:\Prog\frame.obj 1
"char const * const wxPanelNameStr" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"class wxSize const wxDefaultSize" ([email protected]@[email protected]@B) Kuvastin C:\Prog\frame.obj 1
"class wxPoint const wxDefaultPosition" ([email protected]@[email protected]@B) Kuvastin C:\Prog\frame.obj 1
"class wxDateTime const wxDefaultDateTime" ([email protected]@[email protected]@B) Kuvastin C:\Prog\frame.obj 1
"private: static long const wxDateTime::TIME_T_FACTOR" ([email protected]@@0JB) Kuvastin C:\Prog\frame.obj 1
"class wxAnyValueType * wxAnyNullValueType" ([email protected]@[email protected]@A) Kuvastin C:\Prog\frame.obj 1
"int const wxEVT_NULL" ([email protected]@3HB) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxCommandEvent> const wxEVT_LISTBOX" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxThreadEvent> const wxEVT_THREAD" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxMouseEvent> const wxEVT_LEFT_DOWN" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxMouseEvent> const wxEVT_LEFT_UP" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxMouseEvent> const wxEVT_MIDDLE_DOWN" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxMouseEvent> const wxEVT_LEFT_DCLICK" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxFocusEvent> const wxEVT_SET_FOCUS" ([email protected]@[email protected][email protected]@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxChildFocusEvent> const wxEVT_CHILD_FOCUS" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxNavigationKeyEvent> const wxEVT_NAVIGATION_KEY" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxKeyEvent> const wxEVT_KEY_DOWN" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxCloseEvent> const wxEVT_CLOSE_WINDOW" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxPaintEvent> const wxEVT_PAINT" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxEraseEvent> const wxEVT_ERASE_BACKGROUND" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxTimerEvent> const wxEVT_TIMER" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"class wxValidator const wxDefaultValidator" ([email protected]@[email protected]@B) Kuvastin C:\Prog\frame.obj 1
"char const * const wxFrameNameStr" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"char const * const wxStatusBarNameStr" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"char const * const wxListBoxNameStr" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"char const * const wxStaticTextNameStr" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"char const * const wxTextCtrlNameStr" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxCommandEvent> const wxEVT_TEXT_ENTER" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"char const * const wxDirDialogNameStr" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"char const * const wxDirSelectorPromptStr" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"public: static class wxClassInfo wxDirDialog::ms_classInfo" ([email protected]@@[email protected]@A) Kuvastin C:\Prog\frame.obj 1
"char const * const wxGetTextFromUserPromptStr" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"char const * const wxDirPickerWidgetLabel" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"char const * const wxDirPickerWidgetNameStr" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"char const * const wxDirPickerCtrlNameStr" ([email protected]@3QBDB) Kuvastin C:\Prog\frame.obj 1
"class wxEventTypeTag<class wxFileDirPickerEvent> const wxEVT_DIRPICKER_CHANGED" ([email protected]@[email protected]@@@@B) Kuvastin C:\Prog\frame.obj 1
"protected: static class wxAppConsole * (__cdecl* wxAppConsoleBase::ms_appInitFn)(void)" ([email protected]@@[email protected]@XZA) Kuvastin C:\Prog\main.obj 1
"protected: static class wxAppConsole * wxAppConsoleBase::ms_appInstance" ([email protected]@@[email protected]@A) Kuvastin C:\Prog\main.obj 1

Error LNK1120 46 unresolved externals Kuvastin C:\Prog\Debug\Kuvastin.exe 1
Do these errors ring any bells to you?

catalin
Moderator
Moderator
Posts: 1574
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by catalin » Thu Dec 15, 2016 12:15 pm

Are you getting these with wxW samples or something else?
Tapsa wrote:I have built the adv library of wx
Why only adv library? Maybe you need to build all libs (I'd even go as far as advising you to do a clean build). wxZipStreamLink for example should be in base library.
Tapsa wrote:then I have added all of the libs into AdditionalDependencies tag
Why would you need to add the libs anywhere? wxW provides vc14 build files.

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by Tapsa » Thu Dec 15, 2016 12:30 pm

Are you getting these with wxW samples or something else?
I get a lot of errors with even minimal sample. (setup header is still not properly included in sample project files.) This is my own application that compiles fine with GCC. I want to compile it with Visual Studio too.
Why only adv library?
I did in fact build base, core and adv. I just noticed that building adv builds the others (that I should need) anyway.
wxZipStreamLink indeed should be in the base library.
Why would you need to add the libs anywhere?
Erm. Because its my own application?

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2434
Joined: Sun Jan 03, 2010 5:45 pm

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by PB » Thu Dec 15, 2016 12:43 pm

Tapsa wrote:I get a lot of errors with even minimal sample. (setup header is still not properly included in sample project files.)
If you cannot even build the provided minimal sample, it seems obvious that you did not build wxWidgets properly. I would start there.

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by Tapsa » Thu Dec 15, 2016 1:06 pm

I cannot build minimal sample with GCC either, yet I can compile my wx applications fine with GCC using CMake.

Code: Select all

mingw32-make -f makefile.gcc
results in
fatal error: wx/setup.h: No such file or directory
If I add include folder for setup header it still fails

Code: Select all

mingw32-make -f makefile.gcc -I C:\Cpp\wxWidgets\lib\gcc_dll\mswud
I can't copy and place the setup header in wxWidgets\include\wx because I am using two different compilers, can I?
So how to fix the setup header problem for 2 compilers?
Adding "C:\Cpp\wxWidgets\lib\mswud" to additional include directories doesn't help MSVC build.

Better yet, what command line you suggest to me for building wxWidgets with GCC?
I have used

Code: Select all

mingw32-make -f makefile.gcc BUILD=debug SHARED=1 USE_AUI=0 USE_PROPGRID=0 USE_RIBBON=0 USE_STC=0 USE_WEBVIEW=0 USE_RICHTEXT=0 USE_XML=0
When I only need adv, core and base for my applications.

For MSVC build I opened the \wxWidgets\build\msw\wx_vc14.sln and chose DLL debug then hit build on adv (+core & base).

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2434
Joined: Sun Jan 03, 2010 5:45 pm

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by PB » Thu Dec 15, 2016 1:46 pm

As catalyn said, be sure to start with a clean build, i.e., no remains of previous builds either in WXWIN\vc_* and WXWIN\gcc_* as well in WXWIN\build\msw\vc_* and WXWIN\build\msw\gcc_*. In fact, if I were you, I would make sure the whole wxWidgets folder is pristine.

Then I would go to build\msw and attempted to do the default build, i.e. something like
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
cd %WXWIN%\build\MSW
nmake -f makefile.vc BUILD=debug SHARED=1
Once this builds successfully, repeat the same procedure for the minimal sample. After verifying I can actually properly build wxWidgets in its default configuration, I would start customizing the build. As MSVC can build wxWidgets rather fast even with the makefile (unlike MinGW), it should not take much time...

I do not know which wxWidgets version are you using, I remember something about 3.0x not supporting MSVC15, but building wxWidgets with MSVC should work out of the box.

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by Tapsa » Thu Dec 15, 2016 2:27 pm

Same problem still happens. I deleted wxWidgets folder, unpacked it all again from 3.1.0 7z file. Then I ran in wxWidgets\build\msw command

Code: Select all

mingw32-make -f makefile.gcc BUILD=debug SHARED=1
Building minimal sample with

Code: Select all

mingw32-make -f makefile.gcc
fails to
.\..\..\include/wx/platform.h:136:22: fatal error: wx/setup.h: No such file or directory
#include "wx/setup.h"

catalin
Moderator
Moderator
Posts: 1574
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by catalin » Thu Dec 15, 2016 2:37 pm

Of course it does. wxW build command contains "SHARED=1", while the one for minimal sample does not.
Use the exact same options (thus command) for building the libs and the apps.

p.s. not specified options take the default value, see config.gcc in your case, and for "SHARED" it happens to be 0.

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by Tapsa » Thu Dec 15, 2016 2:47 pm

xP I didn't know that... now same with Visual Studio, how do I do the default build?

And, how do I build only adv, core and base libs of wxWidgets? Those USE_AUI=0 etc can only ditch half of the libs, but still several useless to me libs are built.

User avatar
doublemax
Moderator
Moderator
Posts: 14891
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by doublemax » Thu Dec 15, 2016 3:10 pm

Why would you want to build only a few libs? Just build the whole project.
Use the source, Luke!

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by Tapsa » Thu Dec 15, 2016 3:18 pm

To conserve space on my little SSD.

Anyway, now realizing that build config needs to be identical, I finally succeeded in building minimal sample as DLL Debug.

EDIT: I can't mark this topic as solved, because I only managed to build and run minimal sample. My own project still has loads of errors and wxFrame is "incomplete type" even after I copied all kinds of settings from minimal sample vcproj file.

I'm giving up on Visual Studio, because it is too hard to come up with working vcproj file.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2434
Joined: Sun Jan 03, 2010 5:45 pm

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by PB » Thu Dec 15, 2016 5:44 pm

Tapsa wrote:I'm giving up on Visual Studio, because it is too hard to come up with working vcproj file.
Actually, if you follow the instructions in install.txt, creating a MSVC wxWidgets project with two configurations (debug and release) takes less then 5 minutes when starting from a scratch (empty project generated by MSVC).

User avatar
doublemax
Moderator
Moderator
Posts: 14891
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by doublemax » Thu Dec 15, 2016 5:50 pm

Actually, if you follow the instructions in install.txt, creating a MSVC wxWidgets project with two configurations (debug and release) takes less then 5 minutes when starting from a scratch (empty project generated by MSVC).
I think it's even easier to just copy the "minimal" sample and adjust the paths (3 for each configuration).
Use the source, Luke!

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2434
Joined: Sun Jan 03, 2010 5:45 pm

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by PB » Thu Dec 15, 2016 6:39 pm

I created a simple MSVC 14 project, linking wxWidgets dynamically (Win32 only, X64 configurations are easy to add). Please note that it uses the "trick" with MSVC autolinking the required wxWidgets libraries (see the end of WXWIN\docs\mswinstall.txt), so there are no libraries manually added there and it keeps working even when the libraries name change (e.g. a different version).

The project also has support for the custom resource file as well as precompiled headers.

It requires the WXWIN environment variable set properly to wxWidgets folder.

The project can be easily switched to linking to wxWidgets statically, all what is needed is to remove WXUSINGDLL from the preprocessor defines in all required build configurations.
Empty MSVC14 DLL project.zip
(7.61 KiB) Downloaded 37 times

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Identifier "wxZipStreamLink" is undefined + unresolved externals

Post by Tapsa » Fri Dec 16, 2016 8:46 am

Thanks for the project, but it doesn't compile. I added WXWIN=C:\Cpp\wxWidgets to system variables.
Immediately upon opening PBApp.sln these errors are shown:
Error (active) cannot open source file "wx/wx.h" PBApp DLL c:\Users\Tapsa\Downloads\Empty MSVC14 DLL project\Precompiled.h 14
Error (active) cannot open source file "wx/wx.h" PBApp DLL c:\Users\Tapsa\Downloads\Empty MSVC14 DLL project\MainWindow.h 5
Error (active) not a class or struct name PBApp DLL c:\Users\Tapsa\Downloads\Empty MSVC14 DLL project\MainWindow.h 7
I have only built DLL Debug/Release of wxWidgets with Visual Studio by the way.

Post Reply