Page 1 of 1

wxW311 wxSocket changes

Posted: Mon Feb 11, 2019 8:53 am
by Natulux
Hey,

does anyone know about changes to the wxSocketBase/wxSocketClient in wxW311?
I am having a rather simple project, using a custom http request class to give information to another app with a socket server running.

Compiling this project with my wxW310 setting everything runs smoothly. But wxW311 has a bunch of linker error complains, mostly about

Code: Select all

wxSockAddress::wxSockAddress(void)
See build log and class files for details.

Best
Natu

EDIT:
Most peculiar. I just copied my test sample project, where this class is coming from, to wxW311 and it does compile. It is not wxSocketBase then, though I dont understand why it wouldn't compile in the other project. I need to get my facts straight here.

Re: wxW311 wxSocket changes

Posted: Mon Feb 11, 2019 1:30 pm
by Manolo
Between wx3.1.0 (Feb 2016) and wx3.1.1 (Feb 2018) there has been some change in the libs needed for Windows target. At least oleacc is required now.

You may take a look at minimal sample project to find out the requiered libraries.

Re: wxW311 wxSocket changes

Posted: Mon Feb 11, 2019 1:48 pm
by Natulux
Manolo wrote:Between wx3.1.0 (Feb 2016) and wx3.1.1 (Feb 2018) there has been some change in the libs needed for Windows target. At least oleacc is required now.

You may take a look at minimal sample project to find out the requiered libraries.
Hey, thank you for your input.
Im am not sure though, if I undersand correctly.
Both minimal samples from 310 and 311 have the same dependencies in my case and my own project has exactly these dependencies and some more.

Code: Select all

wxmsw$(wxShortVersionString)u_core.lib
wxbase$(wxShortVersionString)u.lib
wxtiff.lib
wxjpeg.lib
wxpng.lib
wxzlib.lib
wxregexu.lib
wxexpat.lib
kernel32.lib
user32.lib
gdi32.lib
comdlg32.lib
winspool.lib
winmm.lib
shell32.lib
shlwapi.lib
comctl32.lib
ole32.lib
oleaut32.lib
uuid.lib
rpcrt4.lib
advapi32.lib
version.lib
wsock32.lib
wininet.lib
Or did you talk about something different?

Cheers
Natu

EDIT:
Ah, were you talking about those:
ole32.lib
oleaut32.lib

My compilation of wxWidgets seems to be up to date with new requirements and so is my app. But it was worth checking. ;-)

Re: wxW311 wxSocket changes

Posted: Mon Feb 11, 2019 4:14 pm
by Manolo
wxmsw$(wxShortVersionString)u_core.lib
wxbase$(wxShortVersionString)u.lib
I suppose (wxShortVersionString) is some define for "3.1"

Also, if you use wxSocket, then add wxbase31ud_net.lib (or similar name)

For the system libs, I use the same libs as you, plus these three:
odbc32.lib
opengl32.lib
oleacc.lib

Pay special attention to oleacc.lib

Re: wxW311 wxSocket changes

Posted: Mon Feb 11, 2019 10:22 pm
by Natulux
Hm, strange. The
wxbase31u_net.lib
was actually missing for the socketClient. I wonder why wxWidgets310 wouldn't miss it, though.

Well, I still have some linker errors left:
LNK2001 unresolved external symbol "class wxEventTypeTag<class wxTaskBarIconEvent> const wxEVT_TASKBAR_RIGHT_UP" ([email protected]@[email protected]@@@@B)
.h

Code: Select all

private:
	wxDECLARE_EVENT_TABLE();
.cpp

Code: Select all

wxBEGIN_EVENT_TABLE(MyTaskBarIcon, wxTaskBarIcon)
    //[...]
	EVT_MENU(ID_TASK_BASE_SETTINGS, MyTaskBarIcon::CommandEventHandler)
    EVT_TASKBAR_LEFT_DCLICK  (MyTaskBarIcon::OnLeftButtonDClick)
	EVT_TASKBAR_RIGHT_UP  (MyTaskBarIcon::OnRightButtonUp)
	//[...]
wxEND_EVENT_TABLE()
Is the event table deprecated or something? I use them in several (older) classes, but I get the linker errors only in one class (for now).

Thanks so far
Natu

EDIT:
If I use Bind instead, he complains that "EVT_TASKBAR_LEFT_DCLICK" is not defined. And if I nevertheless go the the definition of it (F12) I get:

taskbar.h

Code: Select all

#define wx__DECLARE_TASKBAREVT(evt, fn) \
    wx__DECLARE_EVT0(wxEVT_TASKBAR_ ## evt, wxTaskBarIconEventHandler(fn))

//[...]
#define EVT_TASKBAR_LEFT_DCLICK(fn)  wx__DECLARE_TASKBAREVT(LEFT_DCLICK, fn)
#define EVT_TASKBAR_RIGHT_DCLICK(fn) wx__DECLARE_TASKBAREVT(RIGHT_DCLICK, fn)
Or I use:

Code: Select all

Bind(wxEVT_TASKBAR_LEFT_DCLICK, &MyTaskBarIcon::OnLeftButtonDClick, this);
... in which case I have the same linker erroras I have with the event table. They are defined properly, as far as I can see, unless I am really missing another lib here.

EDIT2: I was actually missing "wxmsw31u_adv.lib" too. Shame that I had to guess which dependencies I need instead of reading it in the documentation next to the include reminder. At least one can copy all needed libs from the matching sample, which I will do more thorough in future. ;-)

Re: wxW311 wxSocket changes

Posted: Mon Feb 11, 2019 10:43 pm
by doublemax
These are a little too many errors for a switch from 3.1.0 to 3.1.1. Are you sure you're not mixing include files and/or libraries from different versions?

Did you make a clean rebuild of everything?

Re: wxW311 wxSocket changes

Posted: Mon Feb 11, 2019 10:51 pm
by Natulux
doublemax wrote:These are a little too many errors for a switch from 3.1.0 to 3.1.1. Are you sure you're not mixing include files and/or libraries from different versions?

Did you make a clean rebuild of everything?
Yes, I keep wxWidgets versions in different directories and the core libs are included dynamically. Thats why I was hoping I could just copy and run it (like I did in the past), but this time I messed up a little.

Well, it is solved now - thank you guys!