Cannot compile a basic 64bit Windows App

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
dbi2022
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Jan 12, 2022 8:25 am

Cannot compile a basic 64bit Windows App

Post by dbi2022 »

Hello,
I cannot compile/execute the win 64 app.
The error is this: "the code execution cannot continue because wxmsw315u_gcc_custom.dll was not found. reinstallling could fix the problem.."

I compiled the program with dev-cpp with the -m64 option and it dosen't issue any errors. I try to link it with the shared library wxmsw315u_gcc_custom.dll but it dosent work If I rename the file as wxmsw315u_gcc_custom64.dll it still asks for the other library although I don't mention it anymore. Why does it ask for a dll that I don't mention?!! How does it know that my original dll file was so called??!!

I checked them and the final executable and the shared library are 64bit.
I also use static gcc linking. Can we mix static and dinamic linking in an executable?

Thank you!

My conifg:
windows 10
winlibs-gcc-10.3.0
wxWidgets 3.1.5

The compiler issues this automatticaly:
Processing makefile...
--------
- Makefile Processor: C:\prg\winlibs-gcc-10.3.0\mingw64\bin\mingw32-make.exe
- Command: mingw32-make.exe -f "C:\prg\src\Makefile.win" all

g++.exe -c testgui.cpp -o testgui.o -I"C:/prg/winlibs-gcc-10.3.0/mingw64/include" -I"C:/prg/winlibs-gcc-10.3.0/mingw64/x86_64-w64-mingw32/include" -I"C:/prg/winlibs-gcc-10.3.0/mingw64/lib/gcc/x86_64-w64-mingw32/10.3.0/include" -I"C:/prg/wxWidgets-3.1.5/include" -m64

g++.exe testgui.o -o testgui.exe -L"C:/prg/winlibs-gcc-10.3.0/mingw64/lib" -L"C:/prg/winlibs-gcc-10.3.0/mingw64/x86_64-w64-mingw32/lib" -L"C:/prg/wxWidgets-3.1.5/lib/gcc_dll64" -static-libgcc -l:wxmsw315u_gcc_custom64.dll -mwindows


Compilation results...
--------
- Errors: 0
- Warnings: 0
- Output Filename: C:\prg\src\testgui.exe
- Output Size: 281,3486328125 KiB
- Compilation Time: 7,83s
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: Cannot compile a basic 64bit Windows App

Post by PB »

As you can see from the build log, this not a compilation problem.

Any program using DLLs not provided by Windows must be able to find them. In another words, the DLLs should be in the folder where the executable is, or in PATH (I would not recommend that for wxWidgets and GCC DLLs).

Looking at your post history, I would recommend reading a primer on compiling and running programs. In the long run, it could save you lot of time and effort...
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Cannot compile a basic 64bit Windows App

Post by ONEEYEMAN »

PB,
I think on Windows the usual place to put DLL is c:\Program Files\<program_name> and then update the PATH.
However I agree that this is not feasible during development.

Thank you.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: Cannot compile a basic 64bit Windows App

Post by PB »

ONEEYEMAN wrote: Fri Jan 21, 2022 5:23 pm I think on Windows the usual place to put DLL is c:\Program Files\<program_name> and then update the PATH.
AFAIK, most programs do not add their folder to the PATH. Usually only command line utilities do that, GUI programs are not launched from the command line...
dbi2022
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Jan 12, 2022 8:25 am

Re: Cannot compile a basic 64bit Windows App

Post by dbi2022 »

Hi!
thanks, I just remembered that I need to copy the dll into the same folder, at least..
It works, but not as expected, as I said.
I compiled my programm with this option: -l:wxmsw315u_gcc_custom64.dll
This dll is a copy and renamed file of the original one.

But my programm it requires the original compiled version,named: -l:wxmsw315u_gcc_custom.dll
I copy that original file, and it works.

How is that possible??!! Who said to my programm to search for that library file?!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Cannot compile a basic 64bit Windows App

Post by ONEEYEMAN »

Hi,
dbi2022 wrote: Sat Jan 22, 2022 5:28 pm Hi!
thanks, I just remembered that I need to copy the dll into the same folder, at least..
It works, but not as expected, as I said.
I compiled my programm with this option: -l:wxmsw315u_gcc_custom64.dll
Then this is the DLL it will look for.
dbi2022 wrote: Sat Jan 22, 2022 5:28 pm This dll is a copy and renamed file of the original one.
Not sure what you mean here. Why do you need to rename the file?
dbi2022 wrote: Sat Jan 22, 2022 5:28 pm But my programm it requires the original compiled version,named: -l:wxmsw315u_gcc_custom.dll
I copy that original file, and it works.
No, t is not. It will look for the library you are linking against.
dbi2022 wrote: Sat Jan 22, 2022 5:28 pm How is that possible??!! Who said to my programm to search for that library file?!
I don't know. Something else is happening here that you don't say...

Thank you.
dbi2022
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Jan 12, 2022 8:25 am

Re: Cannot compile a basic 64bit Windows App

Post by dbi2022 »

Hi again,

the "compiled renamed file" means the original wxwidgets library. It had no "64" at the end of its name.

So, to summarize:
1. I compiled wxwidgets with the whole and only 64bit toolchain. I got the this shared library file:wxmsw315u_gcc_custom.dll
2. I wanted to have the 2 libraries, the 32bit that I had compiled earlier, and the 64bit library at hand, so I renamed wxmsw315u_gcc_custom.dll to wxmsw315u_gcc_custom64.dll
3. I compiled my own simple programm and linked it as described above, with -l:wxmsw315u_gcc_custom64.dll
4. I forgot to copy the lib, but the programm asks instead for this one: wxmsw315u_gcc_custom.dll
5. I copy now the original library with its oringinal name, without "64" (although it is 64bit internally), and... it works!!!

How is that possible??!! Where does it take the lib name from if not from my specification?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Cannot compile a basic 64bit Windows App

Post by ONEEYEMAN »

Hi,
You shouldn't rename anything - the compilation of 32 and 64-bit can be placed into different directories.

Just use "TARGET_CPU" option on the command line.

And then you link you software to the appropriate libraries with -L and -l.

So I urge you to build everything from scratch.

Thank you.
Post Reply