473,472 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Object file size increases in windows! why?

26 New Member
My sample.h is
Expand|Select|Wrap|Line Numbers
  1. #include <string>
  2. namespace xxx
  3. {
  4.       class abc
  5.       {
  6.            std::string m_name;
  7.  
  8.            public:
  9.               void initialize();
  10.       };
  11. };  
  12.  
My Sample.cpp is
Expand|Select|Wrap|Line Numbers
  1. #include <sample.h>
  2. using namespace xxx;
  3.  
  4. void abc::initialize()
  5. {
  6.     m_name = "Siva";
  7. }
  8.  
  9.  

My Question is when i compile this code in Linux platform Using g++ compiler My sample.o's Size is 1Kb.. But when the same code is compiled in Windows platform using VC++ Compiler , My sample.o's size is 42Kb..Can some of the experts can help me on this, to reduce the size in windows... Is there any proble with '#include <string>' in Windows platform.
Apr 11 '13 #1
3 1294
weaknessforcats
9,208 Recognized Expert Moderator Expert
What were your VC++ project settings? Release build? Optimize on or off? CLR support yes or no? Unicode yes or no? C or C++?
Favor size over speed?

etc...
Apr 11 '13 #2
Gobi Sakthivel
26 New Member
Release Mode , Maximum optimization O2, No CLR Support, No Unicode , and It is C++ code.

Flags used while compiling /c /W0 /O2 /GX /GR /DVER_7 /D "NDEBUG" /D "_WIN32_"
Apr 12 '13 #3
weaknessforcats
9,208 Recognized Expert Moderator Expert
You should be using the /Os switch to favor small code. /O2 maximixes speed which can cause Visual C++ to create inline functions out of functins that don't have the inline qualiier. That will cause bloat.
Apr 12 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: jayapal | last post by:
Hi all, We have large code on which we are solving the bugs. For every bug we change the code part either add or delete some of the code part. More is adding the code part and very less is...
0
by: Eldon Hall | last post by:
Have situation where over 11gb of free memory but perfstat shows using paging for memory.
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.