Author Topic: Problem compiling sqlite3.c in wxSmith (C++) project  (Read 6476 times)

Offline kathbeau

  • Multiple posting newcomer
  • *
  • Posts: 17
Problem compiling sqlite3.c in wxSmith (C++) project
« on: March 10, 2015, 09:14:39 pm »
I want to statically link the amalgamated sqlite3.c/.h units in my GUI app. However, when I add them to my project and try to compile, I get this flood of errors:

Code
||warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: not for GNU C [enabled by default]|
/usr/include/wx-3.0/wx/buffer.h|19|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/buffer.h|27|error: unknown type name ‘namespace’|
/usr/include/wx-3.0/wx/buffer.h|28|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token|
/usr/include/wx-3.0/wx/buffer.h|65|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|241|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|242|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|246|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|360|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/buffer.h|360|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token|
/usr/include/wx-3.0/wx/buffer.h|380|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/buffer.h|380|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token|
/usr/include/wx-3.0/wx/buffer.h|398|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|416|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|417|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|446|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/buffer.h|447|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token|
/usr/include/wx-3.0/wx/buffer.h|518|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/buffer.h|519|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token|
/usr/include/wx-3.0/wx/strconv.h|29|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/strconv.h|47|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|47|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|47|error: expected ‘,’ or ‘;’ before ‘wxMBConv’|
/usr/include/wx-3.0/wx/strconv.h|183|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|183|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|183|error: expected ‘,’ or ‘;’ before ‘wxMBConvLibc’|
/usr/include/wx-3.0/wx/strconv.h|205|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|205|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|205|error: expected ‘,’ or ‘;’ before ‘wxConvBrokenFileNames’|
/usr/include/wx-3.0/wx/strconv.h|251|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|251|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|251|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF7’|
/usr/include/wx-3.0/wx/strconv.h|341|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|341|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|341|error: expected ‘,’ or ‘;’ before ‘wxMBConvStrictUTF8’|
/usr/include/wx-3.0/wx/strconv.h|360|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|360|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|360|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF8’|
/usr/include/wx-3.0/wx/strconv.h|393|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|393|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|393|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF16Base’|
/usr/include/wx-3.0/wx/strconv.h|412|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|412|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|412|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF16LE’|
/usr/include/wx-3.0/wx/strconv.h|426|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|426|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|426|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF16BE’|
/usr/include/wx-3.0/wx/strconv.h|440|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|440|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|440|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF32Base’|
/usr/include/wx-3.0/wx/strconv.h|458|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|458|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|458|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF32LE’|
/usr/include/wx-3.0/wx/strconv.h|472|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|472|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|472|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF32BE’|
/usr/include/wx-3.0/wx/strconv.h|488|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|488|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|488|error: expected ‘,’ or ‘;’ before ‘wxCSConv’|
/usr/include/wx-3.0/wx/strconv.h|576|error: unknown type name ‘wxMBConv’|
/usr/include/wx-3.0/wx/strconv.h|576|error: unknown type name ‘wxMBConv’|
/usr/include/wx-3.0/wx/strconv.h|576|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token|
/usr/include/wx-3.0/wx/strconv.h|580|error: unknown type name ‘wxCSConv’|
/usr/include/wx-3.0/wx/strconv.h|580|error: unknown type name ‘wxCSConv’|
/usr/include/wx-3.0/wx/strconv.h|580|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token|
/usr/include/wx-3.0/wx/strconv.h|583|error: unknown type name ‘wxMBConvStrictUTF8’|
/usr/include/wx-3.0/wx/strconv.h|583|error: unknown type name ‘wxMBConvStrictUTF8’|
/usr/include/wx-3.0/wx/strconv.h|583|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token|
/usr/include/wx-3.0/wx/strconv.h|586|error: unknown type name ‘wxMBConvUTF7’|
/usr/include/wx-3.0/wx/strconv.h|586|error: unknown type name ‘wxMBConvUTF7’|
/usr/include/wx-3.0/wx/strconv.h|586|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token|
/usr/include/wx-3.0/wx/strconv.h|596|error: unknown type name ‘wxMBConv’|
/usr/include/wx-3.0/wx/strconv.h|603|error: unknown type name ‘wxMBConv’|
/usr/include/wx-3.0/wx/strconv.h|606|error: unknown type name ‘wxCSConv’|
/usr/include/wx-3.0/wx/strconv.h|606|error: unknown type name ‘wxCSConv’|
/usr/include/wx-3.0/wx/strconv.h|606|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token|
/usr/include/wx-3.0/wx/strconv.h|613|error: unknown type name ‘wxMBConv’|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 27 warning(s) (0 minute(s), 0 second(s)) ===|
||warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: not for GNU C [enabled by default]|
/usr/include/wx-3.0/wx/buffer.h|19|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/buffer.h|27|error: unknown type name ‘namespace’|
/usr/include/wx-3.0/wx/buffer.h|28|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token|
/usr/include/wx-3.0/wx/buffer.h|65|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|241|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|242|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|246|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|360|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/buffer.h|360|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token|
/usr/include/wx-3.0/wx/buffer.h|380|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/buffer.h|380|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token|
/usr/include/wx-3.0/wx/buffer.h|398|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|416|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|417|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token|
/usr/include/wx-3.0/wx/buffer.h|446|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/buffer.h|447|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token|
/usr/include/wx-3.0/wx/buffer.h|518|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/buffer.h|519|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token|
/usr/include/wx-3.0/wx/strconv.h|29|error: unknown type name ‘class’|
/usr/include/wx-3.0/wx/strconv.h|47|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|47|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|47|error: expected ‘,’ or ‘;’ before ‘wxMBConv’|
/usr/include/wx-3.0/wx/strconv.h|183|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|183|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|183|error: expected ‘,’ or ‘;’ before ‘wxMBConvLibc’|
/usr/include/wx-3.0/wx/strconv.h|205|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|205|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|205|error: expected ‘,’ or ‘;’ before ‘wxConvBrokenFileNames’|
/usr/include/wx-3.0/wx/strconv.h|251|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|251|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|251|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF7’|
/usr/include/wx-3.0/wx/strconv.h|341|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|341|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|341|error: expected ‘,’ or ‘;’ before ‘wxMBConvStrictUTF8’|
/usr/include/wx-3.0/wx/strconv.h|360|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|360|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|360|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF8’|
/usr/include/wx-3.0/wx/strconv.h|393|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|393|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|393|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF16Base’|
/usr/include/wx-3.0/wx/strconv.h|412|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|412|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|412|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF16LE’|
/usr/include/wx-3.0/wx/strconv.h|426|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|426|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|426|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF16BE’|
/usr/include/wx-3.0/wx/strconv.h|440|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|440|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|440|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF32Base’|
/usr/include/wx-3.0/wx/strconv.h|458|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|458|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|458|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF32LE’|
/usr/include/wx-3.0/wx/strconv.h|472|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|472|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|472|error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF32BE’|
/usr/include/wx-3.0/wx/strconv.h|488|warning: data definition has no type or storage class [enabled by default]|
/usr/include/wx-3.0/wx/strconv.h|488|warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]|
/usr/include/wx-3.0/wx/strconv.h|488|error: expected ‘,’ or ‘;’ before ‘wxCSConv’|
/usr/include/wx-3.0/wx/strconv.h|576|error: unknown type name ‘wxMBConv’|
/usr/include/wx-3.0/wx/strconv.h|576|error: unknown type name ‘wxMBConv’|
/usr/include/wx-3.0/wx/strconv.h|576|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token|
/usr/include/wx-3.0/wx/strconv.h|580|error: unknown type name ‘wxCSConv’|
/usr/include/wx-3.0/wx/strconv.h|580|error: unknown type name ‘wxCSConv’|
/usr/include/wx-3.0/wx/strconv.h|580|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token|
/usr/include/wx-3.0/wx/strconv.h|583|error: unknown type name ‘wxMBConvStrictUTF8’|
/usr/include/wx-3.0/wx/strconv.h|583|error: unknown type name ‘wxMBConvStrictUTF8’|
/usr/include/wx-3.0/wx/strconv.h|583|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token|
/usr/include/wx-3.0/wx/strconv.h|586|error: unknown type name ‘wxMBConvUTF7’|
/usr/include/wx-3.0/wx/strconv.h|586|error: unknown type name ‘wxMBConvUTF7’|
/usr/include/wx-3.0/wx/strconv.h|586|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token|
/usr/include/wx-3.0/wx/strconv.h|596|error: unknown type name ‘wxMBConv’|
/usr/include/wx-3.0/wx/strconv.h|603|error: unknown type name ‘wxMBConv’|
/usr/include/wx-3.0/wx/strconv.h|606|error: unknown type name ‘wxCSConv’|
/usr/include/wx-3.0/wx/strconv.h|606|error: unknown type name ‘wxCSConv’|
/usr/include/wx-3.0/wx/strconv.h|606|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token|
/usr/include/wx-3.0/wx/strconv.h|613|error: unknown type name ‘wxMBConv’|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 27 warning(s) (0 minute(s), 0 second(s)) ===|

These errors occur when I select Build | Compile current file.

This also happens if I start a fresh wxSmith project, and do nothing except add the sqlite3 files.

However, if I open the wx/samples/mdi project in Code::Blocks, I can add sqlite3 and it compiles without complaint.

I have therefore concluded that there is something going on with wxSmith that is getting in the way. The trouble is, what is the problem and is there something I can do to alleviate it?

I posted this question in the wxWidgets Programming Forums, Compiler/Linking/IDE Related, but my issue appears to be pretty specific to Code::Blocks and wxSmith.

Thanks for any help you can give me.

Kathleen


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Problem compiling sqlite3.c in wxSmith (C++) project
« Reply #1 on: March 10, 2015, 09:59:45 pm »
please post the FULL build log.
thx freetings

Offline kathbeau

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: Problem compiling sqlite3.c in wxSmith (C++) project
« Reply #2 on: March 10, 2015, 10:28:49 pm »
please post the FULL build log.
thx freetings

Here it is. I ran this from the test project, where I created a brand new wxSmith project, changed nothing about the generated code, and added sqlite3.c and sqlite3.h to the project. Thank you so much for helping!

Code
-------------- Build: Debug in Test (compiler: GNU GCC Compiler)---------------

g++ -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -g -DSQLITE_THREADSAFE=0 -std=c++11 -Wall -I/usr/include/wx-3.0 -c /work/DeleteMe/Test/wx_pch.h -o wx_pch.h.gch/Debug_wx_pch_h_gch
gcc -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -g -DSQLITE_THREADSAFE=0 -Wall -I/usr/include/wx-3.0 -c /work/DeleteMe/Test/sqlite3.c -o obj/Debug/sqlite3.o
cc1: warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: not for GNU C [enabled by default]
In file included from /usr/include/wx-3.0/wx/strconv.h:17:0,
                 from /usr/include/wx-3.0/wx/strvararg.h:20,
                 from /usr/include/wx-3.0/wx/string.h:46,
                 from /usr/include/wx-3.0/wx/memory.h:15,
                 from /usr/include/wx-3.0/wx/object.h:19,
                 from /usr/include/wx-3.0/wx/wx.h:15,
                 from /usr/include/wx-3.0/wx/wxprec.h:58,
                 from ./wx_pch.h:14,
                 from <command-line>:0:
/usr/include/wx-3.0/wx/buffer.h:19:1: error: unknown type name ‘class’
/usr/include/wx-3.0/wx/buffer.h:27:1: error: unknown type name ‘namespace’
/usr/include/wx-3.0/wx/buffer.h:28:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/wx-3.0/wx/buffer.h:65:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
/usr/include/wx-3.0/wx/buffer.h:241:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
/usr/include/wx-3.0/wx/buffer.h:242:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
/usr/include/wx-3.0/wx/buffer.h:246:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
/usr/include/wx-3.0/wx/buffer.h:360:1: error: unknown type name ‘class’
/usr/include/wx-3.0/wx/buffer.h:360:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
/usr/include/wx-3.0/wx/buffer.h:380:1: error: unknown type name ‘class’
/usr/include/wx-3.0/wx/buffer.h:380:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
/usr/include/wx-3.0/wx/buffer.h:398:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
/usr/include/wx-3.0/wx/buffer.h:416:33: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
/usr/include/wx-3.0/wx/buffer.h:417:33: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
/usr/include/wx-3.0/wx/buffer.h:446:1: error: unknown type name ‘class’
/usr/include/wx-3.0/wx/buffer.h:447:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/wx-3.0/wx/buffer.h:518:1: error: unknown type name ‘class’
/usr/include/wx-3.0/wx/buffer.h:519:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
In file included from /usr/include/wx-3.0/wx/strvararg.h:20:0,
                 from /usr/include/wx-3.0/wx/string.h:46,
                 from /usr/include/wx-3.0/wx/memory.h:15,
                 from /usr/include/wx-3.0/wx/object.h:19,
                 from /usr/include/wx-3.0/wx/wx.h:15,
                 from /usr/include/wx-3.0/wx/wxprec.h:58,
                 from ./wx_pch.h:14,
                 from <command-line>:0:
/usr/include/wx-3.0/wx/strconv.h:29:1: error: unknown type name ‘class’
/usr/include/wx-3.0/wx/strconv.h:47:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:47:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:47:24: error: expected ‘,’ or ‘;’ before ‘wxMBConv’
/usr/include/wx-3.0/wx/strconv.h:183:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:183:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:183:24: error: expected ‘,’ or ‘;’ before ‘wxMBConvLibc’
/usr/include/wx-3.0/wx/strconv.h:205:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:205:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:205:24: error: expected ‘,’ or ‘;’ before ‘wxConvBrokenFileNames’
/usr/include/wx-3.0/wx/strconv.h:251:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:251:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:251:24: error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF7’
/usr/include/wx-3.0/wx/strconv.h:341:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:341:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:341:24: error: expected ‘,’ or ‘;’ before ‘wxMBConvStrictUTF8’
/usr/include/wx-3.0/wx/strconv.h:360:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:360:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:360:24: error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF8’
/usr/include/wx-3.0/wx/strconv.h:393:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:393:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:393:24: error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF16Base’
/usr/include/wx-3.0/wx/strconv.h:412:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:412:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:412:24: error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF16LE’
/usr/include/wx-3.0/wx/strconv.h:426:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:426:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:426:24: error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF16BE’
/usr/include/wx-3.0/wx/strconv.h:440:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:440:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:440:24: error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF32Base’
/usr/include/wx-3.0/wx/strconv.h:458:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:458:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:458:24: error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF32LE’
/usr/include/wx-3.0/wx/strconv.h:472:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:472:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:472:24: error: expected ‘,’ or ‘;’ before ‘wxMBConvUTF32BE’
In file included from /usr/include/wx-3.0/wx/strvararg.h:20:0,
                 from /usr/include/wx-3.0/wx/string.h:46,
                 from /usr/include/wx-3.0/wx/memory.h:15,
                 from /usr/include/wx-3.0/wx/object.h:19,
                 from /usr/include/wx-3.0/wx/wx.h:15,
                 from /usr/include/wx-3.0/wx/wxprec.h:58,
                 from ./wx_pch.h:14,
                 from <command-line>:0:
/usr/include/wx-3.0/wx/strconv.h:488:1: warning: data definition has no type or storage class [enabled by default]
/usr/include/wx-3.0/wx/strconv.h:488:1: warning: type defaults to ‘int’ in declaration of ‘class’ [-Wimplicit-int]
/usr/include/wx-3.0/wx/strconv.h:488:24: error: expected ‘,’ or ‘;’ before ‘wxCSConv’
/usr/include/wx-3.0/wx/strconv.h:576:1: error: unknown type name ‘wxMBConv’
/usr/include/wx-3.0/wx/strconv.h:576:1: error: unknown type name ‘wxMBConv’
/usr/include/wx-3.0/wx/strconv.h:576:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
/usr/include/wx-3.0/wx/strconv.h:580:1: error: unknown type name ‘wxCSConv’
/usr/include/wx-3.0/wx/strconv.h:580:1: error: unknown type name ‘wxCSConv’
/usr/include/wx-3.0/wx/strconv.h:580:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
/usr/include/wx-3.0/wx/strconv.h:583:1: error: unknown type name ‘wxMBConvStrictUTF8’
/usr/include/wx-3.0/wx/strconv.h:583:1: error: unknown type name ‘wxMBConvStrictUTF8’
/usr/include/wx-3.0/wx/strconv.h:583:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
/usr/include/wx-3.0/wx/strconv.h:586:1: error: unknown type name ‘wxMBConvUTF7’
/usr/include/wx-3.0/wx/strconv.h:586:1: error: unknown type name ‘wxMBConvUTF7’
/usr/include/wx-3.0/wx/strconv.h:586:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
/usr/include/wx-3.0/wx/strconv.h:596:1: error: unknown type name ‘wxMBConv’
/usr/include/wx-3.0/wx/strconv.h:603:1: error: unknown type name ‘wxMBConv’
/usr/include/wx-3.0/wx/strconv.h:606:1: error: unknown type name ‘wxCSConv’
/usr/include/wx-3.0/wx/strconv.h:606:1: error: unknown type name ‘wxCSConv’
/usr/include/wx-3.0/wx/strconv.h:606:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
/usr/include/wx-3.0/wx/strconv.h:613:1: error: unknown type name ‘wxMBConv’
Process terminated with status 1 (0 minute(s), 3 second(s))
50 error(s), 27 warning(s) (0 minute(s), 3 second(s))

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Problem compiling sqlite3.c in wxSmith (C++) project
« Reply #3 on: March 10, 2015, 10:31:36 pm »
you try to compile a c++ source file with the c compiler:
Code
 unknown type name ‘class’

is the sqlite3.c a c++ file or a c file?
if it is a c++ file rename it to sqlite2.cpp because c::b distinguishes the compiler according the file ending

greetings

Offline kathbeau

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: Problem compiling sqlite3.c in wxSmith (C++) project
« Reply #4 on: March 10, 2015, 10:54:16 pm »
you try to compile a c++ source file with the c compiler:
Code
 unknown type name ‘class’

is the sqlite3.c a c++ file or a c file?
if it is a c++ file rename it to sqlite2.cpp because c::b distinguishes the compiler according the file ending

greetings

It's a .c file; does not reference classes. But the Build Log page confirms that the compiler is using g++ for the .cpp file, and gcc for the .c file. So C::B appears to be identifying the correct extension.

Here's an interesting comparison: I opened wx/samples/mdi as a Code::Blocks project, where it builds just great. Then I added the sqlite3.c and sqlite3.h files to the project, ran Build | Clean then Build | Build... and it still builds without a hitch. And the compile line on the Build Log tab for the sqlite3.o is exactly the same as what is shown above.

Thanks for responding on this thread.

Kathleen

 

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Problem compiling sqlite3.c in wxSmith (C++) project
« Reply #5 on: March 10, 2015, 11:06:40 pm »
i still would rename it.... wxWidgets is cpp and so it makes no (big) sense to use two different compilers...

Offline osdt

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Problem compiling sqlite3.c in wxSmith (C++) project
« Reply #6 on: March 10, 2015, 11:37:03 pm »
Code
gcc -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -g -DSQLITE_THREADSAFE=0 -Wall -I/usr/include/wx-3.0 -c /work/DeleteMe/Test/sqlite3.c -o obj/Debug/sqlite3.o
...
                 from ./wx_pch.h:14,
                 from <command-line>:0:

The option '-include wx_pch.h' forces the C-compiler to include C++ headers. Remove it from project/target compiler options.

Offline kathbeau

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: Problem compiling sqlite3.c in wxSmith (C++) project
« Reply #7 on: March 10, 2015, 11:52:40 pm »
The option '-include wx_pch.h' forces the C-compiler to include C++ headers. Remove it from project/target compiler options.

THAT'S IT!! Thank you SO MUCH!!

Kathleen