have you tried linking with your AV software disabled?Antivirus software may indeed be the problem. In particular Kaspersky and Norten will make your computer practically unusable for development, they're as bad or worse than the malware that they presumably prevent.
hi everybody!Is you harddrive heavily fragmented?
I've tried to disable my AV, but nothing happened. it always takes over a minute to link a file... any other ideas?
thank you!
any other ideas?Try "process explorer" from "SysInternals" (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) and track what exactly happens during linking. Notice that you'll need to setup a filter properly so you only see the relevant parts. Otherwise you'll be flooded with information. ;-)
have you tried linking with your AV software disabled?Antivirus software may indeed be the problem. In particular Kaspersky and Norten will make your computer practically unusable for development, they're as bad or worse than the malware that they presumably prevent.
I've been using Kaspersky because you get indefinite free licenses for it from some big computer magazine here, and surely something that's free can't be so bad that it doesn't warrant the price, can it? This assumption is wrong. Kaspersky will increase compile times by about 3/4 and will render quad-core CPUs as well as low-latency storage such as a SSD RAID entirely useless. On top of that, it will perform some kind of "deep scan" on new executables that run immediately after being created (such as 100% of everything that comes out the IDE when you develop, duh), which will freeze the computer for 15-20 seconds.
C:\Documents and Settings\Vladi>mingw32-g++ -v
Reading specs from C:/Programmi/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.5/sp
ecs
Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as -
-host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --
enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shar
ed --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --ena
ble-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-sync
hronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special)
#include <iostream>
using namespace std;
int main () {
cout << "insert a number";
int n;
cin >> n;
cout << 2*n;
}
hi all!
here's what's produced when I write mingw32-g++ -v:CodeC:\Documents and Settings\Vladi>mingw32-g++ -v
Reading specs from C:/Programmi/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.5/sp
ecs
Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as -
-host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --
enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shar
ed --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --ena
ble-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-sync
hronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special)
and here's what I always compile & link:Code#include <iostream>
using namespace std;
int main () {
cout << "insert a number";
int n;
cin >> n;
cout << 2*n;
}
the .o file is about 2kb, while the generated .exe is nearly 500kb
thanks!
Debugging and library code increases size.
Tim S.
the .o file is about 2kb, while the generated .exe is nearly 500kbAccording to your commandline, you are not generating any symbols and not linking to any external libraries. Thus, a program with a 2 kB object file should have minimum PE size, i.e. 4 kB. If it doesn't, then maybe you have some malware on your computer which adds that code (possibly several ones, since 500 kB is quite a lot).
Same here. I am using TDM's GCC 4.4.1(2). The file is as described, not linked against any additional libs (at least that's my purpose).the .o file is about 2kb, while the generated .exe is nearly 500kbThen run strip prova.txt. If the program is now about 4kB, all is good, then the increased size was only due to debug symbols. If it's still around 500 kB and it was really created from a 2 kB object file with a commandline as described above, then you may want to ring the alarm bells.
According to your commandline, you are not generating any symbols and not linking to any external libraries. Thus, a program with a 2 kB object file should have minimum PE size, i.e. 4 kB. If it doesn't, then maybe you have some malware on your computer which adds that code (possibly several ones, since 500 kB is quite a lot).
To be sure it really isn't just debug symbols, though, rename the prova.exe to something that doesn't look like a program, for example prova.txt.
Then run strip prova.txt. If the program is now about 4kB, all is good, then the increased size was only due to debug symbols. If it's still around 500 kB and it was really created from a 2 kB object file with a commandline as described above, then you may want to ring the alarm bells.