wxW311 wxSocket changes Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Natulux
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 242
Joined: Thu Aug 03, 2017 12:20 pm

wxW311 wxSocket changes

Post 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.
Attachments
httprequest.h
(1.91 KiB) Downloaded 63 times
httprequest.cpp
(4.94 KiB) Downloaded 60 times
infoskop-Client-starter.txt
(7.09 KiB) Downloaded 63 times
Manolo
Can't get richer than this
Can't get richer than this
Posts: 827
Joined: Mon Apr 30, 2012 11:07 pm

Re: wxW311 wxSocket changes

Post 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.
Natulux
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 242
Joined: Thu Aug 03, 2017 12:20 pm

Re: wxW311 wxSocket changes

Post 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. ;-)
Manolo
Can't get richer than this
Can't get richer than this
Posts: 827
Joined: Mon Apr 30, 2012 11:07 pm

Re: wxW311 wxSocket changes

Post 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
Natulux
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 242
Joined: Thu Aug 03, 2017 12:20 pm

Re: wxW311 wxSocket changes

Post 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" (?wxEVT_TASKBAR_RIGHT_UP@@3V?$wxEventTypeTag@VwxTaskBarIconEvent@@@@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. ;-)
Last edited by Natulux on Mon Feb 11, 2019 10:47 pm, edited 1 time in total.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxW311 wxSocket changes

Post 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?
Use the source, Luke!
Natulux
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 242
Joined: Thu Aug 03, 2017 12:20 pm

Re: wxW311 wxSocket changes

Post 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!
Post Reply