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

error: missing binary operator before token "(" #132

Closed
dblanm opened this issue Jun 20, 2016 · 21 comments · Fixed by #142
Closed

error: missing binary operator before token "(" #132

dblanm opened this issue Jun 20, 2016 · 21 comments · Fixed by #142
Milestone

Comments

@dblanm
Copy link

dblanm commented Jun 20, 2016

When making make in the build directory, using sudo make, make or make -j4
It gives me the error
home.../fcl/octree.h error: missing binary operator before token "("
#if OCTOMAP_VERSION_AT_LEAST(1,8,0)
^

.... and it follows

I change it to #if OCTOMAP_VERSION_AT_LEAST(1.8.0)
but it didn't worked
Anyone with same problem that knows how to fix it?

Thanks in advance!

@dblanm
Copy link
Author

dblanm commented Jun 20, 2016

The code failing is this one:

/// @return ptr to child number childIdx of node
OcTreeNode* getNodeChild(OcTreeNode* node, unsigned int childIdx)
{
#if OCTOMAP_VERSION_AT_LEAST(1,8,0)
return tree->getNodeChild(node, childIdx);
#else
return node->getChild(childIdx);
#endif
}

I have to say that I have installed last version of octomap, and checked it in /usr/local/share/octomap/package.xml

@jslee02
Copy link
Member

jslee02 commented Jun 20, 2016

Could you try a clean build as we did?

@dblanm
Copy link
Author

dblanm commented Jun 20, 2016

I am sorry but I am a bit new modifying this.
I modified the fcl/config.h.in and added:
#if FCL_HAVE_OCTOMAP
#define OCTOMAP_MAJOR_VERSION @OCTOMAP_MAJOR_VERSION@
#define OCTOMAP_MINOR_VERSION @OCTOMAP_MINOR_VERSION@
#define OCTOMAP_PATCH_VERSION @OCTOMAP_PATCH_VERSION@

#define OCTOMAP_VERSION_AT_LEAST(x,y,z)
(OCTOMAP_MAJOR_VERSION > x || (OCTOMAP_MAJOR_VERSION >= x &&
(OCTOMAP_MINOR_VERSION > y || (OCTOMAP_MINOR_VERSION >= y &&
OCTOMAP_PATCH_VERSION >= z))))

#define OCTOMAP_VERSION_AT_MOST(x,y,z)
(OCTOMAP_MAJOR_VERSION < x || (OCTOMAP_MAJOR_VERSION <= x &&
(OCTOMAP_MINOR_VERSION < y || (OCTOMAP_MINOR_VERSION <= y &&
OCTOMAP_PATCH_VERSION <= z))))
#endif // FCL_HAVE_OCTOMAP

and also included <fcl/config.h> (tested also fcl/config.h.in) in octree.h, and still have the same error.
What am I missing?

@jslee02
Copy link
Member

jslee02 commented Jun 20, 2016

First, you wouldn't include config.h.in but config.h which is generated by CMake.

To clarify, do you mean the current master branch couldn't be built on your system? Did you rerun cmake as well?

Also, why are you modifying config.h.in? could you elaborate what you modified in config.h.in? Because I can't see any difference between what you posted and the original config.h.in.

@dblanm
Copy link
Author

dblanm commented Jun 20, 2016

As you said, I couldn't built the master branch. I downloaded it again and changed octree.h before making cmake and the error still occurs.

@jslee02
Copy link
Member

jslee02 commented Jun 20, 2016

Couldn't build it as you downloaded without any modification?

And, why are you changing octree.h again?

@dblanm
Copy link
Author

dblanm commented Jun 20, 2016

No, I couldn't because it gives me the error I first posted.

And I was changing octree.h to add the config.h to see it that corrected the error, but it didn't work. What I did was to add the config and to change OCTOMAP_VERSION_AT_LEAST(1,8,0) for OCTOMAP_VERSION_AT_LEAST(1.8.0). (, for .)

@jvgomez
Copy link
Contributor

jvgomez commented Jun 21, 2016

This is the same problem I was having when I updated the PR. However, in the CI and for @jslee02 it worked fine. Perhaps is something related to the compiler? I am using gcc version 4.8.5 (Ubuntu 4.8.5-2ubuntu1~14.04.1)

In any case, @dblanm changing , for . will not solve anything as the macro is prepared to receive 3 parameters (MAJOR, MINOR, PATCH).

@pbarragan
Copy link

Hi, I also ran into this problem after trying to make a clean clone of FCL. I eventually had to try to force compilation ignoring octomap to get it to work (by changing CMakeCache.txt because I didn't know how to do it the right way). FCL works now, but I'm not sure why I got this error or how I would get around it if I wanted to use octomap. Any ideas on the compiler issue? I am using gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4. Is this problem an error with just the files included in FCL or could it have to do with the octomap package or other dependencies?

@jvgomez
Copy link
Contributor

jvgomez commented Jun 29, 2016

@pbarragan I introduced recently this issue :( Since Octomap has changed the API, I wanted to make FCL able to work with both Octomap version >=1.8.0 and <1.8.0, that is why those compilation-time macros are introduced. It was not working on my computer (I tried many many different things), but for @jlsee02 it worked, and also in the CI. Surprisingly, I was even able to create a debian package out of it in my computer.

@jslee02 which compiler did you use? Because Iused GCC4.8.4 as well. What does the CI use? I guess that, in any case, we should modify this to a simple #define OCTOMAP_GREATER_THAN_1_8 for instance. If you agree I will carry out the changes asap.

@jslee02
Copy link
Member

jslee02 commented Jun 29, 2016

I'm using gcc (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5, and Travis uses gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4.

I couldn't reproduce the reported problem, and actually don't think it's a compiler problem. It would be nice if anyone can reproduce the problem by creating a test repo or any other way.

@pbarragan
Copy link

@jslee02 I'd be happy to help as the error happens on my system, but I'm not sure how to create a repo that would produce the problem on any system. I can provide any information that's helpful, but if someone could point me to what to provide or how to create said repo, I'd appreciate it as I'm a bit new to how to debug this.

@jslee02
Copy link
Member

jslee02 commented Jun 30, 2016

For a simple test, can you replace all the OCTOMAP_VERSION_AT_LEAST(1,8,0) with OCTOMAP_MAJOR_VERSION and let me know what you get?

@pbarragan
Copy link

I made the change, removed the previous build directory, cmake .. in a new build directory and make and it seemed to work just fine. I then ran ./tests/test_fcl_distance and that also worked with no errors. make install also worked fine. Seems like it fixed that part.

@jvgomez
Copy link
Contributor

jvgomez commented Jul 3, 2016

A quick note, I think at this point is much easier to follow something like Gazebo guys do:

#if GAZEBO_VERSION_MAJOR >=7
....

Maybe we should do

#if OCTOMAP_MAJOR_VERSION >= 1
# if OCTOMAP_MINOR_VERSION >= 8
...
# endif
#endif

Or just simple collapse all this into a macro #if OCTOMAP_VERSION_GREATER_1.8

@wjwwood
Copy link
Contributor

wjwwood commented Jul 21, 2016

I believe the pull request I just opened should fix this: #142

Basically, if you already have fcl installed, then in certain situations you can get the installed fcl/config.h rather than the one generated for the local build. That's why this never showed up in CI.

@jslee02
Copy link
Member

jslee02 commented Jul 22, 2016

(Reopening as closed automatically when #142 was merged)

@dblanm @pbarragan Could you confirm if #142 works for you?

@jslee02 jslee02 reopened this Jul 22, 2016
@dblanm
Copy link
Author

dblanm commented Jul 22, 2016

I completley removed fcl and octomap libraries,
I installed octomap by CI folder and then installed fcl, the problem no longer exits.
Thank you for the solution.

@dblanm
Copy link
Author

dblanm commented Jul 22, 2016

I am testing now fcl octree and octomap using ROS and it compiles, then i think the problem is well solved.

@jslee02 jslee02 added this to the FCL 0.6.0 milestone Jul 24, 2016
@jslee02
Copy link
Member

jslee02 commented Jul 24, 2016

Okay, it seems the issue is resolved! Closing.

@jslee02 jslee02 closed this as completed Jul 24, 2016
@k-maheshkumar
Copy link

Hey, I just checked out the branch fcl-0.5 and tried to build, but got the same error. Please help to build the package.
Thank you.

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

Successfully merging a pull request may close this issue.

6 participants