There are valid technical reasons why one might prefer MinGW over Cygwin. In fact, there even seems to be some issues with NB and gdb in the Cygwin environment. My first experience with NB seemed to go pretty well - I was able to debug into unit test modules created with the CUnit framework. I did however observe one odd thing in that I was not able to use the Debug 'Run to Cursor' (F4) feature - I get a popup box with the warning message "No source file named D.". I believe this is related to the bug. On my system, gdb -v shows the following:
$ gdb -v
GNU gdb (GDB) 7.3.50.20111026-cvs (cygwin-special)
I went ahead and switched the project to Mingw.
Follow instructions to setup MinGW Compilers and Tools.
Now the problems start.
Our project code (target is dsPIC30) is not compatible with gcc 3.4.x.whatever in MinGW for a couple of reasons. One is the use of newer compiler directive "-Wno-attributes". Another is the use of binary literal constants in the code.
Anyway, I installed GCC 4.3.3 for Windows and it seemed to take care of those issues.
As I mentioned previously, it is necessary to revert to CUnit-2.1-0 to achieve complete integration with NB.
You might think you could try to simply download a pre-built binary of a CUNIT build for windows ... but it is probably linked against different libc libraries that won't be compatible with the MinGW you have installed.
Building CUnit from the sources is straightforward (the "configure-make-install" process) but that does require availability of automake/autoconf tools on your build system. I had to go ahead and Install MSYS DTK 1.0 as per instructions on the MinGW site. (If you followed the instructions from NetBeans to the letter then you probably did not "install the DTK or the core files mentioned in the wiki page").
Here we go ... Oh goody, more errors:
configure.in:4: error: Autoconf version 2.58 or higher is required
I found some advice on the web about updating packages in MinGW.
Installed msys-autoconf-2.59.tar.bz2 (updated autoconf to version 2.59. ). In MSYS window:
cd /
tar xvjfp /d/dload/msys-autoconf-2.59.tar.bz2
Compiled and installed CUnit from source (configure --debug)
Add the paths for CUNIT library and headers to my project:
../../../../msys/1.0/local/include
../../../../msys/1.0/local/lib
Now I can debug into the Unit Test module. However, the test runner seems to go out into the weeds. After debugging into CUnit, I find that the code hangs up on the following:
"fprintf(stdout, ..." f_pTestStartMessageHandler
At this point, I am pretty disgusted with MinGW, give up and go back to Cygwin!
It seems that I have somehow deleted the CUnit libraries and header files that I had previously installed into my Cygwin environment. After rebuilding and reinstalling CUnit, and rebuilding my code, I find that I have some compilation errors in my project which hadn't been there before when trying to run the unit test module (Alt+F6):
build/Debug/Cygwin_4.x-Windows/main_nomain.o: In function `bswap_16':
/usr/include/byteswap.h:20: multiple definition of `_bswap_16'
The errors aren't there when running the main project (F6).
I find that the error is precipitated by the presence of the standard #include :
#include
... so if I need to print or open files I'm screwed!.
No comments:
Post a Comment