Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Problem compiling 32-bit apps with 64-bit MINGW
Problem compiling 32-bit apps with 64-bit MINGW [message #44565] Wed, 01 April 2015 04:42 Go to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
I'm using TDM-GCC-64 (64-bit compiler on 64-bit Windows) and trying to compile a 32-bit version of my app.
I'm using the -m32 option with both compiler and linker.
The problem is with the resource compiler. It compiles into 64-bit resources.

windres.exe takes a --target option, which can be one from the list: pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 elf64-little elf64-big elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex.

There is no way to pass an option to the resource compiler, and there is only one GCC builder (I believe, TheIDE use to have both 32 and 64 bit builders for GCC).

Is there a way to fix that? I really need MINGW because I need GCC symbol demangling.

TIA


Regards,
Novo

[Updated on: Wed, 01 April 2015 04:44]

Report message to a moderator

Re: Problem compiling 32-bit apps with 64-bit MINGW [message #44566 is a reply to message #44565] Wed, 01 April 2015 12:13 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Novo

There are TDM-GCC 32 and 64 bits. You can install both in different folders (MINGW32 and MINGW64 by default).


Best regards
Iñaki
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #44567 is a reply to message #44566] Wed, 01 April 2015 15:41 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
koldo wrote on Wed, 01 April 2015 06:13
Hello Novo

There are TDM-GCC 32 and 64 bits. You can install both in different folders (MINGW32 and MINGW64 by default).


Hello koldo,

Thanks! Yes, I know, but TDM-GCC-64 is capable of compiling both 32 and 64 bit apps.
As a temporary solution I can install 32-bit version, but in general case it is not enough to have just a GCC builder. I can pass extra-arguments to compiler and linker, but windres.exe.

Thanks.


Regards,
Novo
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #44568 is a reply to message #44565] Wed, 01 April 2015 17:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Wed, 01 April 2015 04:42
I'm using TDM-GCC-64 (64-bit compiler on 64-bit Windows) and trying to compile a 32-bit version of my app.
I'm using the -m32 option with both compiler and linker.
The problem is with the resource compiler. It compiles into 64-bit resources.

windres.exe takes a --target option, which can be one from the list: pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 elf64-little elf64-big elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex.

There is no way to pass an option to the resource compiler, and there is only one GCC builder (I believe, TheIDE use to have both 32 and 64 bit builders for GCC).

Is there a way to fix that? I really need MINGW because I need GCC symbol demangling.

TIA


Hi,

thanks for the info.

I guess the quick fix and sufficient is to change the build method. I can do that, but it should be relatively easy to do (and I do not want to download/install mingw-tdm right now). If you succeed, please let me know, I will patch trunk. If you have problems, please report as well - I will try to fix it myself ASAP.

On related note, how is mingw-tdm working for you? Which version have you downloaded? I am (for some time now) interested in bundling it with U++ once again....

Mirek
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #45653 is a reply to message #44568] Sat, 19 December 2015 05:28 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Wed, 01 April 2015 11:59
Novo wrote on Wed, 01 April 2015 04:42
I'm using TDM-GCC-64 (64-bit compiler on 64-bit Windows) and trying to compile a 32-bit version of my app.
I'm using the -m32 option with both compiler and linker.
The problem is with the resource compiler. It compiles into 64-bit resources.

windres.exe takes a --target option, which can be one from the list: pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 elf64-little elf64-big elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex.

There is no way to pass an option to the resource compiler, and there is only one GCC builder (I believe, TheIDE use to have both 32 and 64 bit builders for GCC).

Is there a way to fix that? I really need MINGW because I need GCC symbol demangling.

TIA


Hi,

thanks for the info.

I guess the quick fix and sufficient is to change the build method. I can do that, but it should be relatively easy to do (and I do not want to download/install mingw-tdm right now). If you succeed, please let me know, I will patch trunk. If you have problems, please report as well - I will try to fix it myself ASAP.

On related note, how is mingw-tdm working for you? Which version have you downloaded? I am (for some time now) interested in bundling it with U++ once again....

Mirek


Hi Mirek,

Sorry for the delay with the answer. I just missed your message. E-mail notification doesn't work for me after the forum update.

I'm using mingw-tdm 4.9.2 for x64 target and 4.8.1 for x86. 5.1 is just too buggy, but you already know that at this time.

I still couldn't compile for x86 using 64-bit compiler. windres.exe is still not getting a --target option.

Thanks



Regards,
Novo
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #45660 is a reply to message #45653] Sat, 19 December 2015 16:13 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
patch:
file GccBuilder.icpp
line 226

				exec << "windres -i " << GetHostPathQ(fn) <<  ((HasFlag("WIN32"))? " --target=pe-i386 " : "")



regards
omari.
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #45876 is a reply to message #45660] Mon, 18 January 2016 10:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks. WIN32 is defined for WIN64 too, so the fix actually has to search the commandline for -m32 flag. No big deal. Seems to work.
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #46904 is a reply to message #44565] Fri, 09 September 2016 09:58 Go to previous messageGo to next message
pfsdanny is currently offline  pfsdanny
Messages: 26
Registered: December 2011
Location: Hong Kong
Promising Member
I just upgrade U++ from 7962 to 9251 (64 bit), when comply the program I got the following error

C:\upp9251\bin/TDM64/bin/ld.exe: i386:x86-64 architecture of input file `C:/Users/danny/Documents/uppout9251/MEC9251/Elink/MINGW.For ce_Speed.Gui.Main.Mt.Mysqldll\resource$rc.o' is incompatible with i386 output

I try your patch but cannot fix the error. When I remove the recource.rc from the project, everything is fine. I need the resource.rc to embed the application icon in the exe.

Is there any fix?

Thanks.
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #47501 is a reply to message #46904] Mon, 23 January 2017 17:37 Go to previous messageGo to next message
Melek is currently offline  Melek
Messages: 16
Registered: January 2017
Location: Honduras
Promising Member
Jejeje I have the same error and tried several ways.
The IDE of U ++ is really cool, however not being able to compile or use the resource file is complicated to move forward, and I add that there is almost no documentation on the web, although TheIde already comes with a lot of examples which Is really excellent, but if it would be nice to have more documentation and support with these errors, because I can not place the .ico file I can only compile with .iml file which only places the icon in the window and taskbar but not in the executable Which is really important. I also see that there is no option unless it is for an .rc file to place compile details for the executable, such as:
-Version
-Description
-Author
-Brand
-Etc
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #47502 is a reply to message #47501] Tue, 24 January 2017 00:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Can you please try with the lastest nightly build?

I have just checked current nigtly, MINGW (which is 32bit) with examples/EyeCare (which has .rc file) and it seems to work just fine...
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #47503 is a reply to message #47502] Tue, 24 January 2017 02:55 Go to previous messageGo to next message
Melek is currently offline  Melek
Messages: 16
Registered: January 2017
Location: Honduras
Promising Member
Thanks for the prompt response and take the opportunity to indicate that I really loved this framework, that's why I'm trying it, although I'm adapting.
I tried EyeCare and Bumps. But the problem is the same, the file I see is compiled into resuource $ rc.o but throws the error that is incompatible with i386. Here is the output:

C:\AMS\upp\bin/TDM64/bin/ld.exe: i386:x86-64 architecture of input file
`C:/AMS/upp/out/examples/EyeCare/MINGW.Debug.Debug_Full.Gui. Main\ic
on$rc.o' is incompatible with i386 output

collect2.exe: error: ld returned 1 exit status

[Updated on: Tue, 24 January 2017 02:57]

Report message to a moderator

Re: Problem compiling 32-bit apps with 64-bit MINGW [message #47504 is a reply to message #47502] Tue, 24 January 2017 02:59 Go to previous messageGo to next message
Melek is currently offline  Melek
Messages: 16
Registered: January 2017
Location: Honduras
Promising Member
Latest nightly build is beta or can it be used without problems?
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #47505 is a reply to message #47503] Tue, 24 January 2017 04:13 Go to previous messageGo to next message
Melek is currently offline  Melek
Messages: 16
Registered: January 2017
Location: Honduras
Promising Member
Excellent, I downloaded the lastest nightly build and it worked perfectly Surprised Thank you very much Razz Shocked
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #47506 is a reply to message #47504] Tue, 24 January 2017 08:10 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Melek wrote on Tue, 24 January 2017 02:59
Latest nightly build is beta or can it be used without problems?


Except glitches, latest nightly tends to be more stable than official release.

Right now it is 99.99% stable as we are close to 2017.1 release.

Mirek
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #47508 is a reply to message #47506] Tue, 24 January 2017 22:28 Go to previous messageGo to next message
Melek is currently offline  Melek
Messages: 16
Registered: January 2017
Location: Honduras
Promising Member
Smile Excelent Good Job.
I already tested with "2017.1rc1" and it worked perfectly for me to place the icon and version details in the .rc file
I imagine that using the MinGW compiler the executable is compiled in machine language.
And I was seeing some tutorials on the page and I would like to know if a window created as file.lay can be made activate MaximizeBox and MinimizeBox, since that can only do it from the code directly. And I still do not quite understand how to create several window2.cpp, window3.cpp classes as dialog type windows using layout assistance "window2.lay and window3.lay". These are some details that I do not know yet. I have tried with the examples that appear on the page to create modal windows and it works, but suddenly for large applications, it would be easier to create windows in their own classes and files to make code maintenance more comfortable.
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #47510 is a reply to message #47508] Wed, 25 January 2017 08:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Melek wrote on Tue, 24 January 2017 22:28
Smile Excelent Good Job.
I already tested with "2017.1rc1" and it worked perfectly for me to place the icon and version details in the .rc file
I imagine that using the MinGW compiler the executable is compiled in machine language.
And I was seeing some tutorials on the page and I would like to know if a window created as file.lay can be made activate MaximizeBox and MinimizeBox,


Activate by TopWindow Sizeable and Zoomable methods (e.g. put into dialog constructor).

Quote:

since that can only do it from the code directly. And I still do not quite understand how to create several window2.cpp, window3.cpp classes as dialog type windows using layout assistance "window2.lay and window3.lay". These are some details that I do not know yet. I have tried with the examples that appear on the page to create modal windows and it works, but suddenly for large applications, it would be easier to create windows in their own classes and files to make code maintenance more comfortable.


Sure, that is how it is done.

General note: There is one really big 'example' of U++: TheIDE sources... (just load uppsrc/ide project)
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #47533 is a reply to message #47510] Wed, 25 January 2017 22:16 Go to previous messageGo to next message
Melek is currently offline  Melek
Messages: 16
Registered: January 2017
Location: Honduras
Promising Member
Excellent I'm reviewing, it's something complicated to understand perfectly because I'm starting to know the language, although the great amount of examples they have is extraordinary and that has helped me a lot.
I already handle other languages interpreted as Java and PHP.
But C ++ I like because the compiled files are created in machine language which supposes a security mayo as opposed to .Net and Java.
I will be checking everything and thank you again
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #47547 is a reply to message #47533] Thu, 26 January 2017 22:12 Go to previous messageGo to next message
Melek is currently offline  Melek
Messages: 16
Registered: January 2017
Location: Honduras
Promising Member
New Topic. Plz Help me
http://www.ultimatepp.org/forums/index.php?t=msg&th=9875 &start=0&
Re: Problem compiling 32-bit apps with 64-bit MINGW [message #47548 is a reply to message #47533] Fri, 27 January 2017 02:05 Go to previous message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Melek wrote on Wed, 25 January 2017 22:16

But C ++ I like because the compiled files are created in machine language which supposes a security mayo as opposed to .Net and Java.


I'm not sure what is "mayo", but unless you have group of seasoned C++ developers with years of experience, it's pretty sure your C++ application will be much worse than Java/C# in terms of security (ie. much easier to exploit and containing many security vulnerabilities).

If you have several C++ senior developers and good development process in place, like security reviews, using valgrind and similar tools, penetration testing, etc... then you can produce secure software even with C++, but you have to spend considerable amount of budget on the security. Then again this true also for Java/C# at this level.

But if you just create some small app in few hours, then it's more likely the Java/C# will be somewhat secure even without paying attention to it, while C++ goes the opposite way, without paying the attention to it it will be almost surely insecure.
Previous Topic: Environment variables?
Next Topic: Files save issue
Goto Forum:
  


Current Time: Thu Mar 28 21:00:15 CET 2024

Total time taken to generate the page: 0.01105 seconds