Author Topic: Repeat issue, but i cannot solve it...  (Read 8334 times)

Offline laidback_01

  • Single posting newcomer
  • *
  • Posts: 2
Repeat issue, but i cannot solve it...
« on: January 24, 2010, 07:52:07 am »
This has been asked before, and I've tried the suggestions found here: http://forums.codeblocks.org/index.php/topic,7274.0.html
This hasn't worked for me, and my issue is identical.

Here's what I've got - linux mint recent release.
g++ (Ubuntu 4.4.1-4ubuntu9) 4.4.1
Code::Blocks 8.02
wx2.8.10 (Linux, Unicode)
This is an x64 setup
2.6.31-14-generic #48-Ubuntu SMP x86_64 GNU/Linux

So, I'm following the Code::Blocks wiki tutorials for HelloWorld.  The first one with the Close button.  I'm at the point where i wish to build the project.

When I do so, these are the errors i get:



-------------- Build: Debug in HelloWorld ---------------

Compiling: HelloWorldApp.cpp
In file included from /usr/include/wx-2.8/wx/debug.h:18,
                 from /usr/include/wx-2.8/wx/defs.h:521,
                 from /usr/include/wx-2.8/wx/event.h:15,
                 from /usr/include/wx-2.8/wx/app.h:20,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.h:13,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.cpp:10:
/usr/include/assert.h:39:42: error: missing binary operator before token "("
/usr/include/assert.h:108:42: error: missing binary operator before token "("
In file included from /usr/include/libio.h:62,
                 from /usr/include/stdio.h:75,
                 from /usr/include/wx-2.8/wx/wxchar.h:21,
                 from /usr/include/wx-2.8/wx/debug.h:22,
                 from /usr/include/wx-2.8/wx/defs.h:521,
                 from /usr/include/wx-2.8/wx/event.h:15,
                 from /usr/include/wx-2.8/wx/app.h:20,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.h:13,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.cpp:10:
/usr/include/sys/cdefs.h:46:44: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:50:44: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:135:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:148:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:206:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:215:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:224:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:233:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:245:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:255:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:264:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:272:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:286:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:294:43: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:317:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:326:20: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:331:20: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:338:19: error: missing binary operator before token "("
In file included from /usr/include/wx-2.8/wx/wxchar.h:101,
                 from /usr/include/wx-2.8/wx/debug.h:22,
                 from /usr/include/wx-2.8/wx/defs.h:521,
                 from /usr/include/wx-2.8/wx/event.h:15,
                 from /usr/include/wx-2.8/wx/app.h:20,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.h:13,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.cpp:10:
/usr/include/wchar.h:55:42: error: missing binary operator before token "("
In file included from /usr/include/sched.h:35,
                 from /usr/include/pthread.h:25,
                 from /usr/include/c++/4.4/x86_64-linux-gnu/bits/gthr-default.h:41,
                 from /usr/include/c++/4.4/x86_64-linux-gnu/bits/gthr.h:162,
                 from /usr/include/c++/4.4/ext/atomicity.h:34,
                 from /usr/include/c++/4.4/bits/basic_string.h:41,
                 from /usr/include/c++/4.4/string:53,
                 from /usr/include/wx-2.8/wx/string.h:176,
                 from /usr/include/wx-2.8/wx/wxchar.h:1323,
                 from /usr/include/wx-2.8/wx/debug.h:22,
                 from /usr/include/wx-2.8/wx/defs.h:521,
                 from /usr/include/wx-2.8/wx/event.h:15,
                 from /usr/include/wx-2.8/wx/app.h:20,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.h:13,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.cpp:10:
/usr/include/bits/sched.h:126:20: error: missing binary operator before token "("
/usr/include/bits/sched.h:164:20: error: missing binary operator before token "("
In file included from /usr/include/wx-2.8/wx/filefn.h:28,
                 from /usr/include/wx-2.8/wx/utils.h:21,
                 from /usr/include/wx-2.8/wx/cursor.h:41,
                 from /usr/include/wx-2.8/wx/event.h:22,
                 from /usr/include/wx-2.8/wx/app.h:20,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.h:13,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.cpp:10:
/usr/include/sys/types.h:158:20: error: missing binary operator before token "("
In file included from /usr/include/wx-2.8/wx/debug.h:18,
                 from /usr/include/wx-2.8/wx/defs.h:521,
                 from /usr/include/wx-2.8/wx/event.h:15,
                 from /usr/include/wx-2.8/wx/app.h:20,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.h:13,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.cpp:10:
/usr/include/assert.h:71: error: expected constructor, destructor, or type conversion before ‘extern’
/usr/include/assert.h:79: error: expected initializer before ‘__THROW’
/usr/include/assert.h:85: error: expected initializer before ‘__THROW’
/usr/include/assert.h:88: error: ‘__END_DECLS’ does not name a type
In file included from /usr/include/wx-2.8/wx/wxchar.h:21,
                 from /usr/include/wx-2.8/wx/debug.h:22,
                 from /usr/include/wx-2.8/wx/defs.h:521,
                 from /usr/include/wx-2.8/wx/event.h:15,
                 from /usr/include/wx-2.8/wx/app.h:20,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.h:13,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.cpp:10:
/usr/include/stdio.h:49: error: expected constructor, destructor, or type conversion before ‘typedef’
/usr/include/stdio.h:65: error: expected constructor, destructor, or type conversion before ‘typedef’
In file included from /usr/include/stdio.h:75,
                 from /usr/include/wx-2.8/wx/wxchar.h:21,
                 from /usr/include/wx-2.8/wx/debug.h:22,
                 from /usr/include/wx-2.8/wx/defs.h:521,
                 from /usr/include/wx-2.8/wx/event.h:15,
                 from /usr/include/wx-2.8/wx/app.h:20,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.h:13,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.cpp:10:
/usr/include/libio.h:332: error: ‘size_t’ does not name a type
/usr/include/libio.h:336: error: ‘size_t’ was not declared in this scope
/usr/include/libio.h:364: error: ‘size_t’ has not been declared
/usr/include/libio.h:373: error: ‘size_t’ has not been declared
/usr/include/libio.h:493: error: ‘size_t’ does not name a type
In file included from /usr/include/wx-2.8/wx/wxchar.h:21,
                 from /usr/include/wx-2.8/wx/debug.h:22,
                 from /usr/include/wx-2.8/wx/defs.h:521,
                 from /usr/include/wx-2.8/wx/event.h:15,
                 from /usr/include/wx-2.8/wx/app.h:20,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.h:13,
                 from /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.cpp:10:
/usr/include/stdio.h:172: error: expected initializer before ‘*’ token
/usr/include/stdio.h:214: error: ‘FILE’ was not declared in this scope
/usr/include/stdio.h:214: error: ‘__stream’ was not declared in this scope
/usr/include/stdio.h:219: error: ‘FILE’ was not declared in this scope
/usr/include/stdio.h:219: error: ‘__stream’ was not declared in this scope
/usr/include/stdio.h:249: error: expected initializer before ‘*’ token
/usr/include/stdio.h:255: error: expected initializer before ‘*’ token
/usr/include/stdio.h:309: error: variable or field ‘setbuf’ declared void
/usr/include/stdio.h:309: error: ‘FILE’ was not declared in this scope
/usr/include/stdio.h:309: error: expected primary-expression before ‘__restrict__’
/usr/include/stdio.h:309: error: expected primary-expression before ‘char’
/usr/include/stdio.h:313: error: ‘FILE’ was not declared in this scope
/usr/include/stdio.h:313: error: expected primary-expression before ‘__restrict__’
/usr/include/stdio.h:313: error: expected primary-expression before ‘char’
/usr/include/stdio.h:314: error: expected primary-expression before ‘int’
Process terminated with status 1 (0 minutes, 1 seconds)
50 errors, 0 warnings
 


Now, trying to compile on the command line fails as well, but I guess because i'm not doing something right...


g++ HelloWorldMain.h HelloWorldMain.cpp HelloWorldApp.h HelloWorldApp.cpp `wx-config --libs` `wx-config --cxxflags` -o HelloWorld.out
HelloWorldMain.cpp: In member function ‘void HelloWorldFrame::OnQuit(wxCommandEvent&)’:
HelloWorldMain.cpp:115: error: no matching function for call to ‘HelloWorldFrame::Close()’
HelloWorldMain.h:35: note: candidates are: void HelloWorldFrame::Close(wxCommandEvent&)
HelloWorldMain.cpp: In member function ‘void HelloWorldFrame::Close(wxCommandEvent&)’:
HelloWorldMain.cpp:126: error: no matching function for call to ‘HelloWorldFrame::Close()’
HelloWorldMain.cpp:124: note: candidates are: void HelloWorldFrame::Close(wxCommandEvent&)


Now, I do have `wx-config --cxxflags` in my build options, compiler settings, other options for both debug and release.  Same for the wx-config --libs in the linker part.

I'm sure it's something really simple, but alas, I'm new to this...

any help is greatly appreciated!
thanks,
Jack


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Repeat issue, but i cannot solve it...
« Reply #1 on: January 24, 2010, 02:55:52 pm »
Please turn on full commandline logging and post what is sent to the compiler:
change "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline"

Offline laidback_01

  • Single posting newcomer
  • *
  • Posts: 2
Re: Repeat issue, but i cannot solve it...
« Reply #2 on: January 24, 2010, 04:37:08 pm »
Okay, here's the output.



-------------- Build: Debug in HelloWorld ---------------

g++ -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread      -I/usr/include/wx-2.8/wx  -c /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.cpp -o obj/Debug/HelloWorldApp.o


Right after that, it throws the 50 errors.

Now, I've not been using the settings options - only putting the wx-config pieces into the Project -> Build Options... areas.  In the settings area for the debug and release, those similar places for the compiler and linker are empty.  I've tried it several ways though - filling out everything in the settings area, filling out ONLY the settings area, clearing out the build options, and finally settling on ONLY Build Options and leaving the Settings one empty.

Output from wx-config --cxxflags:

-I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread


Output from wx-config --libs:

-pthread -Wl,-Bsymbolic-functions  -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8




Ah-ha, found it.  Okay, so at some point last night, I put "/usr/include/wx-2.8/wx/" in the Settings -> Compiler & debugger settings -> Search Directories.

This was because I was having the orginal problem of "wx/app.h No such file or directory"   & and I never took that out againt.

Sweet - getting the errors I'm expecting to see!


-------------- Build: Debug in HelloWorld ---------------

g++ -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread       -c /home/jax/coding/tutorials/HelloWorld/HelloWorldApp.cpp -o obj/Debug/HelloWorldApp.o
g++ -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread       -c /home/jax/coding/tutorials/HelloWorld/HelloWorldMain.cpp -o obj/Debug/HelloWorldMain.o
/home/jax/coding/tutorials/HelloWorld/HelloWorldMain.cpp: In member function ‘void HelloWorldFrame::OnQuit(wxCommandEvent&)’:
/home/jax/coding/tutorials/HelloWorld/HelloWorldMain.cpp:115: error: no matching function for call to ‘HelloWorldFrame::Close()’
/home/jax/coding/tutorials/HelloWorld/HelloWorldMain.h:35: note: candidates are: void HelloWorldFrame::Close(wxCommandEvent&)
/home/jax/coding/tutorials/HelloWorld/HelloWorldMain.cpp: In member function ‘void HelloWorldFrame::Close(wxCommandEvent&)’:
/home/jax/coding/tutorials/HelloWorld/HelloWorldMain.cpp:126: error: no matching function for call to ‘HelloWorldFrame::Close()’
/home/jax/coding/tutorials/HelloWorld/HelloWorldMain.cpp:124: note: candidates are: void HelloWorldFrame::Close(wxCommandEvent&)
Process terminated with status 1 (0 minutes, 2 seconds)
2 errors, 0 warnings



thanks much Jens!
Jack

Offline jiapei100

  • Multiple posting newcomer
  • *
  • Posts: 20
    • Vision Open
Re: Repeat issue, but i cannot solve it...
« Reply #3 on: May 04, 2010, 09:03:32 pm »


Hi, laidback_01:

did you solve that problem?
If so, how?
I'm facing the same problem as you described here.

cheers
JIA
Welcome to Vision Open
http://www.visionopen.com