Comments (11)
Need to double check this doesn't break compiles on older versions of MSVC...
from czmq.
It breaks MSVC builds when compiling as C, not C++.
error C2054: expected '(' to follow 'inline'
from czmq.
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.
We build czmq as C++ but include and link into a C application.
from czmq.
@mrdubya where does the error occur? In your own code?
from czmq.
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.
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.
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.
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 elseOn 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.
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.
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)
- can use zsock_new_pub() api set ipv6 HOT 3
- Android / Java bindings/jni/ci_build.sh fails on Ubuntu 22.04 HOT 3
- zauth `zsock_bind()` fails when called for the second time from a different thread
- Lingering broken TCP connections when using zproxy
- czmq bindiing jni should be deployed to maven central jcenter is now read only. HOT 1
- Tests on OSX? HOT 1
- Ios Build Fails Please check the log on IOS sdk 16.2 HOT 2
- zsock_events() segfaults if called too often HOT 4
- How to get peer PID with czmq? HOT 1
- Saving certificate to memory?
- An error occurs when the zsock_set_tcp_keepalive function is executed
- ziflist crashes when there are 'alias' net devices HOT 1
- zpoller_wait() will fail if WiFi networks are switched or after Windows sleep and even rebuilding all sockets doesn't make it recover HOT 9
- No MSYS2 package HOT 2
- zloop allows calling start() again but timer removal fails then HOT 2
- Issue with libczmq-dev HOT 1
- Problem: czmq `make check` tests do not display properly in terminal HOT 1
- Problem: When zauth unable to load password file it uses zsys `info` instead of `warn`
- zloop: nonstop does not work as intended (EINTR breaks loop) HOT 2
- No QNX Compile Options for s_reload in ziflist.c
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from czmq.