Fusion 360 Visual Studio C++ Build Errors

Fusion 360 Visual Studio C++ Build Errors

tperam
Advocate Advocate
1,288 Views
2 Replies
Message 1 of 3

Fusion 360 Visual Studio C++ Build Errors

tperam
Advocate
Advocate
I copied the following C++ Sample Program from Fusion 360 and Pasted into Visual Studio Academic, which came with Fusion 360 and Tried to build it.
 
I got Errors on all the header files and lots of errors on most of the lies as highlighted below.
 
Probably it does not see the header files.
 
I Have Visual Studio 2010 Installed previously.
 
How can I set the path for the Project, header and  source files for the compile to work properly?
 
// F360SkCircle.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"

#include <Core/Application/Application.h>
#include <Core/Application/Document.h>
#include <Core/Application/Documents.h>
#include <Core/Geometry/Point3D.h>
#include <Core/UserInterface/UserInterface.h>
#include <Fusion/Components/Component.h>
#include <Fusion/Construction/ConstructionPlane.h>
#include <Fusion/Fusion/Design.h>
#include <Fusion/Sketch/Sketch.h>
#include <Fusion/Sketch/SketchCircle.h>
#include <Fusion/Sketch/SketchCircles.h>
#include <Fusion/Sketch/SketchCurves.h>
#include <Fusion/Sketch/Sketches.h>
#include <Fusion/Sketch/SketchPoint.h>

using namespace adsk::core;
using namespace adsk::fusion;
Ptr<UserInterface> ui;
extern "C" XI_EXPORT bool run(const char* context)
{
 Ptr<Application> app = Application::get();
 if (!app)
  return false;
 ui = app->userInterface();
 if (!ui)
  return false;
 Ptr<Documents> docs = app->documents();
 if (!docs)
  return false;
 // Create a document.
 Ptr<Document> doc = docs->add(DocumentTypes::FusionDesignDocumentType);
 if (!doc)
  return false;
 Ptr<Design> design = app->activeProduct();
 if (!design)
  return false;
 // Get the root component of the active design
 Ptr<Component> rootComp = design->rootComponent();
 if (!rootComp)
  return false;
 // Create sketch
 Ptr<Sketches> sketches = rootComp->sketches();
 if (!sketches)
  return false;
 Ptr<Sketch> sketch = sketches->add(rootComp->xYConstructionPlane());
 if (!sketch)
  return false;
 Ptr<SketchCurves> curves = sketch->sketchCurves();
 if (!curves)
  return false;
 // Draw some circles.
 Ptr<SketchCircles> circles = curves->sketchCircles();
 if (!circles)
  return false;
 Ptr<SketchCircle> circle1 = circles->addByCenterRadius(Point3D::create(0, 0, 0), 2);
 if (!circle1)
  return false;
 Ptr<SketchCircle> circle2 = circles->addByCenterRadius(Point3D::create(8, 3, 0), 3);
 if (!circle2)
  return false;
 // Add a circle at the center of one of the existing circles.
 circles->addByCenterRadius(circle2->centerSketchPoint(), 4);
 return true;
}

#ifdef XI_WIN
#include <windows.h>
BOOL APIENTRY DllMain(HMODULE hmodule, DWORD reason, LPVOID reserved)
{
 switch (reason)
 {
 case DLL_PROCESS_ATTACH:
 case DLL_THREAD_ATTACH:
 case DLL_THREAD_DETACH:
 case DLL_PROCESS_DETACH:
  break;
 }
 return TRUE;
}
#endif // XI_WIN

 

 

1>------ Build started: Project: F360SkCircle, Configuration: Debug Win32 ------
1>Build started 2018-08-25 10:32:28 AM.
1>PrepareForBuild:
1>  Creating directory "c:\users\tpera\documents\visual studio 2010\Projects\F360SkCircle\Debug\".
1>InitializeBuildStatus:
1>  Creating "Debug\F360SkCircle.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1>  stdafx.cpp
1>  F360SkCircle.cpp
1>c:\users\tpera\documents\visual studio 2010\projects\f360skcircle\f360skcircle\f360skcircle.cpp(7): fatal error C1083: Cannot open include file: 'Core/Application/Application.h': No such file or directory
1>
1>Build FAILED.

 

0 Likes
Accepted solutions (2)
1,289 Views
2 Replies
Replies (2)
Message 2 of 3

tperam
Advocate
Advocate
Accepted solution

Problem Solution Found:

 

In the Visual Studio Debug Menu Selected “Attach to Process” and Selected “Native Code” and “Fusion.Exe”.  

 

the Problem disappeared, 

 

But Still Got the the Following Error on Trying to debug the TestScript

1>------ Build started: Project: TestScript, Configuration: Debug x64 ------

1>Build started 2018-08-25 4:09:00 PM.

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(514,5): error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.

1>

1>Build FAILED.

0 Likes
Message 3 of 3

tperam
Advocate
Advocate
Accepted solution

Solution Found:

 

I followed as in the Answer in https://stackoverflow.com/questions/10280956/how-to-use-msbuild-to-target-v110-platform-toolset

 

"Use the menu based options to do this. From VC++2010 Express: - Right click on the main file of the project (not the solution itself at the very top of the tree). - Click General. - Find Platform Toolset on the right side of the dialog, top half. - Change from v110 to v100. - Click OK."

 

In Visual Studio Academic, I Selected the TestScript Project, Below the Solution (2nd from the Top), right clicked, in Properties, I Changed  V110 to V100. Then the Build Succeeded. But I don’t know, weather it has other implications in the behavior of Visual Studio for Fusion 360.

 

Thurai

0 Likes