Author Topic: Understanding Code::Blocks  (Read 4974 times)

Bulloko

  • Guest
Understanding Code::Blocks
« on: October 10, 2012, 07:36:11 am »
New guy here. I had a few questions (not 'how to' or 'homework questions', so don't worry).

If the answer to any of these questions is some soft of lack of knowledge on my part I apologize. Please just direct me to where I could read more on said topic.

1 - I've used Code::Blocks for awhile and really enjoy it, however the other day I downloaded Visual Studio Express 2012. I took my code from Code::Blocks and pasted it directly into a file in Visual Studio's, my program almost ran as normal however it did not have the same functionality as it did in Code::Blocks. I can't for the life of my figure out why. To me it would seem that C++ code is always the same.
Now, I assumed that perhaps I did not have VS set up correctly, so I made a simple "Hello World" program and compiled and ran just fine. Copy Pasting my Code::Blocks code into it however did not.
Is it just my lack of knowledge with Visual Studio? or does something change between the two programs?

2 - I noticed that the size of the corresponding folders is very different. I wrote a simple program in CB and complied and ran it (using all default settings it comes with upon installation) and it was easily under a 1mb. However when I did the same with Visual Studios it was over 20mbs. Why is that?
(Again, it may be my lack of knowledge with Visual Studios and if so let me know).

I apologize if these questions are vague, but I have explained them the best that I could. I already of course tried to Google and Search the forums for these answers, however its hard trying to find the answer when you aren't completely sure if you asking the right question.

So yeah... you can flame me now.



Offline Radek

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: Understanding Code::Blocks
« Reply #1 on: October 10, 2012, 08:33:03 am »
Flaming is a useless activity which soleves nothing. As to your problem, some hints: VS uses it's own compiler, Code Blocks uses mingw (supposing you are running winblows and you have opted for the best compiler for Code Blocks in winblows). This may cause different sizes of executables. Also, mingw uses libc, which is a DLL. Non-Unix compilers usually link standard C libraries statically. This could also be the reason why your Code Blocks made exe did not work when you copied it somewhere else. You needed to copy libc and possibly other DLLs used by the exe and place them somewhere on the path.

If you linked only with static libraries under Code Blocks, you would see equally big exe's.

More serious issue is different functionality. This should not be. If the "hello world" did not work because it did not find the libc DLL then we know why it did not work. What else does not work?

zabzonk

  • Guest
Re: Understanding Code::Blocks
« Reply #2 on: October 10, 2012, 10:55:57 am »
Quote
winblows

Not funny, not original, and not clever.

Offline Freem

  • Almost regular
  • **
  • Posts: 219
Re: Understanding Code::Blocks
« Reply #3 on: October 11, 2012, 09:53:50 am »
The folder weight is also due to the fact that VS (at least 2008) create big files (dedicated ?) to debugging informations. Debug info are always big.

For your different behaviour, we can not reply without source-code and informations about both behaviours.