'(': Illegal token on right side of '::' error - C++

1,651 views
Skip to first unread message

AM Dabbagh

unread,
Apr 21, 2019, 5:23:31 AM4/21/19
to or-tools-discuss
Hello,

I'm trying to solve a min cost flow problem as part of a project I'm working on.

I followed the given example and imported the required header files. However, I get the following error when I compile:

'(': Illegal token on right side of '::'

This error appears in lines 854, 894, 942, 947 in graph.h as well as line 1404 in ebert_graph.h

I'm new to c++ and have looked online for what might be the issue but couldn't find a proper answer.

Thank you.

Laurent Perron

unread,
Apr 21, 2019, 5:27:29 AM4/21/19
to or-tools-discuss
Which platform, which compiler ?

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/8890e430-9688-4b57-803b-3a940d5706b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

AM Dabbagh

unread,
Apr 21, 2019, 5:30:43 AM4/21/19
to or-tools-discuss
This error was encountered in visual studio 2017 (x64) on windows 10

Laurent Perron

unread,
Apr 21, 2019, 5:55:03 AM4/21/19
to or-tools-discuss
This are proper std:: C++ APIs.

There is something really wrong with your version of the compiler. Check that you are actually calling vs 2017.
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.

AM Dabbagh

unread,
Apr 21, 2019, 11:06:36 AM4/21/19
to or-tools-discuss
The Microsoft C/C++ compiler version I'm running is 19.00.24225.1 

I have looked online and found some posts that might be leading to the issue but not so sure:


Please note that I was able to run the min cost flow  example in a new project with no issues.

I think the issue might have to do with including other header files in my project (e.g. windows.h, etc)

On Sunday, April 21, 2019 at 12:55:03 PM UTC+3, Laurent Perron wrote:
This are proper std:: C++ APIs.

There is something really wrong with your version of the compiler. Check that you are actually calling vs 2017.
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



Le dim. 21 avr. 2019 à 11:30, AM Dabbagh <ahmad.a...@gmail.com> a écrit :
This error was encountered in visual studio 2017 (x64) on windows 10

On Sunday, April 21, 2019 at 12:23:31 PM UTC+3, AM Dabbagh wrote:
Hello,

I'm trying to solve a min cost flow problem as part of a project I'm working on.

I followed the given example and imported the required header files. However, I get the following error when I compile:

'(': Illegal token on right side of '::'

This error appears in lines 854, 894, 942, 947 in graph.h as well as line 1404 in ebert_graph.h

I'm new to c++ and have looked online for what might be the issue but couldn't find a proper answer.

Thank you.

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools...@googlegroups.com.

Laurent Perron

unread,
Apr 21, 2019, 11:14:05 AM4/21/19
to or-tools-discuss
Try do define WINDOWS_LEAN_AND_MEAN before the include.
windows.h is a nightmare, it redefines so many symbols.

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/62c7ad9e-b6cd-4ea5-97ab-a785fe30e890%40googlegroups.com.

AM Dabbagh

unread,
Apr 23, 2019, 5:32:49 AM4/23/19
to or-tools-discuss
Thanks.
Reply all
Reply to author
Forward
0 new messages