Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » MSVC make

This thread is locked; no one can reply to it. rss feed Print
MSVC make
Ceagon Xylas
Member #5,495
February 2005
avatar

I feel silly, but here goes anyway. I'm new to MSVC, and I know virtually nothing about makefiles, so I'm pretty lost here. I downloaded the CGUI lib and want to of course compile it for MSVC. (I succeeded in doing so for Mingw)

So here's what my command line look like: (I don't have the executable 'utod', so I specify --quick)
..\CGUI> fix msvc --quick Configuring CGUI for Windows/MSVC... Done! ..\CGUI> nmake Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved. misc/makefile.all(150) : fatal error U1034: syntax error : separator missing Stop.

This seems like a really easy problem to fix, but seeing as I have no clue how to script a makefile, I'm not quite sure what to do.

ixilom
Member #7,167
April 2006
avatar

I haven't used CGUI at all, but could it be that you need to build the library with mingw's make rather than nmake (microsoft) ?
This is the case when you build Allegro for MSVC anyways.

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

Ceagon Xylas
Member #5,495
February 2005
avatar

..\CGUI> mingw32-make Your MSVCDIR or MSDEVDIR environment variable is not set! ..\CGUI> set MSVCDIR="C:\Program Files\Microsoft Visual Studio 8\VC" ..\CGUI> mingw32-make misc/makefile.vc:328: *** multiple target patterns. Stop.

[edit]
Possibly because there are spaces in MSVCDIR?

ixilom
Member #7,167
April 2006
avatar

Hmm, not sure if that error occurs because of the spaces in the MSVCDIR enviroment variable. But you should/must replace it with 8.3 names, like

set MSVCDIR=C:\Progra~1\Micros~1\VC

Notice the number 1 might actually be 2 or 3, depending on how many directories that start with "Microsoft" for example.
It is quite easy to check, open a dos-prompt and type "dir /x" in c:\program files\ and it will reveal which Micros~X belongs to what directory.

Mine looks like this:

2007-02-19 09:41 <DIR> MICROS~3 Microsoft ActiveSync
2007-02-12 16:28 <DIR> MICROS~1.NET Microsoft Visual Studio .NET 2003
2007-03-14 03:12 <DIR> MICROS~4 Microsoft Visual Studio 8
2007-02-12 16:36 <DIR> MICROS~2.NET Microsoft.NET

Again, this is something I've had to do when I build Allegro with mingw's make.

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

Ceagon Xylas
Member #5,495
February 2005
avatar

Ahhh, dir /x! I'll have to remember that.

Well, it... helped... at least changed the output ::)

..\CGUI\> mingw32-make Compiling CGUI for MSVC, optimized. Please wait. obj/msvc/runner.exe cl @ -nologo -DCGUI_SRC -W1 -Gd -Ox -GB -MD -Zm1000 -I./incl ude -Foobj/msvc/cgui/cursdata.obj -c src/cursdata.c cl : Command line warning D9002 : ignoring unknown option '-GB' cursdata.c src/cursdata.c(7) : fatal error C1083: Cannot open include file: 'allegro.h': No such file or directory MAKE: *** [obj/msvc/cgui/cursdata.obj] Error 2

[edit]
So close I can feel it. ;D
Simply it's not finding the <tt>VC\include</tt> directory, correct?

ixilom
Member #7,167
April 2006
avatar

I'm assuming you do have allegro installed in MSVC and working ;D

Did you start your dos-prompt in some other way other than:
start->programs->Microsoft Visual Studio->Visual Studio Tools->Visual Studio Command prompt ?

IIRC, it will not only open a dos-prompt, but set MSVCDIR and something about INCLUDE's aswell, maybe you need those defined in enviroment variables aswell.
Remember, when you start the "command prompt" as they call it, you need to setup the MSVCDIR again with the 8.3 names.

[EDIT]
Forgot, if you dont have mingw path defined systemwide, you will need to setup that manually aswell in the "command prompt" once you started it through the start-menu.
Something like:
set PATH=%PATH%;c:\mingw\bin

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

Ceagon Xylas
Member #5,495
February 2005
avatar

Yep, it's (MSVC) running. Correctly compiles allegro programs and all that goodness.

Quote:

Did you start your dos-prompt in some other way other than:
start->programs->Microsoft Visual Studio->Visual Studio Tools->Visual Studio Command prompt ?

That's what I did wrong ;)

So, it compiles. Lots of warnings and whatnot. Then it lists off a ton of objs and libs, ending with:

LINK : fatal error LNK1181: cannot open input file 'user32.lib'
make: *** [lib/msvc/cgui16.dll] Error 1181

[edit]

Quote:

Forgot, if you dont have mingw path defined systemwide

I do.

[edit 2]
Oh gosh, I don't think I have Microsoft Platform SDK set up properly yet... I should try that first. :P

ixilom
Member #7,167
April 2006
avatar

Hmm... still some issue with the paths.

Check if there are some enviroment variables that need 8.3 fixing by simply typing "SET" in the prompt, it will list all the env-vars. See if any of those seems to point to some visual studio directory and fix it to 8.3 standard.

If that doesn't help, I dunno.. you could make a ugly solution and copy user32.lib from c:\blah\blah\VC\PlatformSDK\Lib\ to the source directory. If that works, I bet there is a heap of other .lib files you need to copy too. But hey, whatever works ;)

[EDIT]
Ah, saw your edit. Yes, you need the PlatformSDK setup ;)

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

Ceagon Xylas
Member #5,495
February 2005
avatar

::)

Set it up, set LIB=C:\PROGRA~1\MICROS~4\LIB;%LIB% (the PlatformSDK lib directory)

And guess what? Now it wants dinput.lib. I'm beginning to think this is an infinite loop of headache...

bamccaig
Member #7,536
July 2006
avatar

In Windows, I didn't bother compiling Allegro myself. I downloaded a binary and installed Allegro that way. Insta-success and I think I was able to compile Allegro programs with no further steps. Note that I had to follow the 'Using Allegro with Visual C++ <version>' project configuration steps in the files section of Allegro.cc to get my project linked and configured correctly.

Is there a particular reason you are trying to compile Allegro in Windows yourself or should a binary installer suit your needs? Note there are prebuilt Windows binaries for versions 6.0, 7.0, 7.1, and 8.0 of M$VS; as well as for MinGW and Borland Builder.

In Linux, I think all I had to do was simply download the Allegro source and cd to it's root directory:

[username pwd]# ./configure
[username pwd]# make
[username pwd]# su make install
Password: <password>

Optionally documentation:

[username pwd]# su make install-man
[username pwd]# su make install-info

Then add the installation directory, which I remember to be usr/local/lib, to the /etc/ld.so.conf file and run ldconfig to reconfigure the ld.so run-time linker:

[username pwd]# su vi /etc/ld.so.conf
[username pwd]# <add usr/local/lib on a newline in file and save the file>
[username pwd]# ldconfig

And I was able to compile a basic 'Allegro program' with the command:

[username pwd]# g++ sourcefilename -o outputfilename `allegro-config --libs`

Noting that ` is the UNshifted ~ key.

Or by using make with the makefile provided with SpeedHack 2006 template since I don't yet know how to write makefiles.

Ceagon Xylas
Member #5,495
February 2005
avatar

:scratches head:

I'm not trying to compile Allegro. I'm trying to compile CGUI.

ixilom
Member #7,167
April 2006
avatar

dinput.lib means it wants DirectX SDK ... aren't library dependencies wonderful ;)

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

bamccaig
Member #7,536
July 2006
avatar

Wow, now I feel stupid. :-[

Well I've been reading through the CGUI ;) installation process and reviewing this thread. One thing that's questionable is where you learned of the --quick option for fix.bat. I haven't found any references to either --quick or utod in the documentation. Reading through fix.bat it looks like the quick option just aborts converting files to the DOS CR/LF format... If that is an option then why convert at all?

:-/

The CGUI documentation seems to claim that Allegro is the only extra dependancy. Are you sure your system is configured correctly?

Matt Smith
Member #783
November 2000

the usual way of setting MSVCDIR is by running VCVARS32.BAT (which is in %MSVCDIR%\bin)

Ceagon Xylas
Member #5,495
February 2005
avatar

Quote:

dinput.lib means it wants DirectX SDK ... aren't library dependencies wonderful ;)

Ugggh...

Quote:

Well I've been reading through the CGUI ;) installation process and reviewing this thread. One thing that's questionable is where you learned of the --quick option for fix.bat. I haven't found any references to either --quick or utod in the documentation. Reading through fix.bat it looks like the quick option just aborts converting files to the DOS CR/LF format... If that is an option then why convert at all?

Well, initally when I tried to run fix msvc it gave me errors saying
'utod' is not recognized as an internal or external command, operable program or batch file.

So I then edited fix.bat and saw that '--quick' skipped over this, as you noted.

Quote:

The CGUI documentation seems to claim that Allegro is the only extra dependancy. Are you sure your system is configured correctly?

No. I really don't know what on earth I'm doing with MSVC :'(

Quote:

the usual way of setting MSVCDIR is by running VCVARS32.BAT (which is in %MSVCDIR%\bin)

Yes, I just found that out, but MSVCDIR or MSDEVDIR are never set. (after I run vcvars32.bat)

[edit]
/switches to MASkinG

Go to: