私はCMakeのにユニバーサルWindowsプラットフォームでアプリケーションを移行しようとしていると構築するとき、私は次のエラーを受信しています:UWP cmakeのプロジェクトXamlCompilerエラーWMC1002
\src\windows-uwp\App.xaml : XamlCompiler error WMC1002: x:Class type 'langdetect.App' is not found in 'langdetect'
私は、名前空間の名前を変更してしまうんでした移行中にCMakeのプロジェクト名と一致するようにしましたが、私はすべての参照を更新していると思います。すべてのC/C++コードがうまくコンパイルされます。
<Application
x:Class="langdetect.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:langdetect"
RequestedTheme="Light">
</Application>
App.xaml.h:私はこれがApp.xamlでCMakeの3.5.2およびVisual Studioコミュニティ2015
を使用してい
#pragma once
#include "App.g.h"
namespace langdetect
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
ref class App sealed
{
protected:
virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
internal:
App();
private:
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
};
}
これはUWP特定のコードであります私のCMakeLists.txtファイルで:
include_directories(./include/windows-uwp)
ADD_MSVC_PRECOMPILED_HEADER("${CMAKE_CURRENT_SOURCE_DIR}/include/windows-uwp/pch.h" "${CMAKE_CURRENT_SOURCE_DIR}/src/windows-uwp/pch.cpp" SRC_FILES)
set (HEADER_FILES include/gui.h include/langdetect.h include/windows-uwp/App.xaml.h
include/windows-uwp/MainPage.xaml.h include/windows-uwp/langdetect-uap.h
include/windows-uwp/str-utils.h)
set (SRC_FILES src/windows-uwp/App.xaml.cpp src/langdetect.c src/gui.c src/windows-uwp/MainPage.xaml.cpp
src/windows-uwp/langdetect-uap.cpp src/windows-uwp/str-utils.cpp
src/windows-uwp/App.xaml
src/windows-uwp/MainPage.xaml)
set (CMAKE_CXX_FLAGS "/ZW /EHsc")
私はもっと冗長なログを見て、app.xaml.camp/hがXAMLコンパイラがapp.xamlに到達する前にコンパイルされていることを確認します。 –