This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Optimizing code with cygwin gcc??


hi all,

i've written a bunch of code, that i've compiled 
with cygwin gcc with no problems.  I get an executable
that runs just fine.  I read in the "Programming With
GNU Software" book that you can give gcc the -O1 or
-O2 option which produces optimized code (if nothing
is specified then -O0 is used, which means no
optimizations), when i compile and link my code using
the -O1 or -O2 options i get get tons of error
messages during linking time ( gcc -o -O2 exe_name
obj1.o obj2.o).  All the error messages are as
follows:

G:\cygnus\cygwin-b20\H-i586-cygwin32\bin>gcc -o -O1
engine.exe main.o FieldEditCheckFILE.o
FieldEditCheckHDR.o FieldEditCheckRefDATA.o
FieldEditCheckResDATA.o FieldEditCheckTransDATA.o
NumericFieldEditCheck.o BookKeepingInit.o
FileRecInit.o
HdrRecInit.o ProcessInitFile.o ReferenceDataRecInit.o
ResultsDataRecInit.o TransactionDataRecInit.o
CleanUp.o DataDump.o ErrorHandler.o InsertNULL.o Log.o
ScanInput.o StripSpecialChar.o StrToLower.o
TimeStamp.o TimeTrack.o Trace.o UnexpectedState.o
WorkSpaceDump.o WorkSpaceToFile.o
AllocateTransactionWorkSpace.o EndMetaFileProcessing.o
ProcessMetaFile.o ProcessReferenceData.o
ProcessResultsData.o
 ProcessTransactionData.o AddCountDistinctNode.o
CreateRecordDefinition.o
GetEventCounterTransactionNode.o SearchFDL.o
SearchFDLConditional.o VerifyTransactionN
ode.o AllocateMemoryWorkspace.o QuickSort.o
BinarySearch.o MultiJoin.o ParseFixed.o
ParseVariable.o ReadReferenceDataNodes.o
ReadReferenceFiles.o ReadReferenceJoinNodes.o
ReadTransactionDataNodes.o ReadTransactionFiles.o
ReadTransactionJoinNodes.o ConcatenateDataNodes.o
ConcatenateEmptyNodes.o Summarize.o
WriteResultsFiles.o InsertionSort.o Precision.o
SetFormatSpec.o CheckUnique.o RadixQuickSort.
o ConvertToJulian.o ConvertToWestern.o
GetCurrentDate.o IsLeapYear.o MonthFromJulian.o
YearFromJulian.o CheckConditional.o
CreateConditionalList.o InitConditionData.o
IsConditionNode.o ProcessConditionalBETWEEN.o
ProcessConditionalIN.o ProcessConditionInput.o
SetAverageDistinctRange.o StackEmpty.o StackFree.o
StackInit.o StackPop.o StackPush.o
engine.exe: In function `mainCRTStartup':
/home/noer/src/b20/comp-tools/devo/newlib/libc/sys/cygwin32/crt0.c:28:
multiple
definition of `mainCRTStartup'
G:\cygnus\cygwin-b20\H-i586-cygwin32\bin\.\..\lib\gcc-lib\i586-cygwin32\egcs-2.9
1.57\..\..\..\..\i586-cygwin32\lib\crt0.o:/home/noer/src/b20/comp-tools/devo/new
lib/libc/sys/cygwin32/crt0.c:28: first defined here
engine.exe: In function `cygwin_attach_noncygwin_dll':
/home/noer/src/b20/comp-tools/devo/winsup/libccrt0.cc:102:
multiple definition of `__cygwin_crt0_bp'
G:\cygnus\cygwin-b20\H-i586-cygwin32\bin\.\..\lib\gcc-lib\i586-cygwin32\egcs-2.9
1.57\..\..\..\..\i586-cygwin32\lib\crt0.o:/home/noer/src/b20/comp-tools/devo/new
lib/libc/sys/cygwin32/crt0.c:28: first defined here
main.o(.text+0x628):main.c: multiple definition of
`main'
engine.exe:/home/noer/src/b20/comp-tools/devo/newlib/libc/sys/cygwin32/crt0.c:49
: first defined here
FieldEditCheckFILE.o(.text+0x2b0):FieldEditCheck:
multiple definition of `FieldE
ditCheckFILE'
engine.exe:/home/noer/src/b20/comp-tools/devo/newlib/libc/sys/cygwin32/crt0.c:49
: first defined here
FieldEditCheckHDR.o(.text+0x1a4):FieldEditCheck:
multiple definition of `FieldEd
itCheckHDR'
engine.exe:/home/noer/src/b20/comp-tools/devo/newlib/libc/sys/cygwin32/crt0.c:49
: first defined here
FieldEditCheckRefDATA.o(.text+0x384):FieldEditCheck:
multiple definition of `Fie
ldEditCheckRefDATA'
engine.exe:/home/noer/src/b20/comp-tools/devo/newlib/libc/sys/cygwin32/crt0.c:49
: first defined here
FieldEditCheckResDATA.o(.text+0x4c4):FieldEditCheck:
multiple definition of `Fie
ldEditCheckResDATA'
engine.exe:/home/noer/src/b20/comp-tools/devo/newlib/libc/sys/cygwin32/crt0.c:49
: first defined here
FieldEditCheckTransDATA.o(.text+0x524):FieldEditCheck:
multiple definition of `F
ieldEditCheckTransDATA'
engine.exe:/home/noer/src/b20/comp-tools/devo/newlib/libc/sys/cygwin32/crt0.c:49
: first defined here
NumericFieldEditCheck.o(.text+0x0):NumericFieldEd:
multiple definition of `Numer
icFieldEditCheck'
engine.exe:/home/noer/src/b20/comp-tools/devo/newlib/libc/sys/cygwin32/crt0.c:49
: first defined here
BookKeepingInit.o(.text+0x0):BookKeepingIni: multiple
definition of `BookKeeping
Init'

...and more.  I'm very confused, without attempting to
use the -O2 or -O1 option, my code compiles and runs
without a warning, but as soon as i put that in, i get
the errors on linking time.  What am i doing wrong? 
Any ideas ?

Thanks !

Raman Bakshi
_____________________________________________________________
Do You Yahoo!?
Free instant messaging and more at http://messenger.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]