473,976 Members | 13,054 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem running vc++ code with gcc

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...suggest ing
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

Nov 5 '06 #1
1 1552
ak****@gmail.co m wrote:
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...suggest ing
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.
Nov 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2534
by: Stephanie | last post by:
I have a problem that I am trying to solve. We have a huge product with a whole lot of ASP and VB code. VB code is all ActiveX dlls which are used by ASP app. When I attempt to add features or fix bugs, I like to execute the dlls in debug so I can see what is going on. (Some folks in my org seem to have this kinda wacky bias against debugging, as if *real* programmers should not need a debugger. Whatever, it is the fastest way for me to get...
1
1599
by: BKD | last post by:
I have a VC++ 6.0 app that I have converted to 2002. It is running fine except for a problem with using the access keys we have set up on some of the buttons. For instance, ALT+Q causes the Quit button to be clicked which fires the OnQuit() handler. But it asserts in _AfxFindSiteOrWnd() when the call to pWndDlg->GetControlContainer() returns NULL. I compared the Microsoft code in 6.0 and 2002 and I found the code had changed in...
7
2189
by: mef526 | last post by:
I have had this problem for months now and it has been nagging me. I have a large project that has several C++ DLL's, one of them uses malloc / calloc / free for the other DLL's. I process very large datafiles (100MB to 300 MB) that have more than 524,000 lines with 5 columns of numbers in text. I allocate 8 arrays with 524,000 or more doubles , and 10 arrays of 32,768 doubles. Is there a min size for malloc / calloc required to...
1
1461
by: sivakumaran | last post by:
One of my applications is built with VC 6.0. I planned to move the existing code to .NET. As the first step I just wanted to build the existing code without any modifications (Unmanaged code) with VC 7.1 compiler. We used Microsoft Studio .NET 2003 to do that. Our application uses one of the third party library (Stingray). So we rebuilt the Stingray Studio 2004 too with .NET compiler. Everything is fine as of now. But the running...
0
1956
by: simon.hudon | last post by:
Hi everyone, I have a strange problem with precompiled headers with VC8. I have the problem while trying to use a precompiled header to build another precompiled header. I tried the sample code provided on msdn for the use of /Yu /Yc and while it works well with VC++ 7.0, it doesn't with VC++ 8.0 (http://msdn2.microsoft.com/en-us/library/2yzw0wyd.aspx). It gives me this error under VC 8: level2.cpp(3) : fatal error C1083: Cannot...
1
5453
by: Arsalan Ahmad | last post by:
Hi all, I am trying to compile some source files using makefile. While compiling I am getting errors as shown below. Any idea how can I solve this problem. I believe I need to add some preprocessor directives but I dont know which one. Thanks, Arsalan
3
1600
by: lewisksh | last post by:
hi, i have 1 MFC project which is written using VC++2003 but i need to migrate to VC++2005. The program (VC++2003) is working fine. but there is erros occur when running in VC++2005, and i just able to figure out that the problem was come from the following code. # ifdef WIN32 # if defined(MPSC_EXPORT) # define MPSC_API __declspec( dllexport )
5
2507
by: Zytan | last post by:
I cannot stand being unable to change the code while the debugger is running. Is there a way to do this? thanks, Zytan
3
8760
by: aaron.m.johnson | last post by:
Help me understand this, please. I have an older VC++ COM DLL that I'm using in a C# project. One of the COM objects takes a callback object as a parameter so that it can spin off a thread and do some long running network stuff without blocking. When I run the application the callback works as expected, but I get an error when I try to access the COM object in the callback. So the call order is: C# app -VC++ COM DLL thread -C#...
0
10349
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10163
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11812
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10903
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6549
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3756
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.