how to use clr winform in cmake

yongting liang 1 Reputation point
2022-09-28T03:41:09.24+00:00

how to use clr winform in cmake
Now I have success on cmake with CLR, I can use Console::WriteLine

using <mscorlib.dll>

using namespace System;
int main()
{
Console::WriteLine("Test");
}

cmakelist is

SET_TARGET_PROPERTIES(ClrApp PROPERTIES COMPILE_FLAGS "/clr")
STRING(REPLACE "/EHsc" "/EHa" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
STRING(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /clr")
set_target_properties(ClrApp PROPERTIES COMMON_LANGUAGE_RUNTIME "")

how can I use winform like in vs to add ui winform

when I use

using namespace System::Windows::Forms;

It tells me no this namespase

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,185 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.