[H8-ML(5868)] 多層基板のVcc層とGND層間静電容量計算プログラムがコンパイルできない
From: "dimension" <dimension4500c@xxxxxxxxxxx>
Date: 2006年03月03日(金)21時07分03秒
こんばんは this is dimension

FR-4(ガラスエポキシ)多層基板のVcc層と、GND層間の静電容量を計算するプログラム
を作りました。(計算式は、c=Er*Eo*S/d [F]です。)
それをBorlandC++5.5でコンパイルすると、Windows2000では正常にコンパイルできるのに
Windows XP Pro.ではコンパイルできません。
原因と対策をわかるかたございましたらご教示願います。

Borland社のFAQから

http://www.neco.nu/gohodoji/bccfaq/bccfaq.html#compileerror
>「bcc32.cfg」,「ilink32.cfg」をそれぞれ作成して,そこにライブラリやインクルードファイルを収めたディレクトリ名を
>記述しなければなりません。 
> もし面倒なようでしたらsetbccというプログラムを使ってください。
> これを使えば両方ともウィザード形式で設定できます。 

多分、ここが原因かもしれません。現在 bcc32.cfg, ilink.cfg ファイルが存在していません。
しかし、これら.cfgの書き方が不明です。


Windows XP Pro.でのコンパイル結果:NG

C:\borland\bcc55\Bin>bcc32 fr4-capacity.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
FR4-Capacity.cpp:
エラー E2209 FR4-Capacity.cpp 1: インクルードファイル 'iostream' をオープンでき
ない
エラー E2282 FR4-Capacity.cpp 2: 名前空間名が必要
エラー E2451 FR4-Capacity.cpp 31: 未定義のシンボル cout(関数 FR4_Pb::input() )
エラー E2451 FR4-Capacity.cpp 31: 未定義のシンボル endl(関数 FR4_Pb::input() )
エラー E2451 FR4-Capacity.cpp 32: 未定義のシンボル cin(関数 FR4_Pb::input() )
エラー E2451 FR4-Capacity.cpp 46: 未定義のシンボル cout(関数 FR4_Pb::output() )
エラー E2451 FR4-Capacity.cpp 46: 未定義のシンボル endl(関数 FR4_Pb::output() )
*** 7 errors in Compile ***

Windows2000でのコンパイル結果:OK

実行結果:Windows2000/XPのDOS窓で正常

C:\borland\bcc55\Bin>fr4-capacity1
//Input width of PB (ex. 180.5 [mm])
180.5
//Input length of layer (ex. 81.3[mm])
81.3
//Input thickness between Vcc layer and Gnd layer (ex. 0.5 [mm])
0.5
*** Outcome ***
1.22134e-09[F]
0.00122134[uF]
1221.34[pF]


//ソースプログラム ファイル名: FR4-Capaciy.cpp

#include <iostream>
using namespace std ;

//Capacity between Vcc layer and Gnd layer of FR-4 PB

class FR4_Pb
{
 double width ;   // uinit in [m]
 double length ; // unit in [m]
 double d       ; // thickness between Vcc and Gnd layers
 double capacity ;

 public :

 void FR4_Pb::CalcCapacity() ;
 void FR4_Pb::input() ;
 void FR4_Pb::output() ;

 } ;

void FR4_Pb::CalcCapacity()
{
 double s = this->width * this->length ;
 double Er = 4.7 ;
 double Eo=8.854E-12 ;
 this->capacity = Er*Eo*s/this->d ;
 }

void FR4_Pb::input()
{
 cout << "//Input width of PB (ex. 180.5 [mm]) " <<endl ;
 cin >> this ->width ;
 this->width = this->width / 1000.0 ;

 cout << "//Input length of layer (ex. 81.3[mm]) " <<endl ;
 cin >> this ->length ;
 this->length = this->length / 1000.0 ;

 cout << "//Input thickness between Vcc layer and Gnd layer (ex. 0.5 [mm]) " <<endl ;
 cin >> this ->d ;
 this->d = this->d / 1000.0 ;
 }

void FR4_Pb::output()
{
 cout << "*** Outcome ***" << endl ;
 cout << this->capacity << "[F]" << endl ;
 cout << this->capacity / 1e-6 << "[uF]" << endl ;
 cout << this->capacity / 1e-12 << "[pF]" << endl ;
 }


void main()
{
 FR4_Pb kiban1 ;

 kiban1.input() ;
 kiban1.CalcCapacity() ;
 kiban1.output() ;

 }

Windows2000でコンパイルした実行ファイルをUPしました。(拡張子 .exe を .pngに変えてあります。)
http://radio.s56.xrea.com/radio/src/radio0612.png
Virus無しチェック済みです。
右クリックファイル保存でDL出来ます。



スレッド概略
[表示中](起点)
 ├[5869(1)]
 └[5870(2)]


投稿順に移動
[←前の記事へ(P)]
[→次の記事へ(N)]


リスト表示へ
[このスレッド(T)]
[本記事の前後(L)]