error LNK1104: cannot open file 'filedialog.lib'

Building and customizing Audacity from the source code.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
Dabbler
Posts: 5
Joined: Mon Jun 27, 2011 5:03 pm
Operating System: Please select

error LNK1104: cannot open file 'filedialog.lib'

Post by Dabbler » Tue Jun 28, 2011 10:50 am

I am using Windows 7 on a 64 bit machine.

I followed the steps in http://wiki.audacityteam.org/wiki/Developing_On_Windows, and used MS VC++ 2008 Express plus the windows SDK download.

I have downloaded wxWidgets version 2.8.11.

I can confirm that my WXWIN is set as a system environment variable only (not a user variable, but I am the only user of this machine) to point correctly to C:wxWidgets-2.8.11 where my wxWidgets has been installed.

I performed the additional step, not documented in http://wiki.audacityteam.org/wiki/Developing_On_Windows, of setting:
#define wxUSE_ODBC 1
(instead of zero as supplied by default) in setup.h, to allow all 20 projects in wxWidgets to build successfully.

I have successfully built release, debug, unicode release and unicode debug versions, both non-dll and dll, of wxWidgets, and successfully built a sample widgets project using unicode release and unicode debug widgets dlls.

So I am hoping I have hit all the known benchmarks for building wxWidgets, but I am having problems building the Audacity solution I got from SVN head. All the compilation phase proceeds correctly but the linking phase fails with
LINK : fatal error LNK1104: cannot open file 'filedialog.lib'

I can confirm that filedialog.lib exists - see attachment 1. It looks as if it has been generated by compiling this Audacity solution, based on the file date. But then it fails to find it on the link phase - see attachment 2. Does this imply some inconsistency in the linker project properties of the Audacity project included in the Audacity solution?

I have successfully built Audacity about 2 years ago on Windows xp but I can't remember having met this particular problem - there were other ones instead though :-)
Thanks in advance for any help you can give me with this
Best regards
David Wallace
Attachments
Attachment1.jpg
screen shot of directory listing
Attachment1.jpg (91.25 KiB) Viewed 8178 times
Attachment2.txt
Audacity build log
(123.77 KiB) Downloaded 252 times

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: error LNK1104: cannot open file 'filedialog.lib'

Post by Edgar » Tue Jun 28, 2011 4:59 pm

I don't know what is going on here. From time to time I get something similar (but have not seen it in filedialog). What seems to cure the problem is to close down VC++, re-boot (may not need a re-boot but closing/restarting VC++ seems required) then using Batch Build do a Select All, Clean and then Build. Somehow VC++ gets confused and tries to access a file which is not yet ready for access. It may be some other process inspecting the file (an anti-virus program, an index service the file system watcher etc.).

If the problem persists, after doing one Batch Build, Select All, Build, do it again (this will result in minimal output), capture the complete text from the Output window and paste it in here (wrap the text in a code block--see buttons above).

Dabbler
Posts: 5
Joined: Mon Jun 27, 2011 5:03 pm
Operating System: Please select

Re: error LNK1104: cannot open file 'filedialog.lib'

Post by Dabbler » Tue Jun 28, 2011 10:09 pm

Problem persists with all 4 configurations:
Linking...
LINK : fatal error LNK1181: cannot open input file 'filedialog.lib'
Build log was saved at "file://c:devAudacitywinProjectsAudacityReleaseBuildLog.htm"
Audacity - 1 error(s), 0 warning(s)
------ Build started: Project: Audacity, Configuration: Debug Win32 ------
Linking...
LINK : fatal error LNK1104: cannot open file 'filedialog.lib'
Build log was saved at "file://c:devAudacitywinProjectsAudacityDebugBuildLog.htm"
Audacity - 1 error(s), 0 warning(s)
------ Build started: Project: Audacity, Configuration: Unicode Debug Win32 ------
Linking...
LINK : fatal error LNK1104: cannot open file 'filedialog.lib'
Build log was saved at "file://c:devAudacitywinProjectsAudacityUnicode DebugBuildLog.htm"
Audacity - 1 error(s), 0 warning(s)
------ Build started: Project: Audacity, Configuration: Unicode Release Win32 ------
Linking...
LINK : fatal error LNK1181: cannot open input file 'filedialog.lib'
Build log was saved at "file://c:devAudacitywinProjectsAudacityUnicode ReleaseBuildLog.htm"
Audacity - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 4 failed, 0 up-to-date, 0 skipped ==========

Dabbler
Posts: 5
Joined: Mon Jun 27, 2011 5:03 pm
Operating System: Please select

Re: error LNK1104: cannot open file 'filedialog.lib'

Post by Dabbler » Wed Jun 29, 2011 11:15 am

I have just remembered, on looking at this again, that filedialog.lib was not built automatically by building the Audacity solution. It was built manually by me firing up the filedialog vc++ project file, after I got the error LNK1104: cannot open file 'filedialog.lib' in the first place, to see if that would help solve the problem. So I was wrong to claim that the Audacity solution created filedialog.lib itself and then could not find it at the linking phase.

The reason it cannot find it, even after I have built it, is that it is located at C:devAudacitywinProjectsfiledialogUnicode Debug, which is not one of the paths the specified in the build log for linking:

Code: Select all

/LIBPATH:"C:devAudacitywinProjectsAudacityUnicode Debug" /LIBPATH:"C:wxWidgets-2.8.11libvc_dll"
In fact I can see that there are dozens of other project directories in C:devAudacitywinProjects, and none of them have been built except filedialog.lib which I built manually. Each of them only contains a vcc++ project file. So the real problem would seem to be that when I try and build the Audacity solution I get from SVN it does not seem to include any of these sub-projects as dependencies, so they never get built, and nor are any LIBPATHs set up for them within the Audacity solution which would permit a successful link phase.

I apologise for the confusion inherent in my original post, and I hope this clarification will lead to a solution.

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: error LNK1104: cannot open file 'filedialog.lib'

Post by Edgar » Wed Jun 29, 2011 5:33 pm

I would suggest that you delete or rename your current SVN HEAD folder, create a new folder, then use SVN Checkout… and start out fresh. Use Batch Build, Select All, and then Build. This will build everything and link those necessary to Audacity. I do this for all four configurations every time a commit is made (other than language files) and I almost never see the link error. When I do see the link error doing a Clean and then Build via Batch Build (after exiting and restarting VC++) always resolve the issue.

If you continue to have this problem you would probably do better to ask on the Audacity Developer mailing list.

Dabbler
Posts: 5
Joined: Mon Jun 27, 2011 5:03 pm
Operating System: Please select

Re: error LNK1104: cannot open file 'filedialog.lib'

Post by Dabbler » Thu Jun 30, 2011 5:09 pm

Thanks Edgar. I have done as you suggest and had more, but not complete, success. One basic mistake I made before was not to notice the audacity solution file in
C:devAudacitywin
and open instead the Audacity project file in
C:devAudacitywinProjectsAudacity
, which was why none of the subsidiary projects would build.

Using the correct solution (rather than project) file, I selected all the projects and did a batch build, and all but one of them
Compiling zh_TW locale
(x the 4 variants) would build. I did a batch clean and did it again, but with the same result. If I repeat the batch build, so that only the reduced error log (the stuff which failed last attempt) appears, I get the following now:
------ Build started: Project: help, Configuration: Release Win32 ------
Performing Pre-Build Event...
606 File(s) copied
Build log was saved at "file://c:devAudacitywinProjectshelpReleaseBuildLog.htm"
help - 0 error(s), 0 warning(s)
------ Build started: Project: help, Configuration: Debug Win32 ------
Performing Pre-Build Event...
606 File(s) copied
Build log was saved at "file://c:devAudacitywinProjectshelpDebugBuildLog.htm"
help - 0 error(s), 0 warning(s)
------ Build started: Project: help, Configuration: Unicode Debug Win32 ------
Performing Pre-Build Event...
606 File(s) copied
Build log was saved at "file://c:devAudacitywinProjectshelpUnicode DebugBuildLog.htm"
help - 0 error(s), 0 warning(s)
------ Build started: Project: help, Configuration: Unicode Release Win32 ------
Performing Pre-Build Event...
606 File(s) copied
Build log was saved at "file://c:devAudacitywinProjectshelpUnicode ReleaseBuildLog.htm"
help - 0 error(s), 0 warning(s)
------ Build started: Project: locale, Configuration: Release Win32 ------
Compiling zh_TW locale
'msgfmt' is not recognized as an internal or external command,
operable program or batch file.
Project : error PRJ0019: A tool returned an error code from "Compiling zh_TW locale"
Build log was saved at "file://c:devAudacitywinProjectslocaleReleaseBuildLog.htm"
locale - 1 error(s), 0 warning(s)
------ Build started: Project: locale, Configuration: Debug Win32 ------
Compiling zh_TW locale
'msgfmt' is not recognized as an internal or external command,
operable program or batch file.
Project : error PRJ0019: A tool returned an error code from "Compiling zh_TW locale"
Build log was saved at "file://c:devAudacitywinProjectslocaleDebugBuildLog.htm"
locale - 1 error(s), 0 warning(s)
------ Build started: Project: locale, Configuration: Unicode Debug Win32 ------
Compiling zh_TW locale
'msgfmt' is not recognized as an internal or external command,
operable program or batch file.
Project : error PRJ0019: A tool returned an error code from "Compiling zh_TW locale"
Build log was saved at "file://c:devAudacitywinProjectslocaleUnicode DebugBuildLog.htm"
locale - 1 error(s), 0 warning(s)
------ Build started: Project: locale, Configuration: Unicode Release Win32 ------
Compiling zh_TW locale
'msgfmt' is not recognized as an internal or external command,
operable program or batch file.
Project : error PRJ0019: A tool returned an error code from "Compiling zh_TW locale"
Build log was saved at "file://c:devAudacitywinProjectslocaleUnicode ReleaseBuildLog.htm"
locale - 1 error(s), 0 warning(s)
========== Build: 4 succeeded, 4 failed, 92 up-to-date, 0 skipped ==========

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: error LNK1104: cannot open file 'filedialog.lib'

Post by Edgar » Thu Jun 30, 2011 8:17 pm

This has been a problem now for a while, look at this forum post http://forum.audacityteam.org/viewtopic ... 19&t=56425--the OP did not ever say if a solution was found.

Also look at the many threads on the Audacity Developer's listserv http://audacity.238276.n2.nabble.com/te ... _TW+locale.

The most recent commit adds to the compile.txt file "Putting msgfmt in C:WindowsSystem32 doesn't work on my 64-bit machine, but C:Windows does." You may need to search out msgfmt and move it to C:\windows.

When I had this error Gale said
" Make sure to build the "locale" project, either
separately or as part of Build > Batch Build. You will need
msgfmt.exe in your PATH for that. Get it from
http://audacityteam.org/files/msgfmt.zip "

For me it ended up being in Python2.6 and it's path.

Dabbler
Posts: 5
Joined: Mon Jun 27, 2011 5:03 pm
Operating System: Please select

Re: error LNK1104: cannot open file 'filedialog.lib'

Post by Dabbler » Mon Jul 04, 2011 9:12 pm

Success.

I went to http://audacityteam.org/files/msgfmt.zip and copied msgfmt.exe to C:\windows as you suggested.
Repeated the batch build, and build was successful this time, but Audacity would not run due to missing wxbase dlls.

Then to get it to run I followed the specific directions in your post
http://forum.audacityteam.org/viewtopic ... 19&t=53826
where you describe the necessary wxbase dlls to copy from wxWidgets over to
AudacitywinDebug,
AudacitywinRelease,
AudacitywinUnicode Debug and
AudacitywinUnicode Release.

In summary, based on my own experience using Windows 7, the following additional steps not documented in http://wiki.audacityteam.org/wiki/Developing_On_Windows

are required:
  • To get wxWidgets to build, set

    Code: Select all

    #define wxUSE_ODBC 1
    in setup.h
  • To get Audacity to build, go to http://audacityteam.org/files/msgfmt.zip and copy msgfmt.exe to C:\windows
  • To get Audacity to run, copy the wxbase dlls from wxWidgets to
AudacitywinDebug,
AudacitywinRelease,
AudacitywinUnicode Debug and
AudacitywinUnicode Release.

Thanks for your help
Last edited by Dabbler on Fri Apr 24, 2015 3:43 pm, edited 2 times in total.
Reason: remove superfluous URL tags and added list tag

Edgar
Forum Crew
Posts: 2043
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: error LNK1104: cannot open file 'filedialog.lib'

Post by Edgar » Tue Jul 05, 2011 12:24 am

Great; now you can help us with bug smashing <grin>! I will look over you comments about the online directions and see if they may be made more clear.

Post Reply