Code Monkey home page Code Monkey logo

Comments (11)

vortechs2000 avatar vortechs2000 commented on May 22, 2024

Need to double check this doesn't break compiles on older versions of MSVC...

from czmq.

mrdubya avatar mrdubya commented on May 22, 2024

It breaks MSVC builds when compiling as C, not C++.

error C2054: expected '(' to follow 'inline'

from czmq.

hintjens avatar hintjens commented on May 22, 2024

Can you build as C anyhow? I thought we needed C++ language features.
On Aug 2, 2013 12:28 PM, "Mike Williams" [email protected] wrote:

It breaks MSVC builds when compiling as C, not C++.

error C2054: expected '(' to follow 'inline'


Reply to this email directly or view it on GitHubhttps://github.com//issues/212#issuecomment-21997876
.

from czmq.

mrdubya avatar mrdubya commented on May 22, 2024

We build czmq as C++ but include and link into a C application.

from czmq.

hintjens avatar hintjens commented on May 22, 2024

@mrdubya where does the error occur? In your own code?

from czmq.

mrdubya avatar mrdubya commented on May 22, 2024

No, it fails in czmq_prelude.h. All I did was delete the definition of inline as per the commit above. This results in the following in our C code that includes czmq.h:

f:\zeromq\czmq\include\czmq_prelude.h(432) : error C2054: expected '(' to follow 'inline'
f:\zeromq\czmq\include\czmq_prelude.h(438) : error C2085: 'safe_malloc' : not in formal parameter list
f:\zeromq\czmq\include\czmq_prelude.h(438) : error C2143: syntax error : missing ';' before '{'
NMAKE : fatal error U1077: '"G:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

Not sure why we don't see a problem when building czmq as C++. It looks like xkeycheck.h is only included from standard C++ headers so wont be seen when compiling C++ code that does not include a C++ standard header. You may just need a #if !defined(__cplusplus) around the definition of inline.

from czmq.

hintjens avatar hintjens commented on May 22, 2024

OK, I've made a further pull request - if you remove the 'inline' in that
definition, it should all work.

On Fri, Aug 2, 2013 at 6:00 PM, Mike Williams [email protected]:

No, it fails in czmq_prelude.h. All I did was delete the definition of
inline as per the commit above. This results in the following in our C code
that includes czmq.h:

f:\zeromq\czmq\include\czmq_prelude.h(432) : error C2054: expected '(' to
follow 'inline'
f:\zeromq\czmq\include\czmq_prelude.h(438) : error C2085: 'safe_malloc' :
not in formal parameter list
f:\zeromq\czmq\include\czmq_prelude.h(438) : error C2143: syntax error :
missing ';' before '{'
NMAKE : fatal error U1077: '"G:\Program Files (x86)\Microsoft Visual
Studio 11.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

Not sure why we don't see a problem when building czmq as C++. It looks
like xkeycheck.h is only included from standard C++ headers so wont be seen
when compiling C++ code that does not include a C++ standard header. You
may just need a #if !defined(__cplusplus) around the definition of inline.


Reply to this email directly or view it on GitHubhttps://github.com//issues/212#issuecomment-22015377
.

from czmq.

hintjens avatar hintjens commented on May 22, 2024

Sorry, nope, that breaks the build for other reasons... :-/ Let me try
something else

On Fri, Aug 2, 2013 at 10:31 PM, Pieter Hintjens [email protected] wrote:

OK, I've made a further pull request - if you remove the 'inline' in that
definition, it should all work.

On Fri, Aug 2, 2013 at 6:00 PM, Mike Williams [email protected]:

No, it fails in czmq_prelude.h. All I did was delete the definition of
inline as per the commit above. This results in the following in our C code
that includes czmq.h:

f:\zeromq\czmq\include\czmq_prelude.h(432) : error C2054: expected '(' to
follow 'inline'
f:\zeromq\czmq\include\czmq_prelude.h(438) : error C2085: 'safe_malloc' :
not in formal parameter list
f:\zeromq\czmq\include\czmq_prelude.h(438) : error C2143: syntax error :
missing ';' before '{'
NMAKE : fatal error U1077: '"G:\Program Files (x86)\Microsoft Visual
Studio 11.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

Not sure why we don't see a problem when building czmq as C++. It looks
like xkeycheck.h is only included from standard C++ headers so wont be seen
when compiling C++ code that does not include a C++ standard header. You
may just need a #if !defined(__cplusplus) around the definition of inline.


Reply to this email directly or view it on GitHubhttps://github.com//issues/212#issuecomment-22015377
.

from czmq.

hintjens avatar hintjens commented on May 22, 2024

OK, tried something else. Since I don't have MSVC to test on, I can't be
100% this works.

On Fri, Aug 2, 2013 at 10:38 PM, Pieter Hintjens [email protected] wrote:

Sorry, nope, that breaks the build for other reasons... :-/ Let me try
something else

On Fri, Aug 2, 2013 at 10:31 PM, Pieter Hintjens [email protected] wrote:

OK, I've made a further pull request - if you remove the 'inline' in that
definition, it should all work.

On Fri, Aug 2, 2013 at 6:00 PM, Mike Williams [email protected]:

No, it fails in czmq_prelude.h. All I did was delete the definition of
inline as per the commit above. This results in the following in our C code
that includes czmq.h:

f:\zeromq\czmq\include\czmq_prelude.h(432) : error C2054: expected '('
to follow 'inline'
f:\zeromq\czmq\include\czmq_prelude.h(438) : error C2085: 'safe_malloc'
: not in formal parameter list
f:\zeromq\czmq\include\czmq_prelude.h(438) : error C2143: syntax error :
missing ';' before '{'
NMAKE : fatal error U1077: '"G:\Program Files (x86)\Microsoft Visual
Studio 11.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

Not sure why we don't see a problem when building czmq as C++. It looks
like xkeycheck.h is only included from standard C++ headers so wont be seen
when compiling C++ code that does not include a C++ standard header. You
may just need a #if !defined(__cplusplus) around the definition of inline.


Reply to this email directly or view it on GitHubhttps://github.com//issues/212#issuecomment-22015377
.

from czmq.

mrdubya avatar mrdubya commented on May 22, 2024

Works for me. czmq builds and my C builds are ok as well. And the check for inline already being defined is a nice touch for existing C apps that have done something similar for setting up a C99-alike environment.

from czmq.

hintjens avatar hintjens commented on May 22, 2024

Nice, thanks.

On Mon, Aug 5, 2013 at 11:26 AM, Mike Williams [email protected]:

Works for me. czmq builds and my C builds are ok as well. And the check
for inline already being defined is a nice touch for existing C apps that
have done something similar for setting up a C99-alike environment.


Reply to this email directly or view it on GitHubhttps://github.com//issues/212#issuecomment-22095348
.

from czmq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.