updated by JMH on October 26, 2012 at 4:25 PM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To get the Xerces-C library sample programs to run I think that the sample programs are installed with the libraries On Abraham, these are in subdirectories of: C:\cygwin\usr\share\doc\xerces-c\samples\src\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To get the Boost library sample programs to run The sample programs are in the source package: boost_1_48_0.zip On Abraham, these are in: F:\I-Drive\Kits\Cygwin\BoostLibraries\boost_1_48_0\libs\regex\example\snippets\ /cygdrive/f/I-Drive/Kits/Cygwin/BoostLibraries/boost_1_48_0/libs/regex/example/snippets/ On Judy, these are in: /lib/gcc/i686-pc-cygwin/3.4.4/include/c++/boost_1_48_0/libs/regex/example/snippets C:\cygwin\lib\gcc\i686-pc-cygwin\3.4.4\include\c++\boost_1_48_0\libs\regex\example\snippets On Olsen402, these are in: T:\Jesse\Kits\Cygwin\BoostLibraries\boost_1_48_0\libs\regex\example\snippets\ /cygdrive/t/I-Drive/Kits/Cygwin/BoostLibraries/boost_1_48_0/libs/regex/example/snippets/ ---------- EXAMPLE #1 ---------- Jesse@Judy /lib/gcc/i686-pc-cygwin/3.4.4/include/c++/boost_1_48_0/libs/regex/example/snippets $ g++ credit_card_example.cpp -llibboost_regex-mt Jesse@Judy /lib/gcc/i686-pc-cygwin/3.4.4/include/c++/boost_1_48_0/libs/regex/example/snippets $ dir a.exe icu_example.cpp partial_regex_iterate.cpp regex_grep_example_2.cpp regex_iterator_example.cpp regex_replace_example.cpp regex_split_example_2.cpp captures_example.cpp mfc_example.cpp partial_regex_match.cpp regex_grep_example_3.cpp regex_match_example.cpp regex_search_example.cpp regex_token_iterator_eg_1.cpp credit_card_example.cpp partial_regex_grep.cpp regex_grep_example_1.cpp regex_grep_example_4.cpp regex_merge_example.cpp regex_split_example_1.cpp regex_token_iterator_eg_2.cpp Jesse@Judy /lib/gcc/i686-pc-cygwin/3.4.4/include/c++/boost_1_48_0/libs/regex/example/snippets $ ./a.exe validate_card_format("0000111122223333") returned 0 validate_card_format("0000 1111 2222 3333") returned 1 validate_card_format("0000-1111-2222-3333") returned 1 validate_card_format("000-1111-2222-3333") returned 0 machine_readable_card_number("0000111122223333") returned 0000111122223333 machine_readable_card_number("0000 1111 2222 3333") returned 0000111122223333 machine_readable_card_number("0000-1111-2222-3333") returned 0000111122223333 machine_readable_card_number("000-1111-2222-3333") returned 000111122223333 human_readable_card_number("0000111122223333") returned 0000-1111-2222-3333 human_readable_card_number("0000 1111 2222 3333") returned 0000-1111-2222-3333 human_readable_card_number("0000-1111-2222-3333") returned 0000-1111-2222-3333 human_readable_card_number("000-1111-2222-3333") returned 000-1111-2222-3333 ---------- EXAMPLE #2 ---------- Jesse@Judy /lib/gcc/i686-pc-cygwin/3.4.4/include/c++/boost_1_48_0/libs/regex/example/snippets $ g++ regex_match_example.cpp -llibboost_regex-mt Jesse@Judy /lib/gcc/i686-pc-cygwin/3.4.4/include/c++/boost_1_48_0/libs/regex/example/snippets $ ./a.exe argc is 1 enter test string jesse Match not found enter test string 100 Match found: Response code: 100 Message text: enter test string 100 message Match found: Response code: 100 Message text: message enter test string 123 this is a test Match found: Response code: 123 Message text: this is a test enter test string quit ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://cygwin.com/ N.B. To get full package, be sure to select mirror: http://lug.mtu.edu this mirror worked fine on 2012-01-01 http://www.gtlib.gatech.edu as of 2012-01-01, the Cygwin installation is reporting that this mirror is "not on the list of official Cygwin mirrors any more." (Some of the other mirrors appear to be incomplete.) Note that the default installation does not include g++. To get that, In the Devel category, add: gcc-core gcc-g++ gdb make Lots of other files will automatically be selected. Instructions from the tutorial at: http://netbeans.org/community/releases/70/cpp-setup-instructions.html http://netbeans.org/community/releases/67/cpp-setup-instructions.html Select each package you want to download by clicking the Skip label next to it, which reveals the version number of the package to download. At a minimum, select: gcc-core: C compiler gcc-g++: C++ compiler gdb: The GNU Debugger make: the GNU version of the 'make' utility Packages that are required by the packages you select are automatically selected as well. It is also critical to: Add {cygwin}\bin directory to the Path variable. By default, {cygwin} is C:\cygwin. Directory names must be separated with a semicolon. Your edited path should look something like %SystemRoot%\system32;%SystemRoot%;C:\Program Files\QuickTime\QTSystem;C:\cygwin\bin If this is not done, the shell terminal can't start and NetBeans hangs after compiling the project. Also, if Cygwin is not on the path, NetBeans can't display the project properties window, and the various command line tests such as: C:\> cygcheck -c cygwin C:\> g++-3 --version (*g++-3 --version under TakeCommand) C:\> make --version C:\> gdb --version will not work. Further note that the executable for g++ is actually "g++-3.exe". Curses is in the Util category: ncurses ncurses-demo See: http://invisible-island.net/ncurses/ncurses.faq.html However, to get curses.h, you have to install the libncurses-devel package in the Devel category. See: http://www.mail-archive.com/cygwin@cygwin.com/msg66569.html You must also add the curses libraries to the project path. See: http://forums.netbeans.org/post-39241.html Go to: Project Properties -> Linker -> Libraries Add libraries: C:\Cygwin\lib\libncurses++.a C:\Cygwin\lib\libncurses++.dll.a C:\Cygwin\lib\libncurses.a <<<--- this appears to be the only one needed C:\Cygwin\lib\libncurses.dll.a Jesse's Directions: (1) Right-click project header in Projects window and select Properties from the drop-down menu (this is the last option). (2) Click the Linker node under the Build category. (3) Expand the Libraries category if it is not already expanded. (4) Click the [...] button to the far right of the Libraries entry. (5) Navigate to: C:\Cygwin\lib (6) Click file: libncurses.a (7) Click the Select button. (8) Click the OK button to exit the Debug-Libraries dialog box. (9) Click the OK button to exit the Project Properties dialog box. Then, in your C++ source file, use: #include #include Correction to InstallingCygwinWithX11.pdf: Navigate to "C:\cygwin\usr\X11R6\bin", right-click on the file "startxwin.bat"... should be: Navigate to "C:\cygwin\bin", right-click on the file "startxwin.bat"... http://www.cygwin.com/ml/cygwin/2000-11/msg00263.html g++ -enable-auto-import -I/usr/local/include -L/usr/local/lib main.cpp -lncurses Another useful tool: pkg-config in the Devel category. See: http://forums.netbeans.org/post-39241.html Installing Cygwin/X (from the User's Guide, pg. 8) Cygwin/X packages are located in the X11 category. - xorg-server (required, the Cygwin/X X Server) - xinit (required, scripts for starting the X server: xinit, startx, startwin.sh, startxwin.bat (and a shortcut on the Start Menu to run it), startxdmcp.bat ) - xorg-docs (optional, man pages) - X-start-menu-icons (optional, adds icons for X Clients to the Start menu) In NetBeans, first add the C/C++ plugin. Then go to Tools -> Options -> C++. You get a message telling you that there are no appropriate C++ compilers on your system, but click the Add... button below the Tool Collection window and navigate to (typically): C:\Cygwin\bin Set the Family to Cygwin. This will automatically add the other required directories in the main Options dialog box. Excellent installation documentation is available at: Cygwin Installation How-To http://rcc.its.psu.edu/hpc/guides/cygwin/ Xming Installation How-To http://rcc.its.psu.edu/hpc/guides/xming/ Xming is at: http://sourceforge.net/projects/xming/ Valuable documentation at: http://www.straightrunning.com/XmingNotes/