I just spent 10 years making this work.
-
As far as I can remember it's 10 years to the week, certainly 10 years to the nearest month since I started building the worlds simplest C++ program.
int main()
{
return 42;
}and finally today for the first time it builds, runs and returns 42, on 32bit Windows and 64bit Linux without linking to any system libraries on either. I finally have proof that a universal C++ runtime is possible. :-D ^ 42 .I am quite literally tired and emotional. :zzz:
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
congrates :)
-
Thanks, I know about Ruben and others working hard on MinGW64. The MinGW I'm using is the one that comes with the latest CodeBlocks, 12.11. It has the MinGW64 CRT but uses T Dragon's GCC build. I think the compiler is OK but the MinGW linker has frankly always been dodgy. I don't know why it should be so hard to get a PE linker to work? LLVM/Clang's PE linker is also broken and even Microsoft's VC linker has always been flaky. Fortunately and completely out of character Intel who normally can't write software to save their lives seem to have got it right. The ICL linker xilink is OK.
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
The latest versions seem to be working somewhat well, I have seen no real flakiness. I have seen it spaz out once, but that was because of a corrupt import library from the MinGW-w64 CRT.
brisingr_aerowing@Gryphon-PC $ rake in_the_dough Raking in the dough brisingr_aerowing@Gryphon-PC $ make lots_of_money Making lots_of_money
-
The latest versions seem to be working somewhat well, I have seen no real flakiness. I have seen it spaz out once, but that was because of a corrupt import library from the MinGW-w64 CRT.
brisingr_aerowing@Gryphon-PC $ rake in_the_dough Raking in the dough brisingr_aerowing@Gryphon-PC $ make lots_of_money Making lots_of_money
In general it works fine and I have to say my test runs alright once it has paused for 40 seconds to load the 144MB Dll. I think the issue is building a Dll that includes static libraries which has generally been considered evil with MinGW in the past. I've even seen statements claiming it can't be done which is silly. I can't complain too much though I am pushing the boat out a bit far, not only building a Dll with static libraries linked in but using -nostdlib, my own replacement for libsupc++ and still linking to the MinGW libgcc for the rest of the dependencies. I had to write my own spec file to make it do that and I'm not surprised if it has a bit of a strop, hardly a 'normal' test case. :) All this craziness is mainly to provide a stepping stone between Windows and Linux in terms of development. I start with the code working on 32bit Windows and then change one thing at a time, Compiler to 32bit MinGW-GCC. OK, Build for x64 under VS2012 (that's still not quite working) and then having got both 64bit and GCC support I make the jump to 64bit Linux GCC. It's worked a treat and reduced what I thought would be 3 months work to 3 weeks.
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
-
What? Are you serious? Do you know how much extra work that would be? :laugh: At the moment
printf
works on Windows but is stubbed on Linux. I have the necessary code for the formatting and IO but I need to review it for commonality with the Windows code and work out exactly where to put the formatter especially if it can be common. I'll come back to it in a few weeks and getprintf
to work. Then there will be "Hello World!"."The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
How about simplifying the effort and use puts()?
-
As far as I can remember it's 10 years to the week, certainly 10 years to the nearest month since I started building the worlds simplest C++ program.
int main()
{
return 42;
}and finally today for the first time it builds, runs and returns 42, on 32bit Windows and 64bit Linux without linking to any system libraries on either. I finally have proof that a universal C++ runtime is possible. :-D ^ 42 .I am quite literally tired and emotional. :zzz:
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
-
Thank you. I'll be taking the weekend off before the new job begins Monday.
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
-
As far as I can remember it's 10 years to the week, certainly 10 years to the nearest month since I started building the worlds simplest C++ program.
int main()
{
return 42;
}and finally today for the first time it builds, runs and returns 42, on 32bit Windows and 64bit Linux without linking to any system libraries on either. I finally have proof that a universal C++ runtime is possible. :-D ^ 42 .I am quite literally tired and emotional. :zzz:
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
On the plus side, you won't have to spend decades debugging or optimizing that code :)
-
How about simplifying the effort and use puts()?
I do actually have
puts
working on Windows and Linux so yes I could do that. The sample apps I've written requireprintf
in a few places although if you useprintf
with just a format string, no parameters, GCC 'magically' turns it into a call toputs
anyway."The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
-
On the plus side, you won't have to spend decades debugging or optimizing that code :)
:laugh:
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
-
I do actually have
puts
working on Windows and Linux so yes I could do that. The sample apps I've written requireprintf
in a few places although if you useprintf
with just a format string, no parameters, GCC 'magically' turns it into a call toputs
anyway."The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
Though it annoys me that compilers are smart enough to replace what you tell them to do, with what you meant to tell them to do (even if you didn't know you meant to do it), that is a good safety feature. printf's can be very unsafe....
-
How about simplifying the effort and use puts()?