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

Errors C2589 and C2059 for illegal tokens #498

Open
MonicaLiu0311 opened this issue May 5, 2023 · 0 comments
Open

Errors C2589 and C2059 for illegal tokens #498

MonicaLiu0311 opened this issue May 5, 2023 · 0 comments

Comments

@MonicaLiu0311
Copy link

MonicaLiu0311 commented May 5, 2023

Describe the bug
The following error occurs when using amqpcpp:

E:\vcpkg01\installed\x64-windows\include\amqpcpp\message.h(85,42): error C2589: '(': illegal token on right side of '::' 
E:\vcpkg01\installed\x64-windows\include\amqpcpp\message.h(85,42): error C2059: syntax error: ')' 
E:\vcpkg01\installed\x64-windows\include\amqpcpp\message.h(85,1): error C2059: syntax error: ')' 
E:\vcpkg01\installed\x64-windows\include\amqpcpp\message.h(103,25): error C2589: '(': illegal token on right side of '::' 
E:\vcpkg01\installed\x64-windows\include\amqpcpp\message.h(103,1): error C2062: type 'unknown-type' unexpected 
E:\vcpkg01\installed\x64-windows\include\amqpcpp\message.h(103,1): error C2059: syntax error: ')' 
E:\vcpkg01\installed\x64-windows\include\amqpcpp\message.h(126,28): error C2589: '(': illegal token on right side of '::' 
E:\vcpkg01\installed\x64-windows\include\amqpcpp\message.h(126,1): error C2062: type 'unknown-type' unexpected 
E:\vcpkg01\installed\x64-windows\include\amqpcpp\message.h(126,1): error C2059: syntax error: ')'

Expected behavior and actual behavior
Can be linked normally and find the header file amqpcpp.h.

Sample code
usage:

amqpcpp provides CMake targets:

    # this is heuristically generated, and may not be correct
    find_package(amqpcpp CONFIG REQUIRED)
    target_link_libraries(main PRIVATE amqpcpp)
CMakeFindUsage.cpp
#include <iostream>
#include "amqpcpp.hpp"

using namespace std;

int main()
{
cout << "Hello CMake." << endl;
return 0;
}

CMakeLists.txt
cmake_minimum_required (VERSION 3.8)

set(CMAKE_TOOLCHAIN_FILE "E:/vcpkg01/scripts/buildsystems/vcpkg.cmake")

project ("CMakeFindUsage")

add_library(main "CMakeFindUsage.cpp")

find_package(amqpcpp CONFIG REQUIRED)

target_link_libraries(main PRIVATE amqpcpp)

Reproduce environment:

  • Win 10
  • VS 2022 (MSVC 14.35.32215)

Related PR: microsoft/vcpkg#31271

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

1 participant