Reputation: 309
I'm trying to install FLTK library for Chapter 12 from Programming Principles and Practice, but the build command is not recognized. What should I do? Thanks!
PS D:\3. Programming\C++\GUI\fltk-1.3.5> make
make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ make
+ ~~~~
+ CategoryInfo : ObjectNotFound: (make:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Upvotes: 3
Views: 3427
Reputation: 1137
I usually feel more comfortable with Makefiles, so I set VS Code for using the Makefile within my projects. I have done the following steps after installing FLTK.
I create a directory containing all my source files, headers and so on. Let's say that I have a FLTK_ex
folder with hello.cpp
and its Makefile
I open VS Code, then File->Open
and I select the folder FLTK_ex
From the Terminal
menu, I select Configure Default Build Task...
: in the menu that appears I select Create tasks.json file from template
and then Others
A default json file appears, I modify it as
{
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "Make",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
For compiling, go to Terminal
menu and select Run Build Task...
For running the program, in the Run
menu select Run without debugging
, C++
A launch.json
file appears: modify it as (where myprogram
is the executable name)
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/myprogram",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb"
}
]
}
For effectevely run the program, in Run
menu select again Run without debugging
.
I have FLTK 1.3.5, macOS Catalina 10.15.5, clang version 11.0.3, VS Code 1.47.
In order to use FLTK in VS Code, I just followed the instruction (in Readme.OSX.txt
) for simply installing FLTK library, there is a similar file for Windows systems (README.MSWindows.txt
).
The guidelines for writing a Makefile
for FLTK
are here, if you need more insights on Makefile
s you can find a complete guide here or a shorter introduction here.
Upvotes: 3
Reputation: 8299
You haven't specified which version of Visual Studio you are using.
Upvotes: 1