CarVac / filmulator-gui

Filmulator --- Simplified raw editing with the power of film
https://filmulator.org
Other
670 stars 32 forks source link

‘float log2(float)’ conflicts with a previous declaration #57

Closed emilburzo closed 8 years ago

emilburzo commented 8 years ago

I checked out the master branch, ran qmake

Then, when I ran make, I got the following:

$ make
Makefile:1198: warning: overriding recipe for target 'install_itemfolder_01'
Makefile:1189: warning: ignoring old recipe for target 'install_itemfolder_01'
Makefile:1202: warning: overriding recipe for target 'uninstall_itemfolder_01'
Makefile:1193: warning: ignoring old recipe for target 'uninstall_itemfolder_01'
g++ -c -pipe -std=c++11 -DTOUT -O3 -fprefetch-loop-arrays -fopenmp -fno-strict-aliasing -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I. -Iqtquick2applicationviewer -isystem /usr/include/qt -isystem /usr/include/qt/QtQuick -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtQml -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtSql -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o vibranceSaturation.o core/vibranceSaturation.cpp
core/vibranceSaturation.cpp: In function ‘float log2(float)’:
core/vibranceSaturation.cpp:93:19: error: ‘float log2(float)’ conflicts with a previous declaration
 float log2(float i)
                   ^
In file included from core/filmSim.hpp:26:0,
                 from core/vibranceSaturation.cpp:1:
/usr/include/c++/6.1.1/cmath:1542:3: note: previous declaration ‘constexpr float std::log2(float)’
   log2(float __x)
   ^~~~
make: *** [Makefile:1049: vibranceSaturation.o] Error 1
CarVac commented 8 years ago

I've never seen that error before.

On the other hand, we no longer use it, so I've removed it.

Try compiling again now.

emilburzo commented 8 years ago

Yep, that fixed it.

But now I get:

g++ -c -pipe -std=c++11 -DTOUT -O3 -fprefetch-loop-arrays -fopenmp -fno-strict-aliasing -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I. -Iqtquick2applicationviewer -isystem /usr/include/qt -isystem /usr/include/qt/QtQuick -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtQml -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtSql -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o dateHistogramModel.o database/dateHistogramModel.cpp
database/dateHistogramModel.cpp: In member function ‘void DateHistogramModel::setQuery(int, int, int)’:
database/dateHistogramModel.cpp:8:32: error: ‘round’ was not declared in this scope
 #define ROUND_JULDAY(a) round(a)
                                ^
database/dateHistogramModel.cpp:84:20: note: in expansion of macro ‘ROUND_JULDAY’
     double today = ROUND_JULDAY(todayQuery.value(0).toFloat());
                    ^~~~~~~~~~~~
database/dateHistogramModel.cpp: In member function ‘virtual QVariant DateHistogramModel::data(const QModelIndex&, int) const’:
database/dateHistogramModel.cpp:8:32: error: ‘round’ was not declared in this scope
 #define ROUND_JULDAY(a) round(a)
                                ^
database/dateHistogramModel.cpp:246:29: note: in expansion of macro ‘ROUND_JULDAY’
             qint64 julDay = ROUND_JULDAY(m_dataVector[index.row()*VECTORCOUNT + 0]);
                             ^~~~~~~~~~~~
make: *** [Makefile:1139: dateHistogramModel.o] Error 1

Am I doing something wrong since nobody else ran into these issues?

I'm on archlinux with gcc 6.1.1.

CarVac commented 8 years ago

I think it's because I've never compiled it on such a new gcc and not many people use it in total.

Sometime this week I'll try to spin up an Arch VM or something and see to it that it compiles there.

CarVac commented 8 years ago

I didn't need a VM, I managed to get gcc 6.1.1 and now it (all branches) should compile.

emilburzo commented 8 years ago

Wow, that was fast, thank you very much!

I just checked and can confirm it compiles/run now, can't wait to try it out.