Bug 327211

Summary: build fails: importer/fileutils.cpp:133:10: error: use of undeclared identifier 'mkdtemp'
Product: [Applications] gwenview Reporter: Philip Shaw <wahspilihp>
Component: importerAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: myriam, null
Priority: NOR    
Version: 4.11.2   
Target Milestone: ---   
Platform: MacPorts   
OS: macOS   
Latest Commit: Version Fixed In:
Attachments: Macports build log

Description Philip Shaw 2013-11-06 09:31:32 UTC
Created attachment 83367 [details]
Macports build log

Building using Macports fails on OS X Mavericks, I believe the error is

:info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_kde_gwenview/gwenview/work/build/tests/auto && /opt/local/bin/cmake -E cmake_link_script CMake
Files/imagescalertest.dir/link.txt --verbose=1
:info:build /usr/bin/clang++   -pipe -Os -arch x86_64  -fno-common -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -Woverloaded-virtual 
-fno-exceptions -DQT_NO_EXCEPTIONS -fno-common -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -fdelayed-template-parsing -Wno-return-type-c-linkage -O2 -DNDEBUG -DQT_NO_DEBUG -arch x8
6_64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names  -Wl,-headerpad_max_install_names -arch x86_64 CMakeFiles/imagescalertest.dir/imagescalertest_automoc.o CMakeFiles/imagescalertest.dir/imagesc
alertest.o  -o imagescalertest.app/Contents/MacOS/imagescalertest  /opt/local/lib/libkio.5.11.2.dylib /opt/local/lib/libkdeui.5.11.2.dylib /opt/local/lib/libkdecore.5.11.2.dylib /opt/local/lib/libQtTest.dylib /opt/local/lib/libQtCore.dylib /opt/local/lib/libQtGui.dylib ../../lib/libgwenviewlib.4.11.2.dylib /opt/local/lib/libkio.5.11.2.dylib /opt/local/lib/libQtNetwork.dylib /opt/local/lib/libQtXml.dylib /opt/local/lib/libkdeui.5.11.2.dylib /opt/local/lib/libQtSvg.dylib /opt/local/lib/libkdecore.5.11.2.dylib /opt/local/lib/libQtCore.dylib /opt/local/lib/libQtDBus.dylib -framework Carbon /opt/local/lib/libQtGui.dylib 
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_kde_gwenview/gwenview/work/gwenview-4.11.2/importer/fileutils.cpp:133:10: error: use of undeclared identifier 'mkdtemp'
:info:build     if (!mkdtemp(name.data())) {
:info:build          ^
:info:build 1 error generated.
:info:build make[2]: *** [tests/auto/CMakeFiles/importertest.dir/__/__/importer/fileutils.o] Error 1

I have already reported this downstream, and it may have been fixed in a newer version.
Comment 1 Philip Shaw 2013-11-06 10:02:20 UTC
Now that I've had time to look into it, it builds fine with "#include <unistd.h>" added to fileutils.cpp. 

That does raise the question of why it worked for everyone else, but that's an easy enough fix.
Comment 2 null 2018-07-25 19:15:16 UTC
Hi Philip,

sorry nobody looked into this until now.

On Linux, mkdtemp lives in stdlib.h, which is already included. Is this still an issue for you on macOS? If it is, this should probably be ported to something like QTemporaryDir, or we should add the include (if the reason for de3a0b069c08 still applies).
Comment 3 null 2018-08-10 22:22:24 UTC
No answer, closing for now. Feel free to reopen if it is still an issue.