-
Notifications
You must be signed in to change notification settings - Fork 3
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
error: ‘isnan’ was not declared in this scope #1
Comments
According to: https://en.cppreference.com/w/c/numeric/math/isnan you have to include these headers:
|
diff --git a/Makefile b/Makefile
index 71f5dac..07cdd48 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ CXXFLAGS = -Ofast -std=c++11 -Wall -Wno-unused-function
LIBS = `pkg-config --libs jack` `pkg-config --libs libpulse` -pthread
INCLUDE = -I/usr/local/include/ -I/usr/include `pkg-config --cflags jack` `pkg-config --cflags libpulse`
-GCC = g++
+CXX = c++
JV_SOURCES = jack_volume.cpp
JV_OBJS = $(JV_SOURCES:.cpp=.o) /usr/local/lib/libOSC++.a
@@ -12,24 +12,20 @@ PAV_OBJS = $(PAV_SOURCES:.cpp=.o) /usr/local/lib/libOSC++.a
PAV_TARGET = pa-volume
all: $(JV_OBJS) $(PAV_OBJS)
- $(GCC) -o $(JV_TARGET) $(JV_OBJS) $(LIBS)
- $(GCC) -o $(PAV_TARGET) $(PAV_OBJS) $(LIBS)
+ $(CXX) -o $(JV_TARGET) $(JV_OBJS) $(LIBS)
+ $(CXX) -o $(PAV_TARGET) $(PAV_OBJS) $(LIBS)
install: $(JV_TARGET) $(PAV_TARGET)
- cp -f $(JV_TARGET) /usr/local/bin/
- cp -f $(PAV_TARGET) /usr/local/bin/
- cp -f jvctl.py /usr/local/bin/jvctl
- cp -f udp_dispatcher.py /usr/local/bin/udp_dispatcher
- cp -f generic_connector.py /usr/local/bin/generic_connector
- chmod a+rx /usr/local/bin/$(JV_TARGET)
- chmod a+rx /usr/local/bin/$(PAV_TARGET)
- chmod a+rx /usr/local/bin/jvctl
- chmod a+rx /usr/local/bin/udp_dispatcher
- chmod a+rx /usr/local/bin/generic_connector
+ install -d $(DESTDIR)/usr/local/bin
+ install $(JV_TARGET) $(DESTDIR)/usr/local/bin/
+ install $(PAV_TARGET) $(DESTDIR)/usr/local/bin/
+ install jvctl.py $(DESTDIR)/usr/local/bin/jvctl
+ install udp_dispatcher.py $(DESTDIR)/usr/local/bin/udp_dispatcher
+ install generic_connector.py $(DESTDIR)/usr/local/bin/generic_connector
clean:
rm -f $(JV_SOURCES:.cpp=.o) $(JV_TARGET)
rm -f $(PAV_SOURCES:.cpp=.o) $(PAV_TARGET)
%.o:%.cpp
- $(GCC) $(CXXFLAGS) $(INCLUDE) -c $< -o $@
+ $(CXX) $(CXXFLAGS) $(INCLUDE) -c $< -o $@
diff --git a/jack_volume.cpp b/jack_volume.cpp
index c4f2307..d6d4086 100644
--- a/jack_volume.cpp
+++ b/jack_volume.cpp
@@ -8,6 +8,11 @@
#include <iostream>
#include <vector>
#include <thread>
+
+#include <stdio.h>
+#include <math.h>
+#include <float.h>
+
extern "C" {
#include <jack/jack.h>
} |
Thanks for your feedback! Please confirm the fixed version in branch fix-isnan. Best regards |
sorry, I'm not gonna be able to test it at this time. Perhaps @hboetes could test it? |
I already tested it, it's simply the patch I suggested. |
voidseg
added a commit
that referenced
this issue
Sep 25, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Building fails for me with the error message:
gcc --version:
gcc (GCC) 8.2.1 20181127
uname -a:
Linux fishbowl-g1 4.19.13-1-MANJARO #1 SMP PREEMPT Sat Dec 29 15:43:56 UTC 2018 x86_64 GNU/Linux
Given that this is just input validation, I removed that line and was then able to compile it.
The text was updated successfully, but these errors were encountered: