468,766 Members | 1,303 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,766 developers. It's quick & easy.

Problem with compiling managed c++ code with added c - library with variable named generic

I have project that uses managed c++ where I use c - library, this library
contains some variables named generic, during compilation I get error: Error
1 error C2146: syntax error : missing ';' before identifier 'generic',
Problem is with name generic, unfortunately I cannot change this
name .How to solve this problem?
What to do to make it work?

--
Thanks,
Łukasz

--
pozdrawiam Łukasz

Jan 21 '08 #1
3 1462
>I have project that uses managed c++ where I use c - library, this library
>contains some variables named generic, during compilation I get error: Error
1 error C2146: syntax error : missing ';' before identifier 'generic',
Problem is with name generic, unfortunately I cannot change this
name .
Do you have a minimal code example that illustrates this problem?

Dave
Jan 21 '08 #2
Łukasz wrote:
I have project that uses managed c++ where I use c - library, this
library contains some variables named generic, during compilation I
get error: Error 1 error C2146: syntax error : missing ';' before
identifier 'generic', Problem is with name generic, unfortunately I
cannot change this
name .How to solve this problem?
What to do to make it work?
Well, generic is a C++ CLI keyword and isn't context sensitive so I supose the
only way to solve the problem is renaming the variable(s) or use some pattern to
hide the offending names into a native code. Like David asked you, we need some
code to try a solution.

Regards
--
Cholo Lennon
Bs.As.
ARG
Jan 21 '08 #3
On 21 $B'q'_'S(B, 16:35, "$B!r(Bukasz" <lza...@omnis.plwrote:
I have project that uses managed c++ where I use c - library, this library
contains some variables named generic, during compilation I get error: Error
1 error C2146: syntax error : missing ';' before identifier 'generic',
Problem is with name generic, unfortunately I cannot change this
name .How to solve this problem?
What to do to make it work?

--
Thanks,
$B!r(Bukasz

--
pozdrawiam $B!r(Bukasz
There is keyword "__identifier", which enables you to use keywords as
identifiers.
So if you were able to replace all references to "generic" name with
"__identifier(generic)"
that could probably solve your problem.

Thanks,
Sergey Zyuzin
Jan 21 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Lee Franke | last post: by
13 posts views Thread by Lee Newson | last post: by
2 posts views Thread by ajikoe | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.