Weird glitch/bug with c++ program compiled in Ubuntu? or am I doing something wrong?

John Shaver bobjohnbob at gmail.com
Wed Feb 15 15:23:31 MST 2012


On Wed, Feb 15, 2012 at 3:13 PM, S. Dale Morrey <sdalemorrey at gmail.com> wrote:
> I've seen stuff like this before.
> Your linux compiler is probably compiling with -02 or higher
> optimizations.  Windows is probably lower than that (assuming you are
> using mingw).
>
> Take a look and see if that isn't the case.

I'm not using any -0 option when compiling, so I think it uses pretty
much no optimization, from what I just read in the man file for g++.
Maybe I'm not understanding it though.

Is there a way to check what the default level is?

Here is my make file if it helps:

project05: calc.o project5.exe
        g++ -g calc.o -o project05

project5.exe: calcw.o
        i586-mingw32msvc-g++ -g calcw.o -o project5.exe

calc.o: calc.cpp stack.h
        g++ -g -c calc.cpp -o calc.o

calcw.o: calc.cpp stack.h
        i586-mingw32msvc-g++ -g -c calc.cpp -o calcw.o


More information about the PLUG mailing list