[Freeswitch-dev] Command-line windows build?

Dmitry Gromov gromovd at gmail.com
Thu Nov 5 23:17:19 PST 2009


That's funny you asking... I just finished test builds of the FreeSwitch
snapshot using Msbuild and nothing more than Platform SDK.
And I haven't seen your email until after I had Debug build succeed. Release
build took a bit more tweaking.

If anyone interested - Platform SDK, starting with version 6.1 (or may be
even 6.0, so not remember) includes non-optimizing C++ compiler, msbuild and
most other tools (but not all) needed to build projects.
Builds Freeswitch.2008.express.sln with PlatformSDK only needs some tweaking
to project files. If you have VS2008 Express or full version, it should be
even easier - just correct one typo and one tweak (I think that should be

So, except obvious fixes, there are two limitations to PlatformSDK build
- bscmake.exe tool is not included, so it is not possible to build .bsc
files - this is just debug info and can be easily turned off
- there is one project which has a requirement for optimization to be turned
on when building in Release mode, so it will be compatible with default
compiler switch (/GS- BufferSecurityCheck), but that can be turned off as

Below are the tweaks I did to project files in order too build with
PlatformSDK. As I said - you may need less tweaking if you have VS
Disclamer - I haven't tried running Freeswitch executables I built, the
results based on successful build results with PlatformSDK 6.1 only.

Also - once I test this and verify all tweaks, I plan to post the info on
the wiki (if there are no objections, of course).

Let's go over the tweaks:

\libs\win32\Download sphinxmodel.2008.vcproj
This file has a typo, preventing build to succeed in release mode,
Look for section
and remove line break (join two lines) like this:

Original file has CrLf in the middle of the URL, preventing file download.

This is not a big issue for most of the people, but it was for me - file
tries to download several files from
And there are at least 3 .exe files it needs. I tried this build from my
work and, obviously, downloading .exe files is blocked on the proxy. And
that's ok - I have no problem, just a recommendation - why not to zip all
those exe files and keep them in the archive? The single file which needs to
be downloaded unpacked is 7za.exe - but it can be kept with some innocent
extension instead and renamed after successful download.
So, I had to download those files manually and place them... where? util.vbs
does not tell where it tries to download files, it only tells the source
url. So I added the following line after the one, which prints source URL:
    Wscript.echo("Downloading: " & URL)
    Wscript.echo("Destination folder: " & DestFolder)
(This needs to be done in two places in that file).

Both this files try to generate .bsc files. In order to disable that, edit
those files, find all occurrences of BrowseInformation attribute and set it
to "0" if it is set to "1"
(You may want to edit only section which will be used for the target you
need - Debug/Release and appropriate platform)

This is only needed for building using PlatformSDK only Release build.
We need to reset setting to treate all warnings as errors to "false"
Look for section:
change to:

Here, mod_spidermonke.dll is generated, as well as export .exp and Import
The thing is that MSBuild creates a copy of original ..vcproj file in order
o use file references instead of component references. This does not affect
DLL, but .exp and .lib files are generated with funky names.
And as the result - .lib file can not be found on the later stage of the
build (it actulally should have worked - it is probably referenced
incorrectly on the dependent project).
To avoid this, we can set attribute to request specific name of the Import
Find config sections you are targeting:
then in section
add this line:


That should do it.

Remember - if you are fixing the above gradually, building project as you go
- you have to be careful and may have to delete obj/lib/etc files which were
built with incorrect settings (especially for WarnAsError changes).

Oh, and to kick-off the build - open CMD shell for SDK - shortcut is
provided in PlatformSDK programs group, navigate to the folder where
Freeswitch.2008.express.sln  is located and run something like this:

msbuild Freeswitch.2008.express.sln /v:d /p:Configuration=Release

(You can replace Release with Debug to build debug target).

This will create detailed Freeswitch.2008.express.log in case you need to
troubleshoot build further.


On Tue, Nov 3, 2009 at 18:00, Josh Rivers <josh at radianttiger.com> wrote:

> I've spent a couple of nights trying to get FS to build on Win32 using
> msbuild against the .sln file. Debug builds seem to fail in spidermonkey,
> and release builds fail in util.vbs. Everything builds fine if I do it in
> Studio, it just doesn't build from the command line.
> Is anybody doing an automated build of FS on windows? If so, are you using
> any tricks to get it compile or am I missing something obvious?
> Thanks,
> Josh
> ps. I see a binary build reference in the Wiki. Is the code to build /
> package that checked in somewhere?
> _______________________________________________
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20091106/231b6109/attachment-0001.html 

More information about the FreeSWITCH-dev mailing list