Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue to build the actual code with MSYS2 / MINGW64 related to TouchstoneParser.cpp / SParameters.cpp code #256

Closed
bvernoux opened this issue Sep 20, 2020 · 2 comments

Comments

@bvernoux
Copy link
Contributor

Issue to build the actual code with MSYS2 / MINGW64 related to TouchstoneParser.cpp code
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
...
Error

[ 14%] Building CXX object lib/scopehal/CMakeFiles/scopehal.dir/TouchstoneParser.cpp.obj
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp: In member function 'SParameterPoint SParameterVector::InterpolatePoint(float) const':
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp:108:23: error: 'M_PI_4' was not declared in this scope; did you mean 'G_PI_4'?
  108 |   ( (fabs(phase_hi) < M_PI_4) && (fabs(phase_lo) < M_PI_4) )
      |                       ^~~~~~
      |                       G_PI_4
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp:120:18: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  120 |    phase_lo += 2*M_PI;
      |                  ^~~~
      |                  G_PI
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp:122:18: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  122 |    phase_hi += 2*M_PI;
      |                  ^~~~
      |                  G_PI
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp:128:22: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  128 |   if(ret.m_phase > 2*M_PI)
      |                      ^~~~
      |                      G_PI
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp: In member function 'SParameterVector& SParameterVector::operator*=(const SParameterVector&)':
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp:152:20: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  152 |   if(us.m_phase < -M_PI)
      |                    ^~~~
      |                    G_PI
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp:154:19: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  154 |   if(us.m_phase > M_PI)
      |                   ^~~~
      |                   G_PI
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp: In member function 'float SParameterVector::GetGroupDelay(size_t)':
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp:176:52: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  176 |  float dfreq = (b.m_frequency - a.m_frequency) * 2*M_PI;
      |                                                    ^~~~
      |                                                    G_PI
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp: In member function 'bool TouchstoneParser::Load(std::string)':
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\TouchstoneParser.cpp:280:12: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  280 |   s11p *= (M_PI / 180);
      |            ^~~~
      |            G_PI

@bvernoux
Copy link
Contributor Author

bvernoux commented Sep 21, 2020

I have the same issue with same error even with the fix adding #include <math.h> in SParameters.cpp
Error

[  7%] Building CXX object lib/scopehal/CMakeFiles/scopehal.dir/SParameters.cpp.obj
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\SParameters.cpp: In member function 'SParameterPoint SParameterVector::InterpolatePoint(float) const':
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\SParameters.cpp:109:23: error: 'M_PI_4' was not declared in this scope; did you mean 'G_PI_4'?
  109 |   ( (fabs(phase_hi) < M_PI_4) && (fabs(phase_lo) < M_PI_4) )
      |                       ^~~~~~
      |                       G_PI_4
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\SParameters.cpp:121:18: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  121 |    phase_lo += 2*M_PI;
      |                  ^~~~
      |                  G_PI
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\SParameters.cpp:123:18: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  123 |    phase_hi += 2*M_PI;
      |                  ^~~~
      |                  G_PI
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\SParameters.cpp:129:22: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  129 |   if(ret.m_phase > 2*M_PI)
      |                      ^~~~
      |                      G_PI
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\SParameters.cpp: In member function 'SParameterVector& SParameterVector::operator*=(const SParameterVector&)':
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\SParameters.cpp:153:20: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  153 |   if(us.m_phase < -M_PI)
      |                    ^~~~
      |                    G_PI
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\SParameters.cpp:155:19: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  155 |   if(us.m_phase > M_PI)
      |                   ^~~~
      |                   G_PI
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\SParameters.cpp: In member function 'float SParameterVector::GetGroupDelay(size_t)':
C:\msys64\home\Ben\scopehal-apps\lib\scopehal\SParameters.cpp:177:52: error: 'M_PI' was not declared in this scope; did you mean 'G_PI'?
  177 |  float dfreq = (b.m_frequency - a.m_frequency) * 2*M_PI;
      |                                                    ^~~~
      |                                                    G_PI
mingw32-make[2]: *** [lib\scopehal\CMakeFiles\scopehal.dir\build.make:251: lib/scopehal/CMakeFiles/scopehal.dir/SParameters.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:251: lib/scopehal/CMakeFiles/scopehal.dir/all] Error 2
mingw32-make: *** [Makefile:149: all] Error 2

@bvernoux bvernoux changed the title Issue to build the actual code with MSYS2 / MINGW64 related to TouchstoneParser.cpp code Issue to build the actual code with MSYS2 / MINGW64 related to TouchstoneParser.cpp / SParameters.cpp code Sep 21, 2020
@bvernoux
Copy link
Contributor Author

Fixed by ngscopeclient/scopehal-apps@53f63d6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant