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]

Re: Optimizing code with cygwin gcc??



[...]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).   [...]

To get rid of your error messages what you need to do is:
	gcc -o exe_name -O2 obj1.o obj2.o
NOT
	gcc -o -O2 exe_name obj1.o obj2.o

But, that will not do any optimization, because that is 
linking which won't do any real optimization. 
What you need to do is change your compile line
that creates the .o files to look like
	gcc -c -O2 obj1.c

Good luck!
Dan


--
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]