Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error on scalar.h #1

Open
shmuelfomberg opened this issue Aug 19, 2010 · 9 comments
Open

Compilation error on scalar.h #1

shmuelfomberg opened this issue Aug 19, 2010 · 9 comments

Comments

@shmuelfomberg
Copy link

Hi.

I am trying to compile your project, and get an error:
blib\headers/perl++/scalar.h:185: error: expected identifier before 'void'
blib\headers/perl++/scalar.h:185: error: expected '}' before 'void'
blib\headers/perl++/scalar.h:185: error: expected unqualified-id before ',' token
blib\headers/perl++/scalar.h:185: error: two or more data types in declaration of 'SCALAR'
blib\headers/perl++/scalar.h:185: error: expected initializer before '}' token

line 185 is: enum context {VOID, SCALAR, LIST};

I am using Strewberry Perl 5.12 on Windows with MingW.
I tried, but could not spot the problem. maybe my C++ is out of shape...

Thanks,
Shmuel.

@shmuelfomberg
Copy link
Author

I tested a weird idea that the compiler identify VOID==void.
so I changed it to VXOID, and the error disappeared.
weird.

@shmuelfomberg
Copy link
Author

oh, and I'm using Boost 1.44.0

@Leont
Copy link
Owner

Leont commented Aug 27, 2010

Windows has a nasty habit of defining various types like these. VOID is one of them (for a more complete list, see http://msdn.microsoft.com/en-us/library/aa383751%28VS.85%29.aspx). Making it compile on windows requires some #undefing. I've been working on it, but the library isn't quite functional yet on Windows.

@shmuelfomberg
Copy link
Author

Hi Leont.

Thank for clearing it out.
I saw your presentation on YAPC::EU::2010, and want to give a presentation at work about it, so I'm willing to invest time in making it compile.

Here are a few notes that I collected so far:

The followinf statment is missing from
Evaluate.C (on the beginning of the file)
#include "internal.h"

In Glob.C, line 8 and 11:
remove the const from the reinterpret_cast

helpers.C, line 22 and 34:
we don't have to MIN the lenghts,
after we established that they are equal.
(and MIN is not declared anyway)

For some reason the build process creates
the 'o' (object) files in 'perl++\source'
and then search for them in '_build'.

tab++.C is missing (for the 'exit' call):
#include <cstdlib>

now I'm stuck on the dll-building stage, with
error msg:
undefined reference to `boot_libperl__'

That's it for now. what do you think?

btw, will you be on YAPC::Asia this year?

Shmuel.

@Leont
Copy link
Owner

Leont commented Aug 29, 2010

Hi Shmuel,

Thanks for all the feedback, it's really helpful.

  • evalutate.c: The include is missing deliberately. It doesn't need it and it would only slow down compilation.
  • glob.C: Will change
  • helpers.C: Doh!
  • Build problem: It's a known bug in ExtUtils::CBuilder on Windows. I sent dagolden a patch, but it hasn't hit the stable release of EU::CB yet.
  • tap++.C: Will fix.
  • Linking problem: I know about it, that's where I got stuck. I now understand what causes the problem, and what core module needs to be fixed (that did take some time), but that also means the linking needs a lot more love to work on Windows. It's one of my two focus points right now (the other being the documentation) but I'm not there yet.

No, I won't be at YAPC::Asia. Right now I have neither money nor time for such a trip.

Again, thanks your feedback. I hope I can fix the linking issue soon.

Leon

@shmuelfomberg
Copy link
Author

Hi Leon.

about evaluate.c: it does uses IV/NV types. so if you don't include internal.h, were are these types declared?

And about YAPC::Asia, I'm thinking about giving a talk about C-Perl binding, the include Libperl++ as 'future directions'. (also Ctypes and XSpp)
Is that OK with you?
If it is, can I send you the presentation (when it will be finished) to make sure I don't have major mistakes?

Thanks,
Shmuel.

@Leont
Copy link
Owner

Leont commented Sep 5, 2010

Erm, evaluate.C doesn't use IV/NV types, it just declares a string that will be evaluated by the interpreter.

Yes, by all means include libperl++ in your talk. I'd be happy to assist you with the slides for that part

@shmuelfomberg
Copy link
Author

true. however, it includes perl++.h, that includes scalar.h, that mentions IV/NV.
(in line 67)

Also, is there a place in this project where I can contribute?
some functions on your low priority list that need to be implemented?

@Leont
Copy link
Owner

Leont commented Sep 20, 2010

I now understand what you meant with the evaluate.C problem. IV/NV and friends should be defined in config.h, but that is empty on Windows for some reason. I'm going to look into it, but it sure is a strange regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants