Author Topic: Upgrading to wxWidgets 3.1.3  (Read 10835 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #30 on: February 26, 2020, 12:45:08 am »
In "Global compiler settings" the compiler is set for "TDM-GCC-64". Is that the wrong one? I attempted change it to "GNU GCC Compiler". But I find that after I close "Global compiler settings" by clicking on "OK", and then reopen it, that it has, all on its own, reverted to  "TDM-GCC-64". However  "GNU GCC Compiler" does show as the compiler in "Project => Build options..."

When you change the default compiler you need to select the Compiler in Global Settings and click on "Set as Default" button.

Tim S.
 
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
Re: Upgrading to wxWidgets 3.1.3
« Reply #31 on: February 26, 2020, 03:35:27 am »
Changing to  "TDM-GCC-64" in "Project -> Build Options" did it. The compiler is working now.

There still needs to be and adjustment made to the Linker. I get many errors of the form:
Code
C:\Engineering_Software\TIA Designer\src\JunctionCap.cpp|332|undefined reference to `__imp__ZN11wxGridfData13UpdateDisplayEii'|


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #32 on: February 26, 2020, 04:40:41 am »
Without a build log I can not help you.
Edit: Include at most 12 linker error after the linker command.

You are likely missing a library or linking the libraries in the wrong order.

Tim S.
« Last Edit: February 26, 2020, 04:48:22 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
Re: Upgrading to wxWidgets 3.1.3
« Reply #33 on: February 26, 2020, 05:01:38 am »
I re-enabled precompiled headers, and cleaned the project. I only get one error:

Code
||=== Build: Debug in TIA Designer (compiler: TDM-GCC-64) ===|
||error: ld returned 1 exit status|
||=== Build failed: 1 error(s), 0 warning(s) (1 minute(s), 41 second(s)) ===|

There is no message here about what the error was. Maybe there is a clue in the warning messages. There are 308 warnings. This same code compiled and ran before I upgraded from wxWidgets 3.1.2 to 3.1.3, and I did not get these warnings. The below snippet of them shows only one of each error type. For each line in this snippet there are actually many more of same error.

Code
C:\Engineering_Software\TIA Designer\src\wxComboBoxDataFilePD.cpp|16|warning: 'void wxComboBoxDataFilePD::InitDataPointers(PhotoDiode*)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]|
C:\Engineering_Software\TIA Designer\src\wxComboBoxDataFilePD.cpp|141|warning: 'void wxComboBoxDataFilePD::UpdateDisplayFromDataFile()' redeclared without dllimport attribute after being referenced with dll linkage|
C:\Engineering_Software\TIA Designer\TIA_DesignerMain.cpp|1026|warning: cast between incompatible pointer to member types from 'void (TIA_DesignerFrame::*)(wxCommandEvent&)' to 'wxObjectEventFunction' {aka 'void (wxEvtHandler::*)(wxEvent&)'} [-Wcast-function-type]|

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #34 on: February 26, 2020, 05:08:55 am »
Without the Compiler command no one can help you!!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #35 on: February 26, 2020, 05:12:01 am »
There is no message here about what the error was. Maybe there is a clue in the warning messages. There are 308 warnings. This same code compiled and ran before I upgraded from wxWidgets 3.1.2 to 3.1.3, and I did not get these warnings. The below snippet of them shows only one of each error type. For each line in this snippet there are actually many more of same error.

I do not believe that! You had no idea what compiler you were using!
You do know that switching from an 32 bit to 64 bit compiler can cause issues!
And, switching compiler versions can cause issues!

I give up I will let someone else waste their time trying to help you!

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: Upgrading to wxWidgets 3.1.3
« Reply #36 on: February 26, 2020, 06:21:30 pm »
This same code compiled and ran before I upgraded from wxWidgets 3.1.2 to 3.1.3, and I did not get these warnings.

No. Your original error was that the project used a non-existent compiler / toolchain and failed to execute a missing binary (the compiler). So you did more than "just" upgrade wxWidgets, the previous code also could not be compiled by a missing compiler. Then you did a lot of random changes that did not solve the original error and now you have a huge mess.

Upgrading wxWidgets is quite simple, especially if it's just a patchlevel upgrade, point to the new root directory (if you not simply replaced the contents of the current one) and do a FULL rebuild. That last step is the most "difficult" one, at least in my setup (CodeBlocks + MSVC) a simple Clean + Build / Rebuild in CodeBlocks does NOT remove everything so i manually delete all outputs (which is quite easy for me, because i do an out-of-tree build, i just delete the output folder, all outputs are inside there). Not sure if it works flawless with your setup, but a good candidate to get missed by the Clean step are precompiled headers.

Your warnings don't look like a x86/x64 mismatch, the linker should detect the architecture and spit out a different error / warning message (IIRC gcc does that on Linux). It looks like a static / dynamic mismatch of wxWidgets, you link the static libraries but the project is setup for dynamic libraries or reversed.

Best thing you can do is a fresh checkout of the last known working revision of your project and restart from there. It looks like your orginal project already is quite messy and contains dead settings and i don't know what else, but only upgrading wxWidgets should be an easy task. You should start with that first. And then you can try to switch the compiler and/or architecture, but for that you should better review the current settings and fix them properly.
« Last Edit: February 26, 2020, 09:11:56 pm by sodev »

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
Re: Upgrading to wxWidgets 3.1.3
« Reply #37 on: February 27, 2020, 01:13:03 am »
I suppressed most warnings. In the build log I see now this:
Code
wx_pch.h.gch\Debug_TIA Designer_wx_pch_h_gch: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (4 minute(s), 19 second(s))

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
Re: Upgrading to wxWidgets 3.1.3
« Reply #38 on: February 27, 2020, 04:17:34 am »
I suppressed most warnings. In the build log I now see this:
Code
wx_pch.h.gch\Debug_TIA Designer_wx_pch_h_gch: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (4 minute(s), 19 second(s))

It is likely the file it complains about was there before, and I missed it, because I payed attention only to what is in red.

I disabled precompiled headers and the above error disappeared. Now there are many other warnings, and errors, that appear in related pairs, such as this:
Code
C:\Engineering_Software\TIA Designer\src\Utilities.cpp|641|warning: 'void wxGridfData::AdjustMinGridHeight()' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]|

C:\Engineering_Software\TIA Designer\src\opamp.cpp|210|undefined reference to `__imp__ZN11wxGridfData19AdjustMinGridHeightEv'|

When I had this compiling in wxWidgets 3.1.2, I did not need to declare anything with dllimport. I did an incorrect change in Code::Blocks configuration to make it expect it. What could that be?
« Last Edit: February 28, 2020, 01:57:20 am by spflanze »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #39 on: February 27, 2020, 04:27:58 am »
On windows, this warning is common and can normally be ignored "redeclared without dllimport attribute: previous dllimport ignored".

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
Re: Upgrading to wxWidgets 3.1.3
« Reply #40 on: February 28, 2020, 04:14:41 am »
Quote
Quote from: sodev on February 22, 2020, 01:54:34 am

Code
Quote from: spflanze on February 22, 2020, 12:22:30 am

    Code: [Select]

    [  5.0%] mingw32-g++.exe -Wall -pipe -mthreads...


This percentage display at the start of line looks unfamiliar for me, usually the CodeBlocks build system doesn't output that. Are you using CMake or so as build system?

This is an option at: Settings => Compiler => Global compiler settings => Build optiuons (tab)
It is the checkbox: "Display build progress percentage in log"