From: David E. <gc...@ya...> - 2009-01-31 10:30:27
|
I seem to have run into what I believe is a limit to the length of a line in a .bat file (or the command line) while trying to include the libraries for building a libusb and gtk application. As such, I looked on the internet and a site showed how to put the include libraries in the cpp area with -Ixxxxx. I put each of the libs with a -I before it all on that one single line - it's over 256 characters long - is this a problem when the file is processed? Also, using a very simple test program (not really a program, but used to test the includes) in C, it does not appear to picking up the -I paths as my #include <xxx> fail. I also saw on this same internet page where to place the link libraries. I have no idea if this is right or not since it never gets to a link. Below is the .bat file I use in Windows at the command line: echo off echo ***************************************************** echo * Build the Windows version of cvsutil for the * echo * GTK gui'd interface. * echo ***************************************************** echo * echo * echo * Creating temporary directory echo * mkdir dwex echo * echo * Beginning copies.... copy *.c_gtk dwex\*.c copy ..\common\*.* dwex\*.* copy windows_build_gtk_msys.sh dwex\windows_build_gtk_msys.sh echo * copy gccspecs dwex\gccspecs echo * Copies completed. cd dwex echo * gcc a_start.c -o c:/cvs/cvsgtk -I -specs=../gccspecs if errorlevel == 0 goto goodbuild if errorlevel == 1 goto goodbuilw echo * echo ***** the program did *NOT* build ******** echo * goto exitme :goodbuild echo * echo * BUILD SUCCESSFUL!! echo * goto exitme :goodbuilw echo * echo * Build completed with warnings echo * :exitme echo * echo Begin clean-up echo * del *.* /Q echo * echo * echo * removing temp directory echo * cd .. rmdir dwex /Q echo * echo **************************************************** echo * Build is now finished. Press any key to * echo * close this window. * echo **************************************************** pause Below are the contents of the gccspecs: *asm: *asm_debug: %{gdwarf-2*:--gdwarf2}%{!gdwarf-2*:%{g*:--gstabs}} *asm_final: *asm_options: %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O} *invoke_as: %{!S:-o %|.s | as %(asm_options) %m.s %A } *cpp: %{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} -Ic:/Progra~1/LibUSB-Win32-0.1.10.1/include -Ic:/gtk/include/gtk-2.0 -Ic:/gtk/lib/gtk-2.0/include -Ic:/gtk/include/atk-1.0 -Ic:/gtk/include/cairo -Ic:/gtk/include/pango-1.0 -Ic:/gtk/include/glib-2.0 -Ic:/gtk/lib/glib-2.0/include -Ic:/gtk/include/libpng12 *cpp_options: %(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} *cpp_debug_options: %{d*} *cpp_unique_options: %{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}} *trad_capable_cpp: cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp} *cc1: %(cc1_cpu) *cc1_options: %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} *cc1plus: *link_gcc_c_sequence: %G %L %G *endfile: %{!fno-exceptions:crtend%O%s} *link: %{mwindows:--subsystem windows} %{mconsole:--subsystem console} %{shared: %{mdll: %eshared and mdll are not compatible}} %{shared: --shared} %{mdll:--dll} %{static:-Bstatic} %{!static:-Bdynamic} %{shared|mdll: -e _DllMainCRTStartup@12 --enable-auto-image-base} *lib: %{pg:-lgmon} %{mwindows:-lgdi32 -lcomdlg32} -luser32 -lkernel32 -ladvapi32 -lshell32 *libgcc: %{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt *startfile: %{shared|mdll:dllcrt2%O%s} %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s} %{!fno-exceptions:crtbegin%O%s} *switches_need_spaces: *cross_compile: 0 *version: 3.4.5 *multilib: . ; *multilib_defaults: *multilib_extra: *multilib_matches: *multilib_exclusions: *multilib_options: *linker: collect2 *link_libgcc: %D -lc:/gtk/lib -lc:/Progra~1/LibUSB-Win32-0.1.10.1/lib/gcc -lusb -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl *md_exec_prefix: *md_startfile_prefix: /mingw/lib/ *md_startfile_prefix_1: *startfile_prefix_spec: *sysroot_suffix_spec: *sysroot_hdrs_suffix_spec: *cc1_cpu: %{!mtune*: %{m386:mtune=i386 %n`-m386' is deprecated. Use `-march=i386' or `-mtune=i386' instead. } %{m486:-mtune=i486 %n`-m486' is deprecated. Use `-march=i486' or `-mtune=i486' instead. } %{mpentium:-mtune=pentium %n`-mpentium' is deprecated. Use `-march=pentium' or `-mtune=pentium' instead. } %{mpentiumpro:-mtune=pentiumpro %n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mtune=pentiumpro' instead. } %{mcpu=*:-mtune=%* %n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead. }} %<mcpu=* %{mpni:-msse3 %n`-mpni' is deprecated. Use `-msse3' instead. } %{mno-pni:-mno-sse3 %n`-mno-pni' is deprecated. Use `-mno-sse3' instead. } %{mintel-syntax:-masm=intel %n`-mintel-syntax' is deprecated. Use `-masm=intel' instead. } %{mno-intel-syntax:-masm=att %n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead. } *mingw_include_path: mingw32 *link_command: %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %l %{pie:-pie} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov} %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}} %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}} I have tried searching the web, reading all kinds of sites, etc., and am lost. I don't understand what the specs file stuff actually means (I've read the descriptors, but I don't understand how they get parsed out). I am at a loss to understand why the includes (usb.h and gtk.h so far) are not found. The output from the batch file when it gets to the gcc line says that usb.h and gtk.h are not found. I need all kinds of help and am begging someone to help me with this. I used to have `pgk-config --gtk+-2.0` on the gcc line in a shell script and paused the batch file to tell the user to go to msys and run the script, then come back and press enter. It worked, but how clumsy! I thought I should be able to build something that will just run in the batch file itself. In this way I can automate installation and compilation. But right now I'm really stuck. Thank you for reading this and thanks in advance for any help! Dave |