chrisjn52 Posted July 20, 2016 Report Share Posted July 20, 2016 Yes, I want to be able to compile for Win32 but I have been putting off due to imminent replacement of my aging PC. However, I decided to give it a try anyway and loaded the required MingW & CygWin toolchains and followed the guide here but I get this error message: c:\Temp\Win32Demo\Demo>make 0 [main] make 5128 child_info_fork::abort: c:\cygwin\bin\cygiconv-2.dll: L oaded to different address: parent(0x2F0000) != child(0x440000) make: fork: Resource temporarily unavailable Any ideas? Link to comment Share on other sites More sharing options...
inmarket Posted July 21, 2016 Report Share Posted July 21, 2016 This looks like a cygwin dll version problem. Either you have a mismatch between the compiler or make and your cygwin dll versions, or the various dll version do not match. Look for old left over versions of the cygwin dlls in your windows and system32 directories. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 21, 2016 Report Share Posted July 21, 2016 What operating system are you on? We had similar issues before, a simple upgrade to the latest version of the Cygwin toolchain fixed it. Link to comment Share on other sites More sharing options...
chrisjn52 Posted July 21, 2016 Author Report Share Posted July 21, 2016 I'm using Win7. I checked for additional files in Windows folders but none were found. However, I found the answer in this post here and the make progresses further after using the the following rebaseall command in dash: $ ./rebaseall -b 0x5fe50000 The make then failed with the following: Compiling ../uGFX/src/gfx.c make: i686-pc-mingw32-gcc: Command not found This was fixed by renaming the compiler executable name in the Makefile thus: #ARCH = i686-pc-mingw32- ARCH = i686-w64-mingw32- Unfortunately the Linker now fails as shown below: Linking .build/Demo.exe /cygdrive/c/Users/Chris/AppData/Local/Temp/cc9tSOjS.ltrans0.ltrans.o:cc9tSOjS.lt rans0.o:(.text+0x2380): multiple definition of `main' /usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a- crt0_c.o):/usr/src/debug/mingw64-i686-runtime-4.0.6-1/crt/crt0_c.c:17: first defined here /usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o): In function `main': /usr/src/debug/mingw64-i686-runtime-4.0.6-1/crt/crt0_c.c:18: undefined reference to `WinMain@16' collect2: error: ld returned 1 exit status make: *** [../uGFX/tools/gmake_scripts/compiler_gcc.mk:284: .build/Demo.exe] Error 1 Could this issue be related to my Cygwin/MingW installation in some way? Link to comment Share on other sites More sharing options...
inmarket Posted July 22, 2016 Report Share Posted July 22, 2016 You need to add the flags to the compiler that tell it it is a console application. I think it is something like "--console" but i cant remember the specifics. The difference between the -pc compiler and the -w compiler is exactly this. The -pc compiler assumes a console application, the -w compiler assumes a windows application. Unfortunately cygwin has recently stopped supplying the console based compiler. Link to comment Share on other sites More sharing options...
chrisjn52 Posted July 23, 2016 Author Report Share Posted July 23, 2016 I tried with -mconsole switch to no avail. I'm using GCC 4.9.2 which may be an issue according to this unless I am mistaken? $ i686-w64-mingw32-gcc --version i686-w64-mingw32-gcc (GCC) 4.9.2 How do I downgrade GCC to avoid this, (I have been unsuccessful in finding a package and method thus far). Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 23, 2016 Report Share Posted July 23, 2016 If you are using our makefiles you can just use OPT_LINK_OPTIMIZE to no in your top-level makefile to disable LTO. Link to comment Share on other sites More sharing options...
inmarket Posted July 24, 2016 Report Share Posted July 24, 2016 The other way of getting around that linking error is to rename main() to WinMain(). It is your compiler runtime startup that is incorrect (ie the wrong compiler binary for this job). It is looking to create a pure win32 application rather than a console application but the above may enable you to work around it. It is not a question of the version number of the compiler but rather its builtin runtime support. By the way, this topic really doesn't belong under "Development and Feedback", it should really have been under the support topic. Now it is here though we will just resolve the problem here. Link to comment Share on other sites More sharing options...
chrisjn52 Posted July 24, 2016 Author Report Share Posted July 24, 2016 I have now managed to compile and link the Demo to a console application which runs perfectly. In order to get it to work I renamed main() to Winmain(), whereupon it still failed with an undefined reference to `WinMain@16'. After renaming the function back to main() the code then linked without error. Incidentally, as you can see from the top post, I intended to reply to Joel in the Spinbox Widget thread in "Support" but I must have posted back to "Development and Feedback" inadvertently. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted July 24, 2016 Report Share Posted July 24, 2016 2 hours ago, chrisjn52 said: In order to get it to work I renamed main() to Winmain(), whereupon it still failed with an undefined reference to `WinMain@16'. After renaming the function back to main() the code then linked without error. That sounds like a make clean wound have fixed it 2 hours ago, chrisjn52 said: Incidentally, as you can see from the top post, I intended to reply to Joel in the Spinbox Widget thread in "Support" but I must have posted back to "Development and Feedback" inadvertently. Nope, actually I just took that post out of the spinbox widget thread (the first post in this topic was the last one there) and created a new topic out of if because it is in no way related to the spin box widget at all. Link to comment Share on other sites More sharing options...
inmarket Posted July 25, 2016 Report Share Posted July 25, 2016 Just as a follow up to the link optimising problem, here is the ld bug report and resolution... https://sourceware.org/bugzilla/show_bug.cgi?id=18199 It affects some versions of ld (in particular the version that cygwin is currently using). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now