User forums > Help

Cannot compile wxwidget 'hello world' [SOLVED]

<< < (3/4) > >>

RedAlert:
Thanks for your suggestions, Biplab. I tried & got the following error:

---
Switching to target: default
mingw32-g++.exe   -pipe -mthreads -Winvalid-pch -include "wx_pch.h" -DwxUSE_UNICODE -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DUSE_PCH -pipe -mthreads -Winvalid-pch -include "wx_pch.h" -DwxUSE_UNICODE -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DUSE_PCH    -IC:\wxWidgets-2.8.0\include -IC:\wxWidgets-2.8.0\lib\gcc_dll\mswu -IC:\wxWidgets-2.8.0\contrib\include -IC:\wxWidgets-2.8.0\include -IC:\wxWidgets-2.8.0\lib\gcc_dll\mswu -IC:\wxWidgets-2.8.0\contrib\include  -IC:\MinGW\include -c wx_pch.h -o wx_pch.h.gch

mingw32-g++.exe   -pipe -mthreads -Winvalid-pch -include "wx_pch.h" -DwxUSE_UNICODE -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DUSE_PCH -pipe -mthreads -Winvalid-pch -include "wx_pch.h" -DwxUSE_UNICODE -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DUSE_PCH    -IC:\wxWidgets-2.8.0\include -IC:\wxWidgets-2.8.0\lib\gcc_dll\mswu -IC:\wxWidgets-2.8.0\contrib\include -IC:\wxWidgets-2.8.0\include -IC:\wxWidgets-2.8.0\lib\gcc_dll\mswu -IC:\wxWidgets-2.8.0\contrib\include  -IC:\MinGW\include -c main.cpp -o .objs\main.o
cc1plus.exe: calling fdopen: Bad file descriptor
Process terminated with status 1 (0 minutes, 7 seconds)
0 errors, 0 warnings
---

This is not my source since I don't know anything about wxWidgets. It's automatically-generated source from C:B.
I understand what you mean. That's why I feel unusual when it causes error "..wxMenu...ambiguous".
But my explaination is so awkward, perhaps I have to study English writing before study programming ^^

Biplab:

--- Quote from: RedAlert on March 21, 2007, 11:49:01 am ---cc1plus.exe: calling fdopen: Bad file descriptor

--- End quote ---

I'm not sure about this error. But this could be the culprit.


--- Quote from: RedAlert on March 21, 2007, 11:49:01 am ---This is not my source since I don't know anything about wxWidgets. It's automatically-generated source from C:B.

--- End quote ---

C::B generated source would compile properly with all versions of wx lib versions. It's well-tested code. Also you need not wrap it wxT() macro as it already does that for you.

Another point is when you are compiling a sample application, you can turn off PCH support. It's necessary if you're compiling a large project. Otherwise overhead will eat up advantage.


--- Quote from: RedAlert on March 21, 2007, 11:49:01 am ---But my explaination is so awkward, perhaps I have to study English writing before study programming ^^

--- End quote ---

Don't worry, Not all of us are native English speakers. ;)

mandrav:

--- Quote from: RedAlert on March 21, 2007, 11:49:01 am ---cc1plus.exe: calling fdopen: Bad file descriptor

--- End quote ---

You have #included the PCH header in a header file.
PCH should only be #included in source files (e.g. *.cpp).

RedAlert:
Finally I got it run! After recompile wxWidget, I have to modify the source code, which automatically generated by C::B
wxMenu* fileMenu = new wxMenu("");------>wxMenu* fileMenu = new wxMenu;
Compile & run are alright now.

I forgot to tell that I am using C::B 1.0 rc2 with wxWidget2-8.0 and the template code is automatically generated. I think that template code must run without any modification.

@Biplab: I eliminated USE_PCH option but there still has a file wx_pch.h.gch in output directory.
@mandrav: Can you explain a bit more since I don't have knowledge of wxWidgets before? What header file do you mention? There is only one wx_pch.h generated.

Thanks for all your help!

Biplab:

--- Quote from: RedAlert on March 22, 2007, 03:29:32 am ---I forgot to tell that I am using C::B 1.0 rc2 with wxWidget2-8.0 and the template code is automatically generated. I think that template code must run without any modification.

--- End quote ---

This is the root cause to your problem. Code::Blocks RC2 is a very old release and a huge number of changes have been made to Code::Blocks so far. wxWidgets wizard has also got an overhaul. So download a latest nightly from the following forum.


--- Quote ---http://forums.codeblocks.org/index.php/board,20.0.html
--- End quote ---

Don't forget to Uninstall the RC2.


--- Quote from: RedAlert on March 22, 2007, 03:29:32 am ---@Biplab: I eliminated USE_PCH option but there still has a file wx_pch.h.gch in output directory.

--- End quote ---

I think your project still has PCH support. You can safely delete that file. :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version