User forums > Help

Cannot compile wxwidget 'hello world' [SOLVED]

<< < (2/4) > >>

RedAlert:

--- Quote from: Biplab on March 21, 2007, 05:48:58 am ---Why don't you use wxWidgets Project Wizard?

It's the most elegant way to start programming with wxWidgets. :)

Please try it, if you haven't used it earlier.

--- End quote ---

Hi Biplab,

I started with File\New Project and choose wxWidgets Application. Did you mean that?

There's no problem if I use VC6. I compiled wxWidget-2.8.0 to use with both VC6 (non-unicode) & C:B (unicode)

BTW, sorry that's not helloworld program. It's a simple window with menu (you can test it using wxWidget template in C:B with defaults) ^^

Biplab:

--- Quote from: RedAlert on March 21, 2007, 07:34:43 am ---I started with File\New Project and choose wxWidgets Application. Did you mean that?

--- End quote ---

Yes I'm pointing to that only.


--- Quote from: RedAlert on March 21, 2007, 07:34:43 am ---There's no problem if I use VC6. I compiled wxWidget-2.8.0 to use with both VC6 (non-unicode) & C:B (unicode)

--- End quote ---

I'm not very clear on your message. But C::B can handle all possible wxWidgets configurations excluding wxUniversal Build. So it doesn't matter if you are using Unicode/Non-unicode build. C::B has solutions for all. :)

mandrav:

--- Quote ---Is that C:B didn't realize wxMenu constructors? How do I solve out this problem?
--- End quote ---

Learn to read the compiler's error messages. They are not printed just to decorate the build log...


--- Quote ---There's no problem if I use VC6. I compiled wxWidget-2.8.0 to use with both VC6 (non-unicode) & C:B (unicode)

--- End quote ---

And if you 're gonna start comparing, don't compare apples to oranges. Your code wouldn't work with VC6 in unicode mode too, I guarantee you that. Just read the errors.

RedAlert:
There are more than 1 wxMenu constructor in main.h and the compiler doesn't know which one to choose. Am I right?

This is Unicode-related error so I think adding wxUSE_UNICODE must solve the problem. Do I miss anything?

Biplab:

--- Quote from: RedAlert on March 21, 2007, 10:14:35 am ---Do I miss anything?

--- End quote ---

Yes! You are not understanding the role of C::B properly.

C::B is an IDE, which essentially helps you to communicate with compiler (which may be any) to compile a source. C::B doesn't bother what code you are putting in the source files and it sends the file in same condition to the compiler as you are supplying it.


--- Quote from: RedAlert on March 21, 2007, 10:14:35 am ---There are more than 1 wxMenu constructor in main.h and the compiler doesn't know which one to choose. Am I right?

This is Unicode-related error so I think adding wxUSE_UNICODE must solve the problem.

--- End quote ---

Multiple wxMenu constructor is NOT a problem which is related to wxUSE_UNICODE (which essentially enables Unicode mode). It's your code which is the source of problem.

You can have multiple constructor of different wxMenu objects, but you can't construct the same object again and again in same piece of code. So it all depends on how you've crafted the code.

Sorry, C::B is not at fault in this case. C::B won't mess with or improve your buggy code.


BTW, looking at the error log, it seems that you are not wrapping char* with wxT() macro.

What I mean to say is if you have code similar to:

--- Code: ---wxMenu* fileMenu = new wxMenu("My Menu");
--- End code ---

Change it to:

--- Code: ---wxMenu* fileMenu = new wxMenu(wxT("My Menu"));
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version