Problem running vc++ code with gcc

A

akjohn

My code compiles fine using VC++ 2005 and also with g++/gcc 3.4.2
(mingw...which came with the bloodshed dev c++ ide). But it only the
vc++ build works correctly, the gcc exe starts but hangs...suggesting
some memory problem. On building it with gcc 3.4.4 on red hat linux, I
get a seg fault.

I'm wondering why my code works fine with vc++ and not with g++/gcc.
Are there are any flags I can set in gcc to make it work ok ?. I'm
coding on a windows machine but plan to run the code on a linux
workstation.

Abraham
 
G

Gianni Mariani

My code compiles fine using VC++ 2005 and also with g++/gcc 3.4.2
(mingw...which came with the bloodshed dev c++ ide). But it only the
vc++ build works correctly, the gcc exe starts but hangs...suggesting
some memory problem. On building it with gcc 3.4.4 on red hat linux, I
get a seg fault.

I'm wondering why my code works fine with vc++ and not with g++/gcc.
Are there are any flags I can set in gcc to make it work ok ?. I'm
coding on a windows machine but plan to run the code on a linux
workstation.


This is not uncommon. This is why 2 platform development is a good
thing. You need to debug the Linux version.

Often this is because of a real bug in your code that manifests itself
on one compiler and not the other. I had one recently where I took a
reference of a temporary. The code worked on linux and failed on windows.

very very occasionally, it's a bug in the compiler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,076
Latest member
OrderKetoBeez

Latest Threads

Top