From siewerts@thinker.colorado.edu Tue Oct 16 00:42:50 2001 Received: (from siewerts@localhost) by thinker.colorado.edu (8.10.1/8.10.1/UnixOps+Hesiod) id f9G6ewa26387; Tue, 16 Oct 2001 00:40:58 -0600 (MDT) Message-Id: <200110160640.f9G6ewa26387@thinker.colorado.edu> Subject: stupid problem (fwd) - beware of standard include paths!! To: bf2man@earthlink.net (Hidekazu Miyoshi), chris_newman@maxtor.com, dan.vigil@seagate.com, darrin_laverenz@stortek.com, deanwschulze@home.com, dgardner@interfacecontrol.com, ehoskins@qwest.net, emiliod@linuxcrew.com, f.vang@gli-co.com, fsbh1@uaf.edu, gpayne@ball.com, gyounger@hwimfg.com, jeff_andre@stortek.com, jing_li@jdedwards.com, kansari@ball.com, ken.ordes@seagate.com, modhafarhussain@aol.com, noratheps@hotmail.com, sam.siewert@networkphotonics.com, siewerts@thinker.colorado.edu, shubharamani@yahoo.com, sombutsi@colorado.edu, sscranford@yahoo.com, sshekhar@qualcomm.com, sziesman@ball.com, tewahade@vlecom.com, vikram.shah@colorado.edu, wxie@qualcomm.com Date: Tue, 16 Oct 2001 00:40:58 -0600 (MDT) From: "Sam Siewert" X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-Length: 2892 X-Status: X-Keywords: X-UID: 4 Status: RO Hi, If you put an include in this will cause gcc to look for it in /usr/include which is a very bad thing for cross compilation! /usr/include is for the Solaris host only! First, just use "include.h" and then only explicit include paths will be searched by gcc and you should have /usr/local/wind/target/h as an include search path. Second, gcc has an option for -nostdinclude, which should also solve the problem. What happened here is that the compiler found /usr/include/string.h rather than /usr/local/wind/target/h/include. So, avoid the aligator braces! and/or add -nostdinclude to gcc options. This is nasty, but a common cross compilation issue well documented in the GNU gcc manuals. Sam Forwarded message: > From shubharamani@yahoo.com Sat Oct 13 18:30:28 2001 > Message-ID: <20011014003025.30556.qmail@web20007.mail.yahoo.com> > Date: Sat, 13 Oct 2001 17:30:25 -0700 (PDT) > From: Shubha Ramani > Subject: stupid problem > To: Christopher David Lee , > Sam Siewert > MIME-Version: 1.0 > Content-Type: text/plain; charset=us-ascii > Content-Length: 1275 > > I've wasted more time than I care to discuss on this. > > I have a program called test.c which contains the following code : > > #include > > > > char s1[10]; > strcpy(s1, "shubha"); > > > when I do make test.o, I get the following compilation error and I > cannot figure out why : > > knight:~/ecen5003/hw2>make test.o > cc386 -g -mpentium -ansi -nostdinc -DRW_MULTI_THREAD -D_REENTRANT > -fvolatile -nostdlib -fno-builtin -fno-defer-pop -I. > -I/usr/local/wind/target/h -DCPU=PENTIUM -c > /magellan/users2/ecen/grad/shubha/ecen5003/hw2/test.c > /magellan/users2/ecen/grad/shubha/ecen5003/hw2/test.c:6: syntax error > before string constant > /magellan/users2/ecen/grad/shubha/ecen5003/hw2/test.c:6: conflicting > types for `strcpy' > /usr/local/wind/target/h/string.h:57: previous declaration of `strcpy' > /magellan/users2/ecen/grad/shubha/ecen5003/hw2/test.c:6: warning: data > definition has no type or storage class > make: *** [test.o] Error 1 > > Are strings not supported or what ? This is driving me nuts. > > Thanks, > > Shubha > > > ===== > Shubha D. Ramani > > home:303-554-1173, cell:303-263-7369 > 3455 Table Mesa Drive, G-170 > Boulder, CO 80305 > > __________________________________________________ > Do You Yahoo!? > Make a great connection at Yahoo! Personals. > http://personals.yahoo.com > ________________________________________________________________________ Sam Siewert, Ph.D. -- Adjunct Faculty, Embedded Systems Cert. Program University of Colorado Boulder, Electrical and Computer Engineering siewerts@thinker.colorado.edu, www-sgc.colorado.edu/~siewerts/ ________________________________________________________________________