khartmansjsu / khartmansjsu/MOC-Linux
Get MOC_GridCalc_BDE.cpp to compile
- Dominant language
- Gnuplot
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Goal: compile MOC_GridCalc_BDE.cpp
### Summary
So far I have commented out a number of include statements which are to Windows-specific header files. The latest Attempt at compiling (see below) resulted in a large number of errors stemming from both the main file being compiled and a number of its dependencies. I am currently in the process of determining if those dependencies are still worth keeping. It seems that `MOC_GridDlg.h` is not entirely necessary (it defines many classes for Windows-specific dialogue boxes), but it has some hard-coded values in those classes. I need to find out if these values need to be re-defined in the main script, `MOC_GridCalc_BDE.cpp` once I remove the include call to `MOC_GridDlg.h`.
### Attempt 1:
```
[khartm12@integrity MOC_Grid_BDE]$ gcc MOC_GridCalc_BDE.cpp -o MOCGridCalc_BDE_test
In file included from MOC_GridCalc_BDE.h:34,
from MOC_GridCalc_BDE.cpp:30:
Chart.h:9:10: fatal error: afxwin.h: No such file or directory
9 | #include "afxwin.h"
| ^~~~~~~~~~
compilation terminated.
[khartm12@integrity MOC_Grid_BDE]$
```
- Change: On `line 9` of `Chart.h`, comment out dependency on `afxwin.h`
- Reason: afxwin.h is a windows-specific header file that does not exist in the files that have been provided. It does not contain code necessary for the calculation of the MOC nozzle contours, so we should be able to gut the application of this file and move forward.
- Result: No fatal error for `afxwin.h`
### Attempt 2:
```
[khartm12@integrity MOC_Grid_BDE]$ gcc MOC_GridCalc_BDE.cpp -o MOCGridCalc_BDE_test
MOC_GridCalc_BDE.cpp:32:10: fatal error: afx.h: No such file or directory
32 | #include "afx.h"
| ^~~~~~~
compilation terminated.
[khartm12@integrity MOC_Grid_BDE]$
```
- Change: On `line 32` in `MOC_GridCalc_BDE.cpp`, comment out dependency on `afx.h`
- Reason: By [this](https://stackoverflow.com/questions/16227840/where-can-i-get-afx-h-files), afx.h and other MFC libraries are Microsoft-specific header files. As such, we must remove them and keep on working.
- Result: No fatal error for `afx.h`
### Attempt 3:
```
[khartm12@integrity MOC_Grid_BDE]$ gcc MOC_GridCalc_BDE.cpp -o MOCGridCalc_BDE_test
MOC_GridCalc_BDE.cpp:39:10: fatal error: Resource.h: No such file or directory
39 | #include "Resource.h"
| ^~~~~~~~~~~~
compilation terminated.
[khartm12@integrity MOC_Grid_BDE]$
```
Note/context: A number of custom header files have a lowercase leading character in their names while their respective include statements have an uppercase.
- Change(s): Duplicate and capitalize `resource.h` in the MOC_GRID_BDE subdirectory; Duplicate and lowercase `Chart.h` in the MOC_GRID_BDE subdirectory;
- Reason: Resource.h does not exist, but resource.h _does_ exist. By [this](https://stackoverflow.com/questions/1951951/when-including-header-files-is-the-path-case-sensitive) and further by [this](https://en.wikipedia.org/wiki/Case_sensitivity#In_filesystems), I hypothesize that capitalizing/lowercasing any of the custom header files which have include statements with a capital will fix these compilation errors. **TLDR**: In Windows, one can compile this code because references to headers are not case sensitive, but in Linux systems, they _are_ case-sensitive.
- Result: No more issues calling to chart.h and Resource.h from the files which depend on them.
### Attempt 4:
See: [compile_errors1.txt](https://github.com/khartmansjsu/MOC-Linux/files/8193409/compile_errors1.txt)
Description:
A lot of type errors in `Chart.h` for the following:
1. BOOL
2. COLORREF
3. CBitmap
4. CString
5. CDC
6. CPoint
7. CRect
8. CFont
9. afx_msg
10. DECLARE_MESSAGE_MAP()
A lot of errors in `MOC_GridDlg.h`
1. DECLAR_DYNAMIC()
2. Syntax error with `CWnd*`
3. CEdit
4. CButton
5. CComboBox
6. afx_msg
7. `DECLAR_MESSAGE_MAP()` no type and syntax error
8. `AfxMessageBox` not declared
errors in `MOCPlotDialog.h`
1. No declaration of CDataExchange
2. Syntax errors
3. `DECLARE_MESSAGE_MAP` no type
errors in `MOC_GridCalc_BDE.cpp` are numerous an probably can be handled by addressing the above issues. Let's see...
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.