Building Photorec source code for Windows

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
hexxx
Posts: 3
Joined: 21 May 2014, 09:48

Building Photorec source code for Windows

#1 Post by hexxx »

Can it be build under cygwin? What external libraries are required? Which options should be used for ./configure?

hexxx
Posts: 3
Joined: 21 May 2014, 09:48

Re: Building Photorec source code for Windows

#2 Post by hexxx »

I've tried building for linux, and it looked like a quest too :) At first you need to install ncurses and libuuid, otherwise configure will fail.
The configure line that worked for me is:

Code: Select all

./configure CC="gcc" CXX="g++ -std=c++0x" CPP="gcc -E" CXXCPP="g++ -E -std=c++0x"
After that I had to patch qphotorec.cpp line 890:

Code: Select all

  //static alloc_data_t list_search_space={
  //  .list = TD_LIST_HEAD_INIT(list_search_space.list)
  //};
  static alloc_data_t list_search_space;
  list_search_space.list = TD_LIST_HEAD_INIT(list_search_space.list);
and qpsearch.cpp line 228:

Code: Select all

	      //file_info_t dir_list = {
		//.list = TD_LIST_HEAD_INIT(dir_list.list),
		//.name = NULL
	      //};
		file_info_t dir_list;
		dir_list.list = TD_LIST_HEAD_INIT(dir_list.list);
		dir_list.name = NULL;
to use "standard way of initialization".
Then it started failing on QRC compilation due to several png files in src/gnome were missing: image-x-generic.png and help-about.png. After adding these files it compiled at last.

keithbcg
Posts: 3
Joined: 22 Aug 2012, 04:11

Re: Building Photorec source code for Windows

#3 Post by keithbcg »

Hi -

I'm also failing to build due to some missing files (OS X 10.9.3 - Darwin Kernel Version 13.2.0)
Did these not get added to the git repo?
- Keith

Missing (so far):
./ChangeLog
./src/fat_common.h
./src/gnome/photorec_64x64.png

I see that 'include "fat_common.h"' was added to a bunch of files on 2013-11-01
http://git.cgsecurity.org/cgit/testdisk ... c20b059ece
but I don't see fat_common.h itself.

- Details -

(Based on the compiling instructions at http://www.cgsecurity.org/wiki/Developers)
$ git clone http://git.cgsecurity.org/testdisk.git
$ cd testdisk
$ mkdir config
$ autoreconf --install -W all -I config
...fails with error:
Makefile.am: error: required file './ChangeLog' not found"
$ touch ChangeLog
$ autoreconf --install -W all -I config
$ ./configure
...completes OK, with the following warnings:
configure: WARNING: Could not find a windres tool in your PATH.
configure: WARNING: Use of ext2fs library disabled
configure: WARNING: Use of ntfs3g library disabled
configure: WARNING: Use of ntfs library disabled
configure: WARNING: No reiserfs library detected
configure: WARNING: Use of ewf library disabled
$ make -k
$ make -k
...fails with the following errors:
<file:line:pos> : fatal error: 'fat_common.h' file not found (in 12 files)
...and...
rcc qphotorec.qrc -o rcc_qphotorec.cpp
RCC: Error in 'qphotorec.qrc': Cannot find file 'photorec_64x64.png'

hexxx
Posts: 3
Joined: 21 May 2014, 09:48

Re: Building Photorec source code for Windows

#4 Post by hexxx »

Damn, I've missed that http://www.cgsecurity.org/wiki/Developers page and tried to compile the source code from the download page: http://www.cgsecurity.org/testdisk-6.14.tar.bz2

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

Re: Building Photorec source code for Windows

#5 Post by cgrenier »

Thanks for reporting the problem, I have added the missing files in the git tree.

Locked