HOME
  Security
   Software
    Hardware
  
FPGA
  CPU
   Android
    Raspberry Pi
  
nLite
  Xcode
   etc.
    ALL
  
LINK
BACK
 

2021/12/27

電子回路設計ソフトの Fritzingを Windows環境でビルドする方法 電子回路設計ソフトの Fritzingを Windows環境でビルドする方法

(How to Build Fritzing from Source code in Windows with Visual Studio 2017)

Tags: [Windows], [無人インストール]




● Fritzing 1.0.0を Windows環境でビルドする方法

[UPDATE] 2024/01/11
Fritzing 1.0.2を合法的に無料でゲットする方法、Windows環境 VS2019でビルドする方法
Fritzing 1.0.2を合法的に無料でゲットする方法、Windows環境 VS2019でビルドする方法

  How to Build Fritzing 1.0.2 from Source code in Windows with Visual Studio 2019


●電子回路設計ソフトの Fritzingを Windows環境でビルドする方法

 How to Build Fritzing from Source code in Windows with Visual Studio 2017

 Fritzingのダウンロードが有料になったので、その回避方法。

 Arduinoや Raspberry Pi界隈の電子回路の設計で有名な Fritzingが知らない間にダウンロードが有料になっていました。(使用自体は無料)

Fritzing - Download
We are asking you to pay 8€ (around US$10) for downloading the application. This way we can ensure future releases, bugfixes and features.

アプリケーションのダウンロードには、8ユーロ(約US$10)の支払いをお願いしています。そうすることで、将来のリリース、バグフィックス、機能を確保することができます。

 今後のバージョンアップ等の為に支払いをしても良いのですが、ソースコードから自前でビルドする方法を紹介します。

 Fritzing自体は GNU GPL v3ライセンスのオープンソースのソフトで、GitHubに Fritzing公式のリポジトリ(ソースリストを公開している所)が有ります。

fritzing / fritzing-app

 そこにソース リスト一式が有るので自前でコンパイルして実行ファイル等々を作成します。

●電子回路設計ソフトの Fritzingを Windows環境でビルドする方法

 ビルドに必要なソフトとバージョン
Windows 10何でも良い(私は Pro 21H2を使用)
Git client 2.34.1PortableGit-2.34.1-32-bit.7z.exe
Visual Studio 2017Communityでも可、2015や 2019、2022は未確認
CMake 3.22.1cmake-3.22.1-windows-x86_64.msi
Boost C++ Libraries Version 1.78.0boost_1_78_0.zip
libgit2 v0.28.5libgit2-0.28.5.zip
Qt Open Source Qt 5.12.12qt-opensource-windows-x86-5.12.12.exe

● Fritzing公式のビルド手順
Building Fritzing


●電子回路設計ソフトの Fritzingを Windows環境でビルドする方法

 下記を順番に行ないます。
 ・適当な作業ディレクトリを作成する
 ・Git clientをインストールする
 ・Fritzingのソースリストを Git cloneでダウンロードする
 ・Fritzingのパーツを Git cloneでダウンロードする
 ・Visual Studio 2017をインストールする
 ・CMakeをインストールする
 ・Boostライブラリをビルドする
 ・libgit2をビルドする
 ・Qtをインストールする
 ・Qt Creatorを起動して Fritzing projectをビルドする
 ・Fritzingの実行ディレクトリに Qt等の DLLファイルをコピーする
 ↓
 (゚д゚)ウマー


● 適当な作業ディレクトリを作成する

 私の場合は
G:\fritzing
 を作成しました。


● Git clientをインストールする

 私の場合は Portable版をダウンロードして解凍しました。


● Fritzingのソースリストを Git cloneでダウンロードする

cd /d G:\fritzing
git clone https://github.com/fritzing/fritzing-app.git -b master
 ※ fritzing-appのデフォルトの developブランチは ui_fabuploaddialog.h does not existのエラーでビルドできないので masterブランチを cloneする


● Fritzingのパーツを Git cloneでダウンロードする

cd /d G:\fritzing
git clone https://github.com/fritzing/fritzing-parts.git
 ※ fritzing-partsは Gitの管理情報が無いと parts.dbの生成時に Unable to find parts git repositoryで失敗するので必ず git cloneでダウンロードする事


● Visual Studio 2017をインストールする

 Visual Studio 2017は下記の自動インストールで大丈夫です。

・ Visual Studio 2017 Professionalの場合
cd /d %~dp0
set CurDir=%~dp0

vs_Professional.exe ^
 --config %CurDir%VS2017.vsconfig ^
 --productKey AAAAA-BBBBB-CCCCC-DDDDD-EEEEE ^
 --nocache ^
 --norestart --wait ^
 --passive

・ Visual Studio 2017 Communityの場合
cd /d %~dp0
set CurDir=%~dp0

vs_Community.exe ^
 --config %CurDir%VS2017.vsconfig ^
 --nocache ^
 --norestart --wait ^
 --passive

VS2017.vsconfig
{
  "version": "1.0",
  "components": [
    "Microsoft.VisualStudio.Workload.ManagedDesktop",
    "Microsoft.VisualStudio.Workload.NativeDesktop",
    "Microsoft.VisualStudio.Workload.Universal",
    "microsoft.net.componentgroup.targetingpacks.common",
    "microsoft.visualstudio.component.vc.cmake.project",
    "microsoft.visualstudio.componentgroup.nativedesktop.winxp",
    "microsoft.visualstudio.component.vc.atlmfc",
    "microsoft.net.component.3.5.developertools"
  ]
}

● Visual Studioの代わりに Build Tools for Visual Studioでも Fritzingをビルドできました

 Build Tools for Visual Studio 2019でも Fritzingをビルドできました。

Build Tools for Visual Studio
https://aka.ms/vs/16/release/vs_buildtools.exe

cd /d %~dp0
set CurDir=%~dp0

vs_buildtools.exe ^
 --config %CurDir%VSBT2019.vsconfig ^
 --nocache ^
 --norestart --wait ^
 --passive

VSBT2019.vsconfig
{
  "version": "1.0",
  "components": [
    "Microsoft.VisualStudio.Component.Roslyn.Compiler",
    "Microsoft.Component.MSBuild",
    "Microsoft.VisualStudio.Component.CoreBuildTools",
    "Microsoft.VisualStudio.Workload.MSBuildTools",
    "Microsoft.VisualStudio.Component.Windows10SDK",
    "Microsoft.VisualStudio.Component.VC.CoreBuildTools",
    "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
    "Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
    "Microsoft.VisualStudio.Component.Windows10SDK.19041",
    "Microsoft.VisualStudio.Component.TextTemplating",
    "Microsoft.VisualStudio.Component.VC.CoreIde",
    "Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
    "Microsoft.VisualStudio.Workload.VCTools"
  ]
}

● Microsoft Build Tools 2015 Update 3

以前のバージョンの Visual Studio のダウンロード - 2019、2017、2015 以前のバージョン

 Microsoft Build Tools 2015 Update 3
https://download.microsoft.com/download/5/F/7/5F7ACAEB-8363-451F-9425-68A90F98B238/visualcppbuildtools_full.exe


● CMakeをインストールする

 cmake-3.22.1-windows-x86_64.msiを実行して、そのまま「Next」をクリックします。


● Boostライブラリをビルドする

G:\fritzing
 に
boost_1_78_0.zip
 を解凍する。

 下記を G:\fritzingのコマンドラインで実行する。(管理者権限は不要です)
cd boost_1_78_0

echo %CD%
set BOOST_DIR=%CD%
set BUILD_JOBS=%NUMBER_OF_PROCESSORS%
set TOOL_SET=msvc-14.1

b2.exe toolset=%TOOL_SET% link=static runtime-link=static,shared --build-dir=build/x64 address-model=64 -j%BUILD_JOBS% install --includedir=%BOOST_DIR%\include --libdir=%BOOST_DIR%\stage\lib\x64
 Build Tools for Visual Studio 2019の場合の Boostは下記
set TOOL_SET=msvc-14.2

 ちなみに 32bit版の場合は下記。
b2.exe toolset=%TOOL_SET% link=static runtime-link=static,shared --build-dir=build/x86 address-model=32 -j%BUILD_JOBS% install --includedir=%BOOST_DIR%\include --libdir=%BOOST_DIR%\stage\lib\x86
 ※ 32bit版は不要です


● libgit2をビルドする

 Download version 0.28.x of libgit2と書いて有るので 0.28.xの最新の v0.28.5を使用します。

 下記を G:\fritzingのコマンドラインで実行する。(管理者権限は不要です)
git clone https://github.com/libgit2/libgit2 -b v0.28.5
cd libgit2

mkdir build64
cd build64
cmake .. -G "Visual Studio 15 2017" -A x64 -DBUILD_CLAR=OFF
cmake --build . --config Release
 Build Tools for Visual Studio 2019の場合の CMakeは下記
cmake .. -G "Visual Studio 16 2019" -A x64 -DBUILD_CLAR=OFF
cmake --build . --config Release

・ここまでの G:\fritzingディレクトリの中身
ここまでの G:\fritzingディレクトリの中身



rem 間違いの指定方法
rem Wrong Compile option with BUILD_SHARED_LIBS=OFF
cmake .. -G "Visual Studio 15 2017" -A x64 -DBUILD_SHARED_LIBS=OFF -DBUILD_CLAR=OFF
cmake --build . --config Release
 ※ Windowsの場合は BUILD_SHARED_LIBS=OFF指定は不要です。(BUILD_SHARED_LIBS=OFF指定があると git2.dllの DLLファイルが作られない)

 ちなみに 32bit版はエラーが出ました。(そもそもで現在の Fritzingは 32bit版に対応していません)
mkdir build32
cd build32
cmake .. -G "Visual Studio 15 2017" -A x86 -DBUILD_CLAR=OFF
cmake --build . --config Release

このプロジェクトには、Debug|Win32 の構成とプラットフォームの組み合わせが含まれていません。


● Qtをインストールする

 Qt 5.12.12版をインストールしました。
 インストール時に Qtへのアカウント登録(無料)が必要です。

 コンポーネントの選択で
 ・MSVC 2017 64-bit
 を選択します。(32-bitの選択は不要)

 Build Tools for Visual Studio 2019の場合も「MSVC 2017 64-bit」で大丈夫でした。


● Qt Creatorを起動して Fritzing projectをビルドする

 Qt Creator 5.0.2を起動する
 ファイル/プロジェクトを開くで phoenix.proファイルを選択する
G:\fritzing\fritzing-app\phoenix.pro

 Configure Projectで「Desktop Qt 5.12.12 MSVC2017 64bit」の 64bitを選択する

 Qtの左側中央のスパナのアイコン プロジェクトをクリックする
 Build & Runの Buildをクリックする
 ビルド設定 - ビルド設定を編集で Debugを Releaseに変更する
Qt Creatorを起動して Fritzing projectをビルドする



 Build & Runの Runをクリックする
 実行時の設定 - 実行 - コマンドライン引数に下記を設定する
-f "/path/to/fritzing-app/" -parts "/path/to/fritzing-parts/" -db "/path/to/fritzing-parts/parts.db"
 今回の場合は下記になる
-f "G:\fritzing\fritzing-app\" -parts "G:\fritzing\fritzing-parts\" -db "G:\fritzing\fritzing-parts\parts.db"
Qt Creatorを起動して Fritzing projectをビルドする



 Qtの左下の緑色の三角(再生マーク)をクリックする
Qt Creatorを起動して Fritzing projectをビルドする



 Qtの下部に下記の表示が出たら parts.dbの作成が完了
G:\fritzing\release64\Fritzing.exe exited with code 0
Qt Creatorを起動して Fritzing projectをビルドする


Qt Creatorを起動して Fritzing projectをビルドする
 G:\fritzing\fritzing-partsに parts.dbが生成される。

 実行時の設定 - 実行 - コマンドライン引数から -db "/path/to/fritzing-parts/parts.db"を削除する
 今回の場合は下記になる
-f "G:\fritzing\fritzing-app\" -parts "G:\fritzing\fritzing-parts\"

 再度 Qtの左下の緑色の三角(再生マーク)をクリックする

 Fritzingが起動すれば大成功!

Qt Creatorを起動して Fritzing projectをビルドする


Qt Creatorを起動して Fritzing projectをビルドする


Qt Creatorを起動して Fritzing projectをビルドする


Qt Creatorを起動して Fritzing projectをビルドする



 Fritzingの実行ファイル一式は
G:\fritzing\release64
 にできています。(Releaseを選択している場合)

 ビルドした Fritzingは 64bit版の Windows環境で動かせます。


● 配布用に Fritzingの実行ディレクトリに Qt等の DLLファイルをコピーする方法

 上記で生成した状態では Qt Cleator上でしか Fritzingを実行できません。

G:\fritzing\release64\Fritzing.exe
 の Fritzing.exeを実行しても「Qt5Svg.dllが見つからない」等のエラーが出て実行できません。

 Fritzing.exe単体で動く様に Qtの実行に必要な DLLファイルを G:\fritzing\release64ディレクトリにコピーする必要があります。

 また、Qtでビルドしたプロジェクトを配布する場合も同様に実行時に必要な Qtの DLLファイルをコピーする必要があります。

 Qtに付属の windeployqtコマンドで Qtの実行に必要な DLLファイルをコピーできます。
 Fritzingの場合はその他に libgit2の git2.dllファイルが必要なのでそれもコピーします。

cd /d C:\Qt\Qt5.12.12\5.12.12\msvc2017_64\bin
windeployqt.exe G:\fritzing\release64

rem Copy git2.dll
cd /d G:\fritzing
copy .\libgit2\build64\Release\git2.dll .\release64\

 上記を実行後に
G:\fritzing\release64\Fritzing.exe
 の Fritzing.exeを実行できる様になります。

 また、
G:\fritzing\release64
 ディレクトリを ZIP等で圧縮して他のパソコンに展開しても動きます。
 (配布できる様になる)

・配布用に Fritzingの実行ディレクトリに Qt等の DLLファイルをコピーする方法
配布用に Fritzingの実行ディレクトリに Qt等の DLLファイルをコピーする方法


配布用に Fritzingの実行ディレクトリに Qt等の DLLファイルをコピーする方法




● Fritzingのバージョンの確認方法

org.fritzing.Fritzing.appdata.xml
 ファイルの中に記載があります。

 developブランチ
https://github.com/fritzing/fritzing-app/blob/develop/org.fritzing.Fritzing.appdata.xml
<release version="0.9.9" date="2021-09-09"/>

 masterブランチ
https://github.com/fritzing/fritzing-app/blob/master/org.fritzing.Fritzing.appdata.xml
<release version="0.9.6" date="2021-02-01"/>


● Fritzing Build Error ui_fabuploaddialog.h does not exist.

:-1: エラー: dependent 'G:\fritzing\debug64\ui_fabuploaddialog.h' does not exist.

 解決方法:諦めて masterブランチのソース一式を使用

Compiling error ui_fabuploaddialog.h

vanepp  Leader
Oct 14
While I haven’t compiled from source in a couple of years, my guess is that you are using the development head source and there is a missing .h file. Try moving back to one of the release points (0.9.6 for instance) and compiling that.

Peter


● Fritzing Build Error LNK2001 unresolved external symbol __imp_GetTokenInformation

git2.lib(path.obj):-1: エラー: LNK2001: 外部シンボル "__imp_GetTokenInformation" は未解決です。

 解決方法:libgit2のビルド設定で -DBUILD_SHARED_LIBS=OFFを削除

error LNK2001: unresolved external symbol #3801

failiz commented on 25 Mar
You have to compile libgit2 and it should generate a dll file. If there is no dll file, Fritzing will not work. Follow the instructions in the page of gitlib2 or try without -DBUILD_SHARED_LIBS=OFF
I do not think that it is a version problem, but I am using version 1.0.1
try without -DBUILD_SHARED_LIBS=OFF


● Fritzing Build Error Unable to find parts git repository

 解決方法:fritzing-partsを git cloneでダウンロード

Unable to find parts git repository #3890

https://github.com/fritzing/fritzing-app/blob/develop/src/version/partschecker.cpp
  git_libgit2_init();

  int error = git_repository_open(&repository, repoPath.toUtf8().constData());
  if (error) {
    FMessageBox::warning(NULL, QObject::tr("Regenerating parts database"), QObject::tr("Unable to find parts git repository"));
    goto cleanup;
  }

・Fritzing Build Error Unable to find parts git repository
Fritzing Build Error Unable to find parts git repository





Tags: [Windows], [無人インストール]

●関連するコンテンツ(この記事を読んだ人は、次の記事も読んでいます)

電子回路設計ソフトの Fritzingを無料でダウンロードして使用する方法
電子回路設計ソフトの Fritzingを無料でダウンロードして使用する方法

  Fritzingのダウンロードが有料になったので、GitHubから無料でダウンロードする方法

無料で使える電子回路設計ソフトの Fritzingをラズパイで動かす方法
無料で使える電子回路設計ソフトの Fritzingをラズパイで動かす方法

  Fritzingをラズパイにインストールして使う方法

Fritzing 1.0.2を合法的に無料でゲットする方法、Windows環境 VS2019でビルドする方法
Fritzing 1.0.2を合法的に無料でゲットする方法、Windows環境 VS2019でビルドする方法

  How to Build Fritzing 1.0.2 from Source code in Windows with Visual Studio 2019

電子回路設計ソフトの Fritzingをラズパイ環境でビルドする方法
電子回路設計ソフトの Fritzingをラズパイ環境でビルドする方法

  How to Build Fritzing from Source code in Raspberry Pi OS

電子回路設計ソフトの Fritzingで任意の画像をブレッドボード画面に埋め込む方法
電子回路設計ソフトの Fritzingで任意の画像をブレッドボード画面に埋め込む方法

  How to import any image on the breadboard with Fritzing electronic circuit design software




[HOME] | [BACK]
リンクフリー(連絡不要、ただしトップページ以外は Web構成の変更で移動する場合があります)
Copyright (c) 2021 FREE WING,Y.Sakamoto
Powered by 猫屋敷工房 & HTML Generator

http://www.neko.ne.jp/~freewing/software/how_to_build_fritzing_windows_visual_studio/