VC9.0 problem creating manifest for makefile

Dear Windows experts,

Since under certain conditions loading my library results in the following dialogbox:

Runtime Error!
Program: c:\Programme\R\R-2.9.0alpha\bin\Rterm.exe
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.

and the following link:
msdn.microsoft.com/en-us/library/ms235560(VS.80.aspx
suggests to create a manifest, I tried to modify the sample in the following link:
msdn.microsoft.com/en-us/library/ms235591.aspx

However, I get the following error:

Makefile.wIn:3: *** missing separator.  Stop.

Do you know what the error may be?

For your info I am attaching the “Makefile.win” and the corresponding files “makefile.inc” and “makefile.targ.inc”.

Thank you in advance
Best regards
Christian
makefile.targ.inc.txt (753 Bytes)
makefile.inc.txt (1.78 KB)
Makefile.win.txt (6.33 KB)

Hi Christian,

Seems to me you are overcomplicating the process…
Did you try to just use the standard way? For your example, it would give something like this:

[code]MT_DLL = mt -nologo -manifest $@.manifest -outputresource:$@;2

[…]

xps.dll: $(MYOBJ)
$(LINK) /dll /def:xps.def /out:xps.dll fp10.obj $(SOFLAGS) $(LDFLAGS) $(GLIBS) *.obj
$(MT_DLL)
[/code]You can also take a look in $ROOTSYS/test/Makefile.win32 how to check for the nmake version:

# Check if nmake version is 8.xx or 9.xx !if ([nmake /? 2>&1 | findstr /c:"Version 8\." > nul ] == 0) || \ ([nmake /? 2>&1 | findstr /c:"Version 9\." > nul ] == 0) MT_EXE = mt -nologo -manifest $@.manifest -outputresource:$@;1 MT_DLL = mt -nologo -manifest $@.manifest -outputresource:$@;2 !else MT_EXE = MT_DLL = !endif
Cheers,
Bertrand.

Dear Bertrand,

Thank you very much, this solved my problem but only when using NMAKE directly.

My main problem is that my library is built from within R using “R CMD build” where all R compiler flags
are set for gnu make, but I am forcing the library to be built with VC9, since it requires root.
Thus, currently this works only when I use the compiler flag /MT, but I get the error mentioned above
when using compiler flag /MD.

Now, I found that I could omit error R6034 by using a manifest (although I must admit that I do not
know what the purpose of the manifest should be).

When I try to use “R CMD build” with option /MD I get the following error:

   Creating library xps.lib and object xps.exp
mt -nologo -manifest xps.dll.manifest -outputresource:xps.dll;2
2: not found
make: *** [xps.dll] Error 127
ERROR: compilation failed for package 'xps'

Trying to use “R CMD build” with option /MT results in following error:

   Creating library xps.lib and object xps.exp
mt -nologo -manifest xps.dll.manifest -outputresource:xps.dll;2

xps.dll.manifest : general error c1010070: Failed to load and parse the manifest
. The system cannot find the file specified.
2: not found
make: *** [xps.dll] Error 127
ERROR: compilation failed for package 'xps'

My initial problem is still the same:
Why is it not possible to compile my package with option /MD?

Best regards
Christian

Hi Christian,

Seems to me you have the error in both cases… or did I miss something?
And sorry, but I don’t know what is “R DMD build”. Maybe you have to put the command in quotes, or double-quotes…(just trying to guess)
But as it works with nmake, this is obviously related to the build environment on top of the nmake command.

Cheers,
Bertrand.

Dear Bertrand,

Yes, I get the error in both cases.

My problem is that I am “stuck in-between two worlds”, the ROOT world and the R world (cran.r-project.org/),
since I have created an “R-package” which contains C++ source code based on ROOT, see:
bioconductor.org/packages/2. … l/xps.html

The R developers gave up support for VC++ long ago, using mainly C compiled with gnu make, even on Windows (where
you need to install MinGW). Thus, there exist only very few packages, which use VC++ to compile the source code.

The usual way to build an R-package for Windows is “R CMD build --binary --docs=“chm” mypackage”, and to install
a package is calling “R CMD INSTALL mypackage.tar.gz”.

Until now I was lucky, that my package can be built on Windows XP with option /MT, however, it seems that on Vista
it is not possible to build my package with either option.

Although this seems to be an R-related problem, the R-developers are not able to help, see:
stat.ethz.ch/pipermail/r-devel/ … 52916.html

Thus my only hope is that maybe one of you may have an idea what I could try to solve this problem.

Best regards
Christian

Hi Christian,

First of all, concerning compilation flags, there is absolutely no difference between XP and Vista.
Then I can try to solve your problem, but first a very basic question: why do you absolutely want to use “R CMD build” and not just call nmake?

Cheers,
Bertrand.