http://0xcc.net/pub/uu-2004-08/
や
http://d.hatena.ne.jp/foral/20061224
を見て、wxGladeで生成したhello.cpp&hello.hファイルをMSYSのコンソールから
g++ -c hello.cpp 'wx-config --cxxflags --libs'
でコンパイルしようとしたのですが、以下のようなエラーが出てコンパイルできません。
環境はWindows XP
MinGW&MSYS
wxWidgets2.8.7 (パスは、C:\msys\1.0\home\owner)
です。
普通のC++ファイルのコンパイルは出きるのですがwxWidetsが絡むとできないようです。
In file included from hello.cpp:3:
hello.h:3:10: #include expects "FILENAME" or <FILENAME>
hello.h:4:10: #include expects "FILENAME" or <FILENAME>
In file included from hello.cpp:3:
hello.h:13: error: expected class-name before '{' token
hello.h:18: error: expected `)' before '*' token
hello.h:28: error: ISO C++ forbids declaration of `wxStaticText' with no type
hello.h:28: error: expected `;' before '*' token
hello.h:29: error: ISO C++ forbids declaration of `wxPanel' with no type
hello.h:29: error: expected `;' before '*' token
hello.cpp:6: error: expected `)' before '*' token
hello.cpp: In member function `void MyFrame::set_properties()':
hello.cpp:22: error: `wxT' was not declared in this scope
hello.cpp:22: error: `SetTitle' was not declared in this scope
hello.cpp: In member function `void MyFrame::do_layout()':
hello.cpp:30: error: `wxBoxSizer' was not declared in this scope
hello.cpp:30: error: `sizer_1' was not declared in this scope
hello.cpp:30: error: `wxBoxSizer' is not a type
hello.cpp:30: error: `wxVERTICAL' was not declared in this scope
hello.cpp:31: error: `sizer_2' was not declared in this scope
hello.cpp:31: error: `wxBoxSizer' is not a type
hello.cpp:31: error: `wxHORIZONTAL' was not declared in this scope
hello.cpp:32: error: `label_1' was not declared in this scope
hello.cpp:32: error: `wxFIXED_MINSIZE' was not declared in this scope
hello.cpp:33: error: `panel_1' was not declared in this scope
hello.cpp:37: error: `wxEXPAND' was not declared in this scope
hello.cpp:38: error: `SetAutoLayout' was not declared in this scope
hello.cpp:39: error: `SetSizer' was not declared in this scope
hello.cpp:42: error: `Layout' was not declared in this scope
hello.cpp: At global scope:
hello.cpp:48: error: expected class-name before '{' token
hello.cpp:55: error: expected constructor, destructor, or type conversion before "bool"
g++.exe: wx-config --cxxflags --libs: No such file or directory
解決方法が分かる方いらっしゃしましたらご教示頂けると幸いです。
お礼
回答ありがとうございましたm(_ _)m