News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Plugin compilation issue Ubuntu 13.04

Started by dmoore, October 20, 2013, 05:56:47 AM

Previous topic - Next topic

dmoore

I don't know if this is just a problem with my launchpad recipe (see https://code.launchpad.net/~damien-moore/+recipe/codeblocks-daily) but I suspect not.

System is Ubuntu 13.10, i386, wx-2.8.12, gcc4.6.3

With trunk installed (rev 9404), create a CB plugin using the wizard, then build I get



-------------- Build: default in test (compiler: GNU GCC Compiler)---------------

g++ -I/usr/include/codeblocks -I/usr/include/codeblocks/tinyxml -I/usr/include/codeblocks/scripting/include -I/usr/include/codeblocks/scripting/bindings -I/usr/include/codeblocks/scripting/sqplus -I/usr/include/codeblocks/wxscintilla/include -I/usr/lib/i386-linux-gnu/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g  -c src/cbplugin/test/test.cpp -o .objs/test.o
In file included from /usr/include/codeblocks/sdk_common.h:43:0,
                 from /usr/include/codeblocks/sdk_precomp.h:13,
                 from /usr/include/codeblocks/sdk.h:17,
                 from src/cbplugin/test/test.cpp:1:
/usr/include/codeblocks/prep.h:221:16: error: expected unqualified-id before numeric constant
/usr/include/codeblocks/prep.h:227:16: error: expected unqualified-id before numeric constant
Process terminated with status 1 (0 minute(s), 5 second(s))
2 error(s), 0 warning(s) (0 minute(s), 5 second(s))


To get it to build, I have to #undef linux and #undef unix at the top of test.cpp (the plugin implementation)

Searching I saw this issue came up a year or two back and was blamed on something screwy with system headers. Is that right?
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

Alpha

Quote from: dmoore on October 20, 2013, 05:56:47 AM
Searching I saw this issue came up a year or two back and was blamed on something screwy with system headers. Is that right?
Yes, that was it.  I think the solution was to add the -ansi build flag.

stahta01

#2
Quote from: Alpha on October 20, 2013, 06:23:52 AM
Quote from: dmoore on October 20, 2013, 05:56:47 AM
Searching I saw this issue came up a year or two back and was blamed on something screwy with system headers. Is that right?
Yes, that was it.  I think the solution was to add the -ansi build flag.

Or maybe this "Well it turned out to be presence of C++ comments in C file which caused that build failure."

http://forums.next.codeblocks.org/index.php/topic,17986.msg123202.html#msg123202

Edit: After re-reading they added the "ansi" option and had to fix C++ comments in a C file to get the code to compile.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

dmoore

-ansi did the trick. Does that mean that we should be including -ansi in our plugin project template build options?
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

Alpha

Quote from: dmoore on October 20, 2013, 07:11:45 AM
Does that mean that we should be including -ansi in our plugin project template build options?
Probably.

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

stahta01

Quote from: dmoore on October 20, 2013, 07:11:45 AM
-ansi did the trick. Does that mean that we should be including -ansi in our plugin project template build options?

Might wish to verify that -std is NOT better (this assumes it works as well) before adding to project template.

From http://gcc.gnu.org/onlinedocs/cpp/System_002dspecific-Predefined-Macros.html#System_002dspecific-Predefined-Macros
QuoteWhen the -ansi option, or any -std option that requests strict conformance, is given to the compiler, all the system-specific predefined macros outside the reserved namespace are suppressed. The parallel macros, inside the reserved namespace, remain defined.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]