Title: Building GhostScript 9.04 Win32
Tags: ghostscript
Question: I want to build GhostScript 9.04 for Win32 and I have read the documentation to do so which details creating your own makefile project.
I was just curious about the &quot;ghostscript.vcproj&quot; I'm finding in the top level directory.  If I convert this to VS2010, I seem to get a good build out of it.
Is there any reason not to use this &quot;ghostscript.vcproj&quot;? The build commandline seems to have some extra stuff in it than what is detailed in the documentation, so I was worried that it might be making some kind of specialized build. See below
```nmake -f psi\msvc32.mak SBR=1 DEVSTUDIO= &amp;&amp; nmake -f psi\msvc32.mak DEVSTUDIO= bsc
```

Comment: [Thanks and other fluff do not belong in posts](https://meta.stackoverflow.com/q/260776/6296561). Refrain from further rollbacks

Here is the accepted answer: You can use the solutions supplied, they are fine and its what we use. If you would rather use nmake and the makefiles then that's fine too, the solutions simply use the makefiles so its sort of the same, just more convenient in some ways if you are using Visual Studio.

The 'extra stuff' is in there to support the visual studio source browser, basically to improve the experience when using Visual Studio, its not essential.

I'll see about updating the documentation in make.htm.


Here is another answer: Sorry to bump a very old topic, but when attempting to compile GhostScript v.9.14.1 with Visual Studio 2015, I get these errors:

```Error U1034 syntax error : separator missing lib.mak (line 51)

Error MSB3073 The command "nmake -f psi\msvc32.mak SBR=1 DEVSTUDIO= debug &amp;&amp; nmake -f psi\msvc32.mak DEVSTUDIO= debugbsc" exited with code 2.   ghostscript C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets
```

Here's the code at line 51 in lib.mak:

```GLLCMS2CC=$(CC_SHARED) $(GCFLAGS) $(I_)$(GLI_) $(II)$(LCMS2SRCDIR)$(D)include$(_I) $(GLF_)
```

Is there any way to remedy this?

Thank you.

PS: Does this project build the DLL? Could we build the DLL ourselves?

Comment for this answer: Unfortunately, even the command line nmake throws the same U1034 syntax error. I'll give v9.2x a try. Any way of getting older versions of VS, perhaps? From what I've read, it could be a make/nmake incompatibility. BTW, I simply launche the .VCPROJ file in the extracted folder and VS2015 did a one-way upgrade; only thing is this nmake error.
Comment for this answer: Once again, thank you, KenS. Amidst a slew of warnings, it compiled and the DLL works. Much appreciated. The reason I was trying the older versions is because they were under the more liberal open source license, and I believe that the later versions fall under stricter distribution regulations. I'd like to distribute the DLL with my closed-source commercial applications.
Comment for this answer: You're right; I did a little reading and distribution with closed-source infringes the GPL licensing terms. I'm a kitchen-table developer and revenues are small, so any sort of licensing fees would not be very affordable. Since I don't actually "distribute" my software through any mass medium, but physically install them in the customers' premises, I suppose that they could download a copy for their own use. Would simply interfacing with an installed copy be considered an infringement, you think?
Comment for this answer: You're right; a lot of grey areas. A friend suggested open-sourcing only the module that requires GhostScript, which converts PostScript files to PDFs. The main application could then remain proprietary, as consuming the generated PDF files does not infringe the terms of the license. I think that's a good trade-off.
Comment for this answer: Update: Wrote in to Artifex, and they confirmed that such a distribution configuration was legally acceptable. So long as any standalone module that utilised GhostScript functionality were distributed under the AGPL (open-source on demand) license, GhostScript (full, part, modified) could be distributed alongside it without issue.
Comment for this answer: Well, it *ought* to work, however, 9.14 is kind of old, the current code is 9.20 and 9.21 will be released in a few weeks. I don't currently have VS 2015 installed, I'm using Team edition 2008 at the moment. You do have all the third party source there ? Including the LCMS2 directory ? You could try using nmake directly on psi/msvc32.mak and see what happens
Comment for this answer: Well, I have used VS2015 Community Edition in the past to build GS (after upgrading the project file) and it worked OK..... I'll see if anyone has a copy installed and can try it.
Comment for this answer: Checking out what U1034 means, it does look like its a bug in nmake, its complaining that there is no ':' between target and dependencies, but this is not a target line, its an assignment
Comment for this answer: According to one of my colleagues the **current** version of Ghostscript imports and builds without problems on VS 2015. We aren't in a position to spend time testing an obselete version though. Things **have** changed since 9.14 and there were some issues (regarding VS 2015) which were fixed after that release. So if you upgrade it should be fine.
Comment for this answer: I don't believe there is any difference between GPL v2 and AGPL v3 (the AFPL licence was a **long** time ago) as regards distribution of the DLL.I'm also reasonably certain that 9.14 was distributed under the same AGPL v3 licence (in fact the change appears to have been around 9.07).  If you do go down the road of distributing the DLL with a closed-source application you are (I believe) skating on very thin ice, I am not a lawyer, but if you are going to use Ghostscript in a commercial application, you should definitely seek a commercial licence in my opinion.
Comment for this answer: I'm afraid that's the point where I'd have to bow out. I **believe** (but if you are worried you should seek competent advice) that the main thrust of the (A)GPL Is that users should be able to replace the open source component with a newer (or possibly different) version. It seems to me that, from a legal standpoint, simply using an installed version is  compliant, since you can just install another version. A number of organisations (some surprisingly large) use this technique to avoid paying for the software they use.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2011:00:12/06/11', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<ghostscript>', 'Title': 'Building GhostScript 9.04 Win32', 'ViewCount': 592, 'id': 8406396, 'user_AboutMe': '', 'user_AccountId': 31314.0, 'user_DisplayName': 'Dan G', 'user_Reputation': 774.0, 'user_Views': 164.0, 'user_id': 85897.0}}