Newbie needs help: GCC, G++ and VC++

General questions regarding the usage of CodeLite
extreme001
CodeLite Curious
Posts: 2
Joined: Wed Aug 19, 2009 2:03 am
Contact:

Newbie needs help: GCC, G++ and VC++

Post by extreme001 »

Hi!

I'm very new to gcc, g++ and CodeLite and have some questions about configuring VC++ with CodeLite and gcc, g++ in general.

1. I compiled wxWidgets with GCC and created a small sample with the CodeLite-Projectwizard.
The build config is g++, i compiled it and after that my Debug and Release exe was very big (Debug: 43 MB, Release: 5,16 MB ). I think that's to much for a simple console-App. (see bottom)

2. I have no idea how to configure CodeLite to use the MSVS 9-Compilers (i always used Visual Studio (VC) for coding).

Does someone have a tutorial for that? I want to use the CodeLite-IDE with VC++ from visual Studio 2009 to compile.

Thank you!!

Here's my sample code i used:

Code: Select all

// main wxWidgets header file
#include <wx/wx.h>

int main( int argc, char** argv )
{
	// initialize wxWidgets
	wxInitializer init;
	
	wxPrintf( wxT("Hello in wxWidgets World!\n\n") );
	
	// print some system info...
	wxPuts(wxGetHomeDir());
	wxPuts(wxGetOsDescription());
	wxPuts(wxGetUserName());
	wxPuts(wxGetFullHostName());

	long mem = wxGetFreeMemory().ToLong();
	wxPrintf(wxT("Memory: %ld\n"), mem);

	return 0;
}
marfi
CodeLite Expert
Posts: 159
Joined: Mon Nov 03, 2008 9:17 pm
Contact:

Re: Newbie needs help: GCC, G++ and VC++

Post by marfi »

The build config is g++, i compiled it and after that my Debug and Release exe was very big (Debug: 43 MB, Release: 5,16 MB ). I think that's to much for a simple console-App.
Did you try to set -s flag for linker in Release mode?

This is true that Gcc/G++ produces slightly bigger executable than VC++ but in constrast to the VC++ it links all compiler runtimes with your application so you don't need to distribute the application together with many DLL files like with application built using VC++. Moreover, if you use VC++ you wont be able to debug the application because GDB used by CL doesn't work with debug symbols produced by VC++ (I guess).
extreme001
CodeLite Curious
Posts: 2
Joined: Wed Aug 19, 2009 2:03 am
Contact:

Re: Newbie needs help: GCC, G++ and VC++

Post by extreme001 »

Hi!

Yes, i used the -s flag. No compression at all. Thank you very much.
I think it's better to use Visual Studio...

If anyone has another idea....please post.

THANKS!
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Newbie needs help: GCC, G++ and VC++

Post by eranif »

extreme001 wrote:I think it's better to use Visual Studio...
If you really need to work with VC++, then I suggest that you use Visual Studio. CodeLite does not support debugging for code generated by VC++.
For using g++/gcc, now this is another story - and I will be happy to help you if you choose to work with codelite and g++

However, if you still insist on configuring codelite for VC++, you can do this by choosing the correct compiler for your project.
right click on the project and select 'settings'
in the General tab, select the compiler VC++.

To "fine tune" this compiler settings (include paths, toolchain etc) go to settings -> build settings -> compilers. and select the VC++ compiler from the tree.
Play with it until it will work for you.

Btw, if you are familiar with VS, you should be able to find your way in codelite, pretty easy
Eran
Make sure you have read the HOW TO POST thread
Post Reply