Author Topic: CB with MinGW x64 and wxWidgets: linker can't find wxmsw30  (Read 14893 times)

Offline Searinox

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: CB with MinGW x64 and wxWidgets: linker can't find wxmsw30
« Reply #15 on: December 30, 2015, 09:16:22 pm »
On x32 I can put breakpoints anywhere at any time during runtime and they instantly work... and anyways... I'd expect the break and terminate buttons to work. They always worked before. Now they do nothing.

Code
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\Personal\CodeBlocks\siw-test\
Adding source dir: D:\Personal\CodeBlocks\siw-test\
Adding file: D:\Personal\CodeBlocks\siw-test\bin\Debug\siw-test.exe
Changing directory to: D:/Personal/CodeBlocks/siw-test/.
Set variable: PATH=.;E:\CodeBlocks\wxWidgets\lib\gcc_lib;E:\CodeBlocks\MinGW\bin;E:\CodeBlocks\MinGW;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Program Files (x86)\Smart Projects\IsoBuster;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;D:\Program Files (x86)\GnuPG\pub

[debug]Command-line: E:\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args D:/Personal/CodeBlocks/siw-test/bin/Debug/siw-test.exe
[debug]Working dir : D:\Personal\CodeBlocks\siw-test

Starting debugger: E:\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args D:/Personal/CodeBlocks/siw-test/bin/Debug/siw-test.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from D:/Personal/CodeBlocks/siw-test/bin/Debug/siw-test.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.9.1
[debug]Copyright (C) 2015 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "x86_64-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.9.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source E:\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory D:/Personal/CodeBlocks/siw-test/
[debug]Source directories searched: D:/Personal/CodeBlocks/siw-test;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: D:\Personal\CodeBlocks\siw-test\bin\Debug\siw-test.exe

Child process PID: 4496

[debug][New Thread 4496.0x2848]

Trying to pause the running process...
Trying to pause the running process...
Trying to pause the running process...
Trying to pause the running process...
Trying to pause the running process...

[debug][Inferior 1 (process 4496) exited normally]
[debug]>>>>>>cb_gdb:

[Inferior 1 (process 4496) exited normally]

[debug]> quit

Debugger finished with status 0

EDIT: Found this http://sourceforge.net/p/mingw-w64/discussion/723798/thread/25ffa34d/ apparently x32/x64 issue. If anyone understands more about this, could you help please? Might or might not be the right thing though... my gdb.exe is 64bit. Tried checking "produce debugging symbols [-g]" in the compiler settings and did a full rebuild to no avail.

This is my exact issue
Quote
Forking
If your application uses the 'fork' system call you'll have trouble stopping the debugged program or setting breakpoints on the fly. Here is a link explaining the forking modes of GDB: http://sourceware.org/gdb/onlinedocs/gdb/Forks.html
http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

What do I have to do? I don't have fork in my code at all but this is precisely what happens.

Wait it just got even better! I wanted to try and attach the debugger to a running instance so I went to the folder where the exe was compiled ran it and guess what, it instantly quits the process list after launch silently.

It seems like I spoke too soon about having "finally got it to work", this setup is sputtering and coughing blood barely holding together at all! It has in fact not even produced an executable that can run independently from the IDE despite (mis)leading me to believe so! What more do I have to do?
« Last Edit: December 30, 2015, 09:49:47 pm by Searinox »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB with MinGW x64 and wxWidgets: linker can't find wxmsw30
« Reply #16 on: December 31, 2015, 01:15:29 am »
It seems like I spoke too soon about having "finally got it to work", this setup is sputtering and coughing blood barely holding together at all! It has in fact not even produced an executable that can run independently from the IDE despite (mis)leading me to believe so! What more do I have to do?
Two/three options
1. copy the required dll files next to the exe.
2. modify the path variable and add the path to where the dlls are stored (this is what cb does for you when it start the application)
3. write a manifest and embed it in the exe.

Most people end doing 1.

For the debugger:
Does debugging with this particular build of gdb in a console session works?
Can you press ctrl-c and stop the debuggee/inferior and set some breakpoints?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Searinox

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: CB with MinGW x64 and wxWidgets: linker can't find wxmsw30
« Reply #17 on: December 31, 2015, 06:12:13 am »
I have no .dlls for that .exe. I'm using the SHARED=0 static libs which create a 10MB exe. The folder path is gcc_lib, no longer gcc_dll. A hello world console app does the same thing, immediately shuts down after opening. And yes it does have a _getch() and should stop for input before closing. Runs fine from IDE, immediately closes stand-alone.

I'm getting the exact same problem with a non-wxwidgets simple console application that uses just mingw64. The pause and stop controls don't work, live breakpoints don't work, and ctrl+c does absolutely nothing.

GDB is version 7.9.1.
« Last Edit: December 31, 2015, 06:51:07 am by Searinox »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CB with MinGW x64 and wxWidgets: linker can't find wxmsw30
« Reply #18 on: December 31, 2015, 08:38:54 am »
This is a known issue.
We have discussed before.
A 32bit CB can not break(stop) a 64 bit exe.
So, you need a 64bit CB.
Or you need a small tool too break the 64bit exe, this is not implemented yet.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Searinox

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: CB with MinGW x64 and wxWidgets: linker can't find wxmsw30
« Reply #19 on: December 31, 2015, 08:44:15 am »
Awful. Okay. Where can I find a page to compile C::B x64? Actually wait.... WHAT would I even be compiling it with? C::B x32? Better yet... are there any popular distros of precompiled x64 builds up for download anywhere?

I can't believe that after rummaging through obscure issue after obscure issue I might acutally have to forget the whole thing and go back to 32. It's funny because for instance Visual Studio 2013's environment is all 32bit apps yet the relevant exes are 64bit that it can do everything it needs to.

And this still doesn't explain why my 64bit .exes aren't running on their own. Again they were compiled with static libs and are large single exe files with no dlls, the folder is gcc_lib and in turn has no dlls in it either so yea, there should be no dependencies.
« Last Edit: December 31, 2015, 09:01:40 am by Searinox »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB with MinGW x64 and wxWidgets: linker can't find wxmsw30
« Reply #20 on: December 31, 2015, 10:08:14 am »
This is a known issue.
We have discussed before.
A 32bit CB can not break(stop) a 64 bit exe.
So, you need a 64bit CB.
Or you need a small tool too break the 64bit exe, this is not implemented yet.
Link?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CB with MinGW x64 and wxWidgets: linker can't find wxmsw30
« Reply #21 on: December 31, 2015, 12:05:26 pm »
This is a known issue.
We have discussed before.
A 32bit CB can not break(stop) a 64 bit exe.
So, you need a 64bit CB.
Or you need a small tool too break the 64bit exe, this is not implemented yet.
Link?
Problem pausing debugger using TDM-GCC64, C::B v13.12
We just need a bridge small tools to run the DebugBreakProcess command. If the debugee is 64 bit, we need a 64bit tool, if the debugee is 32 bit, we need a 32 bit tool. That's what QTcreator did.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB with MinGW x64 and wxWidgets: linker can't find wxmsw30
« Reply #22 on: December 31, 2015, 01:22:43 pm »
Ok, I'll look at it. Can someone log an issue about this?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.