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

Building issue: lack of -std=c++11 flag on src/CMakeLists.txt #24

Open
ItaloMunozAutentia opened this issue Aug 15, 2018 · 0 comments
Open

Comments

@ItaloMunozAutentia
Copy link

ItaloMunozAutentia commented Aug 15, 2018

Building on Ubuntu 16.04, produces a warning and an error:

Warning:

Scanning dependencies of target minizip
[ 17%] Building C object external/minizip/CMakeFiles/minizip.dir/ioapi.c.o
[ 20%] Building C object external/minizip/CMakeFiles/minizip.dir/unzip.c.o
[ 22%] Building C object external/minizip/CMakeFiles/minizip.dir/zip.c.o
/home/imunoz/Documentos/Dev/AutentiaX/Agente/third-party-libs/Update-Installer/external/minizip/zip.c: In function ‘zipOpenNewFileInZip4_64’:
/home/imunoz/Documentos/Dev/AutentiaX/Agente/third-party-libs/Update-Installer/external/minizip/zip.c:1248:28: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
         zi->ci.pcrc_32_tab = get_crc_table();
                            ^

Error:

Scanning dependencies of target updater
[ 75%] Building CXX object src/CMakeFiles/updater.dir/main.cpp.o
/home/imunoz/Documentos/Dev/AutentiaX/Agente/third-party-libs/Update-Installer/src/main.cpp: In function ‘int main(int, char**)’:
/home/imunoz/Documentos/Dev/AutentiaX/Agente/third-party-libs/Update-Installer/src/main.cpp:153:3: error: ‘unique_ptr’ is not a member of ‘std’
   std::unique_ptr<UpdateDialog> dialog(createUpdateDialog());
   ^
/home/imunoz/Documentos/Dev/AutentiaX/Agente/third-party-libs/Update-Installer/src/main.cpp:153:31: error: expected primary-expression before ‘>’ token
   std::unique_ptr<UpdateDialog> dialog(createUpdateDialog());
                               ^
/home/imunoz/Documentos/Dev/AutentiaX/Agente/third-party-libs/Update-Installer/src/main.cpp:153:60: error: ‘dialog’ was not declared in this scope
   std::unique_ptr<UpdateDialog> dialog(createUpdateDialog());
                                                            ^
src/CMakeFiles/updater.dir/build.make:62: fallo en las instrucciones para el objetivo 'src/CMakeFiles/updater.dir/main.cpp.o'
make[2]: *** [src/CMakeFiles/updater.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:255: fallo en las instrucciones para el objetivo 'src/CMakeFiles/updater.dir/all'
make[1]: *** [src/CMakeFiles/updater.dir/all] Error 2
Makefile:94: fallo en las instrucciones para el objetivo 'all'
make: *** [all] Error 2

The error triggering everything else is: "error: ‘unique_ptr’ is not a member of ‘std’" but main.cpp includes <memory>.

It can be fixed by editing src/CMakeLists.txt, line 7 from:

if (UNIX)
	add_definitions(-Wall -Werror -Wconversion)
endif()

to:

if (UNIX)
	add_definitions(-Wall -Werror -Wconversion -std=c++11)
endif()

and to fix the warning, edit external/minizip/zip.c line 1248
from:
zi->ci.pcrc_32_tab = get_crc_table();
to:
zi->ci.pcrc_32_tab = (const unsigned long*)(get_crc_table());

ItaloMunozAutentia added a commit to ItaloMunozAutentia/Update-Installer that referenced this issue Sep 7, 2018
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