Can't compile testdisk

Using PhotoRec to recover lost data
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
jfareh
Posts: 3
Joined: 10 Feb 2016, 00:21

Can't compile testdisk

#1 Post by jfareh »

I downloaded the Testdisk source code from Github to add a few new file format to PhotoRec. While trying to compile the software I encounter this
./configure: line 8197: syntax error near unexpected token `QTGUI,'
./configure: line 8197: ` PKG_CHECK_MODULES(QTGUI, QtGui >= 4.0.1,,use_qt=false)'

First I thought maybe it was because I messed up the two files (src/file_list.c and src/Makefile.am), but a clean copy with no modification shows the exact same result.

My system is Mac OS Yosemite (it took me a while to fix the missing "autoreconf" issue that I ran into).

Thanks in advance for your kind reply.

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: Can't compile testdisk

#2 Post by cgrenier »

Install pkgconfig first. I don't know the recommended way to do it for Mac OS X but otherwise you can use

Code: Select all

curl http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz -o pkgconfig.tgz
tar -zxf pkgconfig.tgz && cd pkg-config-0.28
./configure && make install
Once it's done, in testdisk directory, use

Code: Select all

autoreconf && ./configure && make

jfareh
Posts: 3
Joined: 10 Feb 2016, 00:21

Re: Can't compile testdisk

#3 Post by jfareh »

Thank you for the reply.
I'm getting "tar: Unrecognized archive format" error. A google search shows that Mac OS doesn't recognized .tgz format and I have yet able to find a solution that works for the command line.

jfareh
Posts: 3
Joined: 10 Feb 2016, 00:21

Re: Can't compile testdisk

#4 Post by jfareh »

jfareh wrote:Thank you for the reply.
I'm getting "tar: Unrecognized archive format" error. A google search shows that Mac OS doesn't recognized .tgz format and I have yet able to find a solution that works for the command line.
I managed to download a copy directly from freedesktop.org and run it directly. Which works, except that I'm getting this error:

Code: Select all

configure: error: Either a previously installed pkg-config or "glib-2.0 >= 2.16" could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to the correct values or pass --with-internal-glib to configure to use the bundled copy.
Don't know how to set the GLIB_CFLAGS and GLIB_LIBS but was able to pass --with-internal-glib. Alas, it is one obstacle after another – it shows many warnings and the last section of codes are :

Code: Select all

A star (*) next to a name means that the command is disabled.

 JOB_SPEC [&]                       (( expression ))
 . filename [arguments]             :
 [ arg... ]                         [[ expression ]]
 alias [-p] [name[=value] ... ]     bg [job_spec ...]
 bind [-lpvsPVS] [-m keymap] [-f fi break [n]
 builtin [shell-builtin [arg ...]]  caller [EXPR]
 case WORD in [PATTERN [| PATTERN]. cd [-L|-P] [dir]
 command [-pVv] command [arg ...]   compgen [-abcdefgjksuv] [-o option
 complete [-abcdefgjksuv] [-pr] [-o continue [n]
 declare [-afFirtx] [-p] [name[=val dirs [-clpv] [+N] [-N]
 disown [-h] [-ar] [jobspec ...]    echo [-neE] [arg ...]
 enable [-pnds] [-a] [-f filename]  eval [arg ...]
 exec [-cl] [-a name] file [redirec exit [n]
 export [-nf] [name[=value] ...] or false
 fc [-e ename] [-nlr] [first] [last fg [job_spec]
 for NAME [in WORDS ... ;] do COMMA for (( exp1; exp2; exp3 )); do COM
 function NAME { COMMANDS ; } or NA getopts optstring name [arg]
 hash [-lr] [-p pathname] [-dt] [na help [-s] [pattern ...]
 history [-c] [-d offset] [n] or hi if COMMANDS; then COMMANDS; [ elif
 jobs [-lnprs] [jobspec ...] or job kill [-s sigspec | -n signum | -si
 let arg [arg ...]                  local name[=value] ...
 logout                             popd [+N | -N] [-n]
 printf [-v var] format [arguments] pushd [dir | +N | -N] [-n]
 pwd [-LP]                          read [-ers] [-u fd] [-t timeout] [
 readonly [-af] [name[=value] ...]  return [n]
 select NAME [in WORDS ... ;] do CO set [--abefhkmnptuvxBCHP] [-o opti
 shift [n]                          shopt [-pqsu] [-o long-option] opt
 source filename [arguments]        suspend [-f]
 test [expr]                        time [-p] PIPELINE
 times                              trap [-lp] [arg signal_spec ...]
 true                               type [-afptP] name [name ...]
 typeset [-afFirtx] [-p] name[=valu ulimit [-SHacdfilmnpqstuvx] [limit
 umask [-p] [-S] [mode]             unalias [-a] name [name ...]
 unset [-f] [-v] [name ...]         until COMMANDS; do COMMANDS; done
 variables - Some variable names an wait [n]
 while COMMANDS; do COMMANDS; done  { COMMANDS ; }
I don't think it was successfully install because after that I tried to "autoreconf && ./configure && make" for testdisk I was getting the exact same error.

Google search couldn't give me any helpful information. It seems this is a very OS X issue and I'm really at my wits' end.

Locked