gammasoft71 / xtd

Free open-source modern C++17 / C++20 framework to create console, GUI (forms like WinForms) and unit test applications and libraries on Microsoft Windows, Apple macOS and Linux.
https://gammasoft71.github.io/xtd
MIT License
735 stars 57 forks source link

[QUESTION] Code autosuggestion (IntelliSense) in VS2022 #246

Closed Dawid-Witkowski closed 5 months ago

Dawid-Witkowski commented 5 months ago

Your question

Hello, me again, I'm having trouble implementing code autosuggestion in VS2022, the problem seems to be related to this picture: image

Is there any docs page that covers how to add that? is that an existing feature?

(Cmake rookie, so forgive me :D) cheers!

gammasoft71 commented 5 months ago

Hi again,

Before trying your first application, have you tried building an xtd example. You can open it from xtdc-gui. If the example builds and runs. Check your CMakeList.txt file. You can send it to me and I can help if I see something wrong.

Dawid-Witkowski commented 5 months ago

CMakeList.txt:

cmake_minimum_required(VERSION 3.3)
Project(form1)
find_package(xtd REQUIRED)
add_sources(form1.cpp)
target_type(GUI_APPLICATION)
gammasoft71 commented 5 months ago

Your cmake file looks correct. Have you tried an xtd example from xtdc-gui?

Dawid-Witkowski commented 5 months ago

Yes, didn't help

gammasoft71 commented 5 months ago

If the example builds and runs, that means the xtd build chain is correct 😉.

Are you correctly generating your solution with the xtdc or cmake tools?

With xtdccommand

To build this project, open "Terminal" and type following lines:

cd your_project
xtdc open

Select your_project project and type Ctrl+F5 to build and run it.

With cmake command

To build this project, open "Terminal" and type following lines:

cd your_project
mkdir build && cd build
cmake ..
start your_project.sln

Select your_project project and type Ctrl+F5 to build and run it.

With xtdc-guiapplicarion

Launch xtdc-gui Click "Open a project or solution" button Select your_projectdirectory When Visual Studio is started, select your_project project and type Ctrl+F5 to build and run it.

With CMakegui applicarion

Launch CMake Click "Browse Sources..." button Select your_projectdirectory Click "Browse Build..." button Select your_project\builddirectory Click "Configure" button Click "Generate" button Click "Open Project" button When Visual Studio is started, select your_project project and type Ctrl+F5 to build and run it.

gammasoft71 commented 5 months ago

Sorry for the previous answer, I didn't factor in the fact that you were using VS Code.

Make sure you have installed the CMake plugin and that it is properly configured.

gammasoft71 commented 5 months ago

Hi again,

I'm installing Visual Studio Code on my Windows 11 and I can run an example from it.

Workflow

For more information see Get started with CMake Tools on Linux. It also works on Windows.

I hope this helps. 😉

Dawid-Witkowski commented 5 months ago

Might've confused VS2022 and VS code, will try the tips out later today, thank you for the quick response :)

Dawid-Witkowski commented 5 months ago

has worked for me, thank you :)