Build Error: 'FromDIP' is not a member of 'wxWindow'

Post here wxCrafter related issues / features / bugs
john.f.staples
CodeLite Curious
Posts: 4
Joined: Wed Feb 22, 2017 4:30 pm
Genuine User: Yes
IDE Question: C++
Contact:

Build Error: 'FromDIP' is not a member of 'wxWindow'

Post by john.f.staples »

Greetings:
I hope my question is not so obvious as to embarrass me; I'm sure it is not so difficult as to overly challenge the group members!

Codelite Version 10.0.2 (NOT self compiled)
Windows 10 Home Edition Version 1607 on a Dell Inspiron 13 (i7)
tdm64-gcc-4.9.2-3
wxWidgets 3.1.0 (precompiled, from wxWidgets-3.1-TDM-GCC-4.9.2_amd64.7z)

Following the tutorial at http://codelite.org/LiteEditor/WxCrafterDVCCustomModel:

I get a : error: 'FromDIP' is not a member of 'wxWindow'

Code: Select all

C:\WINDOWS\system32\cmd.exe /C C:/TDM-GCC-64/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ TestDataViewCtrl - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl'
C:/TDM-GCC-64/bin/g++.exe  -c  "C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/main.cpp" -g -O0 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1/lib/gcc_dll/mswu -IC:/wxWidgets-3.1/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0  -fno-keep-inline-dllexport -std=c++11    -o ./Debug/main.cpp.o -I. -I.
C:/TDM-GCC-64/bin/g++.exe  -c  "C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/MainFrame.cpp" -g -O0 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1/lib/gcc_dll/mswu -IC:/wxWidgets-3.1/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0  -fno-keep-inline-dllexport -std=c++11    -o ./Debug/MainFrame.cpp.o -I. -I.
C:/TDM-GCC-64/bin/g++.exe  -c  "C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/wxcrafter.cpp" -g -O0 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1/lib/gcc_dll/mswu -IC:/wxWidgets-3.1/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0  -fno-keep-inline-dllexport -std=c++11    -o ./Debug/wxcrafter.cpp.o -I. -I.
In file included from C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/wxcrafter.cpp:7:0:
C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/wxcrafter.cpp: In constructor 'MainFrameBaseClass::MainFrameBaseClass(wxWindow*, wxWindowID, const wxString&, const wxPoint&, const wxSize&, long int)':
C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/wxcrafter.h:36:25:[color=#FF0000] error: 'FromDIP' is not a member of 'wxWindow'[/color]
 #define WXC_FROM_DIP(x) wxWindow::FromDIP(x, NULL)
                         ^
C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/wxcrafter.cpp:31:46: note: in expansion of macro 'WXC_FROM_DIP'
     boxSizer1->Add(m_mainPanel, 1, wxEXPAND, WXC_FROM_DIP(5));
                                              ^
C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/wxcrafter.h:36:25:[color=#FF0000] error: 'FromDIP' is not a member of 'wxWindow'[/color]
 #define WXC_FROM_DIP(x) wxWindow::FromDIP(x, NULL)
                         ^
C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/wxcrafter.cpp:42:54: note: in expansion of macro 'WXC_FROM_DIP'
     boxSizer13->Add(m_dataview15, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5));
                                                      ^
C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/wxcrafter.h:36:25:[color=#FF0000] error: 'FromDIP' is not a member of 'wxWindow'[/color]
 #define WXC_FROM_DIP(x) wxWindow::FromDIP(x, NULL)
                         ^
C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/wxcrafter.cpp:44:106: note: in expansion of macro 'WXC_FROM_DIP'
     m_dataview15->AppendIconTextColumn(_("Name"), m_dataview15->GetColumnCount(), wxDATAVIEW_CELL_INERT, WXC_FROM_DIP(-2), wxALIGN_LEFT);
                                                                                                          ^
C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/wxcrafter.h:36:25:[color=#FF0000] error: 'FromDIP' is not a member of 'wxWindow'[/color]
 #define WXC_FROM_DIP(x) wxWindow::FromDIP(x, NULL)
                         ^
C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl/wxcrafter.cpp:45:109: note: in expansion of macro 'WXC_FROM_DIP'
     m_dataview15->AppendTextColumn(_("Description"), m_dataview15->GetColumnCount(), wxDATAVIEW_CELL_INERT, WXC_FROM_DIP(-2), wxALIGN_LEFT);
                                                                                                             ^
mingw32-make.exe[1]: *** [Debug/wxcrafter.cpp.o] Error 1
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
TestDataViewCtrl.mk:116: recipe for target 'Debug/wxcrafter.cpp.o' failed
mingw32-make.exe: *** [All] Error 2
mingw32-make.exe[1]: Leaving directory 'C:/2017FEB/25Sat/wxDataViewCtrl_1118/wxDataViewCtrl/TestDataViewCtrl'
Makefile:4: recipe for target 'All' failed
====5 errors, 5 warnings====

Thanks for your help!
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Build Error: 'FromDIP' is not a member of 'wxWindow'

Post by eranif »

This is strange, since wxWindow::FromDIP is new since wxWidgets 3.1
See this: http://docs.wxwidgets.org/3.1/classwx_w ... a1100b0dc5

So I am not sure why your compiler complains about it..it sounds like a broken installation to me.
My advise: download and build wxWidgets by yourself. It's an easy task,
see our wiki page on how to build wxWidgets for Windows:

http://codelite.org/Developers/BuildingWxWidgetsWin

Also, can you open the file:

C:\wxWidgets-3.1\include\wx\window.h and search for the string 'FromDIP' ?

Thanks
Make sure you have read the HOW TO POST thread
john.f.staples
CodeLite Curious
Posts: 4
Joined: Wed Feb 22, 2017 4:30 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Build Error: 'FromDIP' is not a member of 'wxWindow'

Post by john.f.staples »

Thank you for the quick reply. I have tried and tried to compile wxWidgets and can't quite make it. I will try again and post my issues (if any).
Editor search for "FromDIP" in C:\wxWidgets-3.1\include\wx\window.h came up empty.
Thanks,
John
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Build Error: 'FromDIP' is not a member of 'wxWindow'

Post by eranif »

Where did you get your sources from? Can you post the steps to how you installed wxWidgets?
I think its worth checking this out and report back to the wx-dev team
Make sure you have read the HOW TO POST thread
john.f.staples
CodeLite Curious
Posts: 4
Joined: Wed Feb 22, 2017 4:30 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Build Error: 'FromDIP' is not a member of 'wxWindow'

Post by john.f.staples »

Thank you again Eran. I'm a beginner, but think the issue is something with the "mingw32-make -f makefile.gcc setup_h " step.

In the wiki page http://codelite.org/Developers/BuildingWxWidgetsWin , the instructions are to ".... open the file: \path\to\wxwidgets\lib\gcc_dll\mswud\wx\setup.h and change line 784 (ish) ... " but after successfully executing mingw32-make -f makefile.gcc setup_h there is no ...\lib\gcc_dll directory. There is only a ..\lib\gcc_lib directory.

When I go ahead and issue mingw32-make -j4 -f Makefile.gcc SHARED=1 UNICODE=1 BUILD=release VENDOR=cl CXXFLAGS="-fno-keep-inline-dllexport -std=c++11" MONOLITHIC=1
(I changed-j8 to -j4 on my setup) the build seemingly succeeds from the command prompt output. However, when I try to test it by building samples\minimal there is an issue running the resulting minimal.exe file: "The program can't start because wxmsw311ud_gcc_cl.dll is missing from your computer" However, the wxmsw311ud_gcc_cl.dll file was created. Somehow, I believe there something amiss with "mingw32-make -f makefile.gcc setup_h "

Finally, I am able to run my wxCrafter tutorial now. I compiled without the SHARED=1 option. Does this mean that I'll have more files to transfer to get this to run on another computer?

Regards,
John
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Build Error: 'FromDIP' is not a member of 'wxWindow'

Post by eranif »

However, when I try to test it by building samples\minimal there is an issue running the resulting minimal.exe file: "The program can't start because wxmsw311ud_gcc_cl.dll is missing from your computer"
You need to copy this DLL from the lib folder and place it near the executable you try to run OR
add the path to the DLL folder to the PATH environment variable in CodeLite. This can be done like this:
Settings->Environment variables and add this line:

Code: Select all

PATH=$PATH;C:\path\to\dll\folder
Finally, I am able to run my wxCrafter tutorial now. I compiled without the SHARED=1
This means that you have built it statically and not as shared object ("DLL")
Does this mean that I'll have more files to transfer to get this to run on another computer?
No, the opposite: you will need to supply less files (but your executable will be larger in size)
Make sure you have read the HOW TO POST thread
john.f.staples
CodeLite Curious
Posts: 4
Joined: Wed Feb 22, 2017 4:30 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Build Error: 'FromDIP' is not a member of 'wxWindow'

Post by john.f.staples »

Thanks again for the answers.

Everything is working.!
Post Reply