Page 1 of 1

Moving a project to Windows 7

Posted: Mon May 13, 2013 4:00 pm
by KZ
Hello everyone

This is my first post here. I tried to find a solution to my problem but... I don't even know exactly where to search.

I have some code that compiles and works fine on my Windows Vista desktop with wxWidgets2.8.12 and Mingw Gcc 4.4. I want to make it work on my new Windows 7 desktop.
As I was changing computer, I had to reinstall everything (Code::Blocks, gcc, wxWidgets, SFML... all I worked with on my old computer). I decided to use newer tools and installed TDM-GCC 4.7.1 32bits.
I compiled the wxWidgets 2.8.12 library with the tdm gcc compiler with this code line :
mingw32-make.exe -f makefile.gcc BUILD=release MONOLITHIC=0 UNICODE=1 SHARED=0 USE_OPENGL=1 USE_ODBC=1 USE_QA=1
and then the same with BUILD=debug.

I also installed a toolchain to compile for 64bit Windows, but I didn't put it in my Path variable, and the errors occur while 32bit compiling.

My code doesn't use at all the Yield function, but it doesn't compile and I get the following errors:

Code: Select all

C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|230|error: macro "Yield" passed 1 arguments, but takes just 0|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|406|error: macro "Yield" passed 1 arguments, but takes just 0|
C:\Devlogs\wxWidgets-2.8.12\include\wx\msw\app.h|38|error: macro "Yield" passed 1 arguments, but takes just 0|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|230|warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|230|error: 'Yield' declared as a 'virtual' field|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|230|error: expected ';' at end of member declaration|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|230|warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|230|error: expected primary-expression before 'return'|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|230|error: expected '}' before 'return'|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|230|warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|230|error: cannot convert '<brace-enclosed initializer list>' to 'bool' in initialization|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|230|error: expected ';' before 'return'|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|406|warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]|
C:\Devlogs\wxWidgets-2.8.12\include\wx\app.h|406|error: 'Yield' declared as a 'virtual' field|
C:\Devlogs\wxWidgets-2.8.12\include\wx\msw\app.h|38|error: 'Yield' declared as a 'virtual' field|
||=== Build finished: 11 errors, 6 warnings (0 minutes, 1 seconds) ===|
I first installed Mingw GCC4.4 and I got the same errors.

Can somebody help me finding what I did wrong?

Thanks for reading me and sorry for my bad English...

Re: Moving a project to Windows 7

Posted: Sun Jun 09, 2013 7:37 pm
by eranon
Hello. Sounds like this thread : http://forums.wxwidgets.org/viewtopic.php?f=23&t=34225. So, maybe you should try to build a minimal sample from the wxWidgets ones first.

Re: Moving a project to Windows 7

Posted: Tue Jun 11, 2013 12:41 pm
by eranif
The problem is that Windows already has Yield defined somewhere... but it is also a function in wxApp.

To avoid this error, change the include order:
Make sure that <wx/app.h> is included before any Windows' include files

Eran

Re: Moving a project to Windows 7

Posted: Tue Jun 18, 2013 4:21 pm
by stahta01
Make sure you never use the header windows.h in your code.

For the reason why read the technotes in wxWidgets.

docs/tech/tn0019.txt

You can replace the include of "windows.h" with "wx/msw/wrapwin.h"

Tim S.

Re: Moving a project to Windows 7

Posted: Tue Jun 10, 2014 7:10 pm
by Y_cant_i
Hi

Did you resolve this after? If so could you share your secret?

I'm not using wx within in an app just using its text functionality and I get the same problems.

Cheers