• ベストアンサー
※ ChatGPTを利用し、要約された質問です(原文:wxGladeで生成したhello.cpp&hello.hファイルをコンパイルしようとするとエラーが出ます)

wxGladeで生成したhello.cpp&hello.hファイルをコンパイルできないエラーの解決方法

このQ&Aのポイント
  • 質問者は、wxGladeで生成したhello.cpp&hello.hファイルをコンパイルしようとしましたが、エラーが発生しました。
  • 質問者の環境はWindows XP、MinGW&MSYS、wxWidgets2.8.7です。
  • 解決方法が分かる方は教えてください。

質問者が選んだベストアンサー

  • ベストアンサー
  • Tacosan
  • ベストアンサー率23% (3656/15482)
回答No.1

MSYS は使ったことないけど, 少なくとも g++ -c hello.cpp 'wx-config --cxxflags --libs' の ' はおかしい気がする. 普通の sh なら ` じゃないかな?

miraikako
質問者

お礼

回答ありがとうございましたm(_ _)m

全文を見る
すると、全ての回答が全文表示されます。

関連するQ&A

  • C++コンパイルエラーの原因を教えてください

    Cには詳しいのですが、C++があまりよくわかっておらず、質問させてください。 今回、手に入れたC++のあるプログラムをmakeしています(x86_64 Linux)。 以下のようなエラーが出てコンパイルできないのですが、何が悪いのか全く理解できず困っています。 他の環境ではコンパイルできているらしいので、わたしの環境の何が悪いのか、考えられることがありましたら、何でも書き込んでいただけると嬉しいです。 よろしくお願いします。 g++ -c -I../MathUtils -I../CommonUtils -DHAVE_ZLIB -DHAVE_BZLIB -fomit-frame-pointer -O2 -DFTYPE=float -Wall -Wsign-compare -Wpointer-arith -pedantic -DHAVE_PGPLOT -I. -DHAVE_FFTW -o analyse_image.o analyse_image.cpp In file included from analyse_image.cpp:21: Tools.h:16:15: warning: anonymous variadic macros were introduced in C99 analyse_image.cpp: In function ‘int main(int, char**)’: analyse_image.cpp:114: error: ‘strcmp’ was not declared in this scope analyse_image.cpp:205: error: ‘exit’ was not declared in this scope analyse_image.cpp:209: error: ‘strstr’ was not declared in this scope analyse_image.cpp:216: error: ‘exit’ was not declared in this scope analyse_image.cpp:457: error: ‘strlen’ was not declared in this scope make: *** [analyse_image.o] Error 1

  • コンパイルエラーの英語の読み方

    #include <stdio.h> int main() { printf("Hello, World"; } と書くと error: expected ‘)’ before ‘;’ token error: expected ‘;’ before ‘}’ token と表示されます。 ;の前に)がないと言っているようですが、expectedは名詞の後にくるものだと思うので、 error: ‘)’expected before ‘;’ token だと思うのですが、これについて回答をよろしくお願いします。

  • エラーがとれません 助けてください

    エラーがとれません 助けてください http://cs.fit.edu/~mmahoney/dist/eval4.cpp をコンパイルすると eval4.cpp: In member function ‘bool Attack::read(FILE*)’: eval4.cpp:105: error: ‘strlen’ was not declared in this scope eval4.cpp:114: error: ‘strchr’ was not declared in this scope eval4.cpp: In function ‘int main(int, char**)’: eval4.cpp:132: warning: deprecated conversion from string constant to ‘char*’ eval4.cpp:133: warning: deprecated conversion from string constant to ‘char*’ eval4.cpp:134: warning: deprecated conversion from string constant to ‘char*’ eval4.cpp:183: error: ‘strlen’ was not declared in this scope のようなエラーがでてしまいます。 Ubuntuのg++でコンパイルしています。 なにがまずいのでしょうか?

  • 箱庭諸島2+でコンパイルエラー

    Windows XP SP3 + GCC4.4.0を使っています。 「箱庭諸島の保管庫」というサイトから箱庭諸島2+をダウンロードしてきて、コマンドプロンプトから、解凍したディレクトリに移動し、makeを実行しました。すると、 g++ -c -O2 -Wall main.c In file included from main.c:1: main.h:5:21: error: iostream.h: No such file or directory In file included from main.h:6, from main.c:1: hako_io.h:5:20: error: fstream.h: No such file or directory In file included from info.h:7, from hako_io.h:12, from main.h:6, from main.c:1: value.h:30: error: 'ifstream' has not been declared In file included from hako_io.h:12, from main.h:6, from main.c:1: info.h:30: error: 'ifstream' has not been declared info.h:33: error: 'ofstream' has not been declared info.h:101: error: 'ifstream' has not been declared info.h:104: error: 'ofstream' has not been declared In file included from hako_io.h:14, from main.h:6, from main.c:1: map.h:32: error: 'ofstream' has not been declared map.h:35: error: 'ifstream' has not been declared map.h:185: error: 'ofstream' has not been declared map.h:188: error: 'ifstream' has not been declared In file included from hako_io.h:15, from main.h:6, from main.c:1: command.h:20: error: 'ifstream' has not been declared command.h:21: error: 'ofstream' has not been declared command.h:74: error: 'ifstream' has not been declared command.h:75: error: 'ofstream' has not been declared In file included from main.h:6, from main.c:1: hako_io.h:29: error: ISO C++ forbids declaration of 'ofstream' with no type hako_io.h:29: error: expected ';' before '*' token main.c: In function 'int main()': main.c:5: error: 'srandom' was not declared in this scope make: *** [main.o] Error 1 というエラーが出て、コンパイルされません。 原因はいったいどこにあるのでしょうか。 「ifstream」や「ofstream」といった単語が多く見られるので、そこがエラーの元だとは思うのですが… どなたか、知恵をお貸しいただけないでしょうか。

  • typedef部分でのコンパイルエラー

    本に付属のプログラムを動かそうとしているのですが、コンパイルエラーが出て困っています。 言語はC++、コンパイル環境はCygwinでg++です。 typedef CellUtil<ExpressionCell> CellType; extern CellType *uCell; 上記の部分で 106: error: expected init-declarator before '<' token 106: error: expected `,' or `;' before '<' token 107: error: expected init-declarator before '*' token 107: error: expected `,' or `;' before '*' token とエラーが出ます。 CellType *uCell は別のcppファイルで宣言してあります。 typedefでは<>記号は使えたと思うので、何が原因か知っている方教えてください。 本自体も10年前に発行されたものなのでいろいろ困惑しています。 お願いします。

  • gccでコンパイル時のエラー

    // test.cpp #include <stdio> using namespace std; int main(int argc, char *argv[]) { printf("test\n"); return 0; } 上記コードをコンパイルしたいのですが make -k g++ -g -O2 -Wall -I. -c test.cpp -o test.obj test.cpp:2:17: stdio: No such file or directory test.cpp: In function `int main(int, char**)': test.cpp:7: error: `printf' was not declared in this scope test.cpp:7: warning: unused variable 'printf' make: *** [test.obj] Error 1 make: Target `all' not remade because of errors. となります。 #include <stdio> using namespace std; を #include <stdio.h> // using namespace std; にすれば正常に終了するのですがなぜでしょうか? gccはMingw5.1.6からインストールしたもので、 バージョンはgcc3.4.5です。 Meadow上から実行しました。 回答よろしくお願い致します。

  • CGIへのコンパイルエラー

    初めまして。プログラミング暦はほとんどありません。javaを少しかじった程度です。今回Ajaxへ挑戦しようと思い、 http://itpro.nikkeibp.co.jp/article/COLUMN/20060115/227278/?ST=nettech の予測補完インタフェースを作成しよとしています。 環境はfedoracore5でXPからのputyからの遠隔です。 complete.cをcomplete.cgiへコンパイルするときに、 [root@localhost html]# gcc -Wall -O2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include complete.c -o complete.cgi -lglib-2.0 -lsary -lpthread complete.c:1: error: stray ‘\357’ in program complete.c:1: error: stray ‘\273’ in program complete.c:1: error: stray ‘\277’ in program complete.c:1: error: stray ‘#’ in program complete.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token In file included from complete.c:2: /usr/include/string.h:39: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:43: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:52: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:59: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:62: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:66: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:88: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:96: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:102: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:109: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strxfrm’ /usr/include/string.h:184: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strcspn’ /usr/include/string.h:188: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strspn’ /usr/include/string.h:242: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strlen’ /usr/include/string.h:270: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:288: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:292: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:296: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:299: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/string.h:329: error: expected declaration specifiers or ‘...’ before ‘size_t’ In file included from /usr/include/string.h:417, from complete.c:2: /usr/include/bits/string2.h:969: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c1’ /usr/include/bits/string2.h:971: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c1’ /usr/include/bits/string2.h:979: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c2’ /usr/include/bits/string2.h:982: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c2’ /usr/include/bits/string2.h:991: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c3’ /usr/include/bits/string2.h:994: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c3’ とエラーがでます。どうしたらいいでしょうか?(文字数の関係で半分しか掲載できませんでした。)よろしくお願いいたします。

    • ベストアンサー
    • CGI
  • WinMainのコンパイルについて

    こんにちわ。 某動画のまねをしてテトリスの作成に取り掛かっているのですが、最初から躓いてしまい困っています。 ◆現象 コンパイル時にWinMainが再宣言されているというような内容のエラーが出てしまい、コンパイルに失敗する D:\tetris>gcc -mwindows tetris.cpp tetris.cpp:18: error: `int WinMain' redeclared as different kind of symbol C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1109: error: previous declaration of `int WinMain(HINSTANCE__*, HINSTANC E__*, CHAR*, int)' tetris.cpp:18: error: declaration of `int WinMain' C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1109: error: conflicts with previous declaration `int WinMain(HINSTANCE_ _*, HINSTANCE__*, CHAR*, int)' tetris.cpp:18: error: `HINSTANSCE' was not declared in this scope tetris.cpp:18: error: expected primary-expression before "hPrevInst" tetris.cpp:18: error: expected primary-expression before "cmdLine" tetris.cpp:18: error: expected primary-expression before "int" tetris.cpp:18: error: initializer expression list treated as compound expression tetris.cpp:18: error: expected `,' or `;' before '{' token ◆環境 OS:Windows コンパイラ:MinGW ◆問題個所のソース int WinMain(HINSTANSCE hInst, HINSTANCE hPrevInst, LPSTR cmdLine, int cmdShow){ WinMainの宣言個所はここだけなのでエラーの意味がよくわからず、色々と調べてみましたが原因はよくわかりませんでした。 Win32APIについてはあまり詳しくないので(C++の原因かもしれませんが)解説できる方がいらっしゃったらご回答願います。

  • ANSI C コンパイルエラー

    下記のファイルをコンパイルする際にCent OS & Windows7 ではReadme 通りにコンパイルできたんですがMac OSX Lion では以下のエラーが出てしまいます。 http://www.itu.int/rec/T-REC-G.711-200911-I!Amd2/en どのようにしたらよいのでしょうかご教示お願いいたします。 コンパイルエラー ーーーーーーーーーーーーーーーーーーーーーーーー make -C src/mainlib "CC=gcc" "CXX=g++" gcc -O2 -Wall -fno-builtin -DWMOPS=1 -DAPPENDIX_I_POSTFILTER -I../basicOp_stl2005_v2.2 -Iutil -Ig711wbe -Ilower_band -Ihigher_band -Iapp1_postfilter -c util/dsputil.c -o util/dsputil.o In file included from ../basicOp_stl2005_v2.2/stl.h:27, from util/dsputil.h:18, from util/dsputil.c:11: ../basicOp_stl2005_v2.2/basop32.h:52: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Overflow’ ../basicOp_stl2005_v2.2/basop32.h:53: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Carry’ ../basicOp_stl2005_v2.2/basop32.h:67: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘add’ ../basicOp_stl2005_v2.2/basop32.h:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘sub’ ../basicOp_stl2005_v2.2/basop32.h:69: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘abs_s’ ../basicOp_stl2005_v2.2/basop32.h:70: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘shl’ ../basicOp_stl2005_v2.2/basop32.h:71: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘shr’ . . . . . .

  • arduino due tone()について

    arduino due を使用しtone()関数を使用しようとしたところ ”tone was not declared in this scope”と表示されました。uno では使えたんですが・・・ 原因がわかる方教えてください。また、解決方法ありましたらそちらもご教授ください。