PDA

View Full Version : nmake problems while building mysql driver



MarkoSan
19th March 2007, 19:09
Hi to all!

Did someone meet with following pitfall: I am developing an mysql based application and I need mysql driver. So I tried to built it with:



qmake -o Makefile "INCLUDEPATH+=c:\Program Files\MySQL\MySQL Server 5.0\include" "LIBS+=c:\Program Files\MySQL\MySQL Server 5.0\lib\opt\libmysql.lib" mysql.pro
qmake does not report any error, however, on



nmake
i get:



Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.

NMAKE : fatal error U1065: invalid option '-'
Stop.

e8johan
19th March 2007, 19:17
Have you tried using this step-by-step guide?

http://wiki.qtcentre.org/index.php?title=Building_the_QMYSQL_plugin_on_Wind ows_using_MinGW

MarkoSan
19th March 2007, 19:21
Have you tried using this step-by-step guide?

http://wiki.qtcentre.org/index.php?title=Building_the_QMYSQL_plugin_on_Wind ows_using_MinGW


In my signature it states i use Visual Studio 2005 and not MinGW.

MarkoSan
21st March 2007, 06:40
I found out if I enter in command shell (qt command shell with all paths) I get:



Setting up a Qt environment...
-- QTDIR set to C:\Qt\4.2.1
-- Added C:\Qt\4.2.1\bin to PATH
-- QMAKESPEC set to win32-msvc2005
Setting environment for using Microsoft Visual Studio 2005 x86 tools.
C:\Qt\4.2.1>nmake

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.

NMAKE : fatal error U1065: invalid option '-'
Stop.

C:\Qt\4.2.1>


Does anyone have a clue if this is normal nmake operation or not? Is maybe nmake buggy? I've installed Service Pack 1 and that patch for compiling qt app.

wysota
21st March 2007, 11:54
Did you configure Qt for your compiler?

MarkoSan
21st March 2007, 12:16
I've installed it and everything works fine, application compiles without problem!

But if I run configure it also fails with same error, I really do not have any clue what the hell is going on!!

wysota
21st March 2007, 13:18
Different things may be wrong. Qt can be configured for a different compiler, for example, so that Makefiles generated by qmake are for a different infrastructure - that's why I asked if have you configured Qt for your compiler.

MarkoSan
21st March 2007, 13:23
I've installed qt and if qt weren't configured for my compiler, my application simply would not have compile at all. The problem is, if I run nmake solo, without anything, I get same error as if I run configure or start build process of mysql driver.

wysota
21st March 2007, 21:10
I've installed qt and if qt weren't configured for my compiler, my application simply would not have compile at all.
I'm talking about the sources, not the binaries.


The problem is, if I run nmake solo, without anything, I get same error as if I run configure or start build process of mysql driver.

So please tell me did you configure the sources for msvc 2005? As far as I remember the "-platform win32-msvc2005" (or something like that) switch may be required if Qt can't determine your configuration on its own. Also please try running "qmake" before running nmake, maybe it just needs to regenerate some Makefile. Did you by any chance modified any of the project files?

MarkoSan
22nd March 2007, 13:54
I'm talking about the sources, not the binaries.



So please tell me did you configure the sources for msvc 2005? As far as I remember the "-platform win32-msvc2005" (or something like that) switch may be required if Qt can't determine your configuration on its own. Also please try running "qmake" before running nmake, maybe it just needs to regenerate some Makefile. Did you by any chance modified any of the project files?

Listen, if I run nmake in the directory where no makefiles are I still get same error. I cannot recompile sources because configure exists with same error!

wysota
22nd March 2007, 13:56
What happens if you create a Makefile with the following contents:

all:
<tabulator here>echo "blabla"
<empty line here>

and run nmake?

MarkoSan
22nd March 2007, 14:07
I still get:



Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.

NMAKE : fatal error U1065: invalid option '-'
Stop.


I think nmake gets fucked up by applying that KB930859. Becuase there is a problem compiling qt apps with Visual Studio 2005 Service Pack 1. After I applied this KB930859 on Service Pack 1 my nmake got fucked up! I contaced MS but still no answer!!!!

wysota
22nd March 2007, 17:31
I doubt the patch did anything to your nmake. The problem concerned the compiler, not the make tool.

MarkoSan
24th March 2007, 18:50
But make is part of compiler, isn't it?

wysota
24th March 2007, 20:44
No. It's shipped with it, but not part of it, so I doubt the patch even touched it

MarkoSan
25th March 2007, 19:44
Does anyone have any idea how to check the correctness of nmake?

wysota
25th March 2007, 20:52
Run nmake in a directory that doesn't have a Makefile. It should complain about it.

MarkoSan
25th March 2007, 21:24
I did, same error reported!!

wysota
26th March 2007, 00:19
nmake seems fine. The error you get is not unusual.

http://www.cygwin.com/ml/cygwin/1999-10/msg00311.html

What is unusual is that nmake manages to find a makefile when it's not there. Could you check if the nmake you call is really a nmake binary and not some script? Because it behaves like it was accessing the same faulty makefile all the time. You might need to adjust your %PATH% to make sure the proper nmake is used.

Could you also verify that nmake /HELP returns a list of options and not the error you're battling with? Also please try running nmake with the "/R" option - if your tools.ini is broken, using this option should make nmake work by ignoring all configuration from tools.ini.

See this for referece: http://msdn2.microsoft.com/en-us/library/afyyse50(VS.80).aspx

MarkoSan
26th March 2007, 11:58
I ran:



dir /s \nmake.*
to find all nmakes installed on my computer. I got this listing:



Volume in drive C is Lokalni disk
Volume Serial Number is 808B-2D12

Directory of C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin

02.12.2006 07:17 82.696 nmake.exe
1 File(s) 82.696 bytes

Directory of C:\Program Files\Microsoft Visual Studio 8\VC\bin

02.12.2006 07:17 82.696 nmake.exe
1 File(s) 82.696 bytes

Directory of C:\Program Files\Microsoft Visual Studio 8\VC\bin\amd64

02.12.2006 07:20 100.616 nmake.exe
1 File(s) 100.616 bytes

Directory of C:\WINXP\Prefetch

26.03.2007 00:56 7.490 NMAKE.EXE-08101E42.pf
1 File(s) 7.490 bytes

Total Files Listed:
4 File(s) 273.498 bytes
0 Dir(s) 3.870.904.320 bytes free
The path is set up as follows:



C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINXP\Microsoft.NET\Framework\v2 .0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;C:\Qt\4.2.1\bin;;C:\WINXP\system32 ;C:\WINXP;C:\WINXP\System32\Wbem;C:\Program Files\Subversion\bin;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\MySQL\MySQL Server 5.0\bin
I tried to run both 32bit versions of nmake from dir that has makefile and from dir that does not have makefile and i still get same errors!

If I try to pass to nmake some paramaters, I still get same error, which is very very weird!

luf
26th March 2007, 12:52
Hi

Can you please attach your Makefile? Seems like there is something wrong in it.
I would recommend moving your SQL libs to somewhere withouth long filenames or at least somewhere without spaces in the filenames or folders.

the "-" error is likely to be a typo in the makefile.

When running nmake in a dir without a makefile, you should get:


Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.

NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.


If you get something else, make sure you have started the Visual Studio Command Prompt, so that all vars is correct. If this still gives you the other error with the -, try reinstalling visual studio.

If there is no makefile in the dir, you should get that error instead of the - error.

Cheers,
Leif

MarkoSan
26th March 2007, 13:23
Ok, here is makefile:



################################################## ###########################
# Makefile for building: qsqlmysql
# Generated by qmake (2.01a) (Qt 4.2.3) on: pet 23. mar 17:31:15 2007
# Project: mysql.pro
# Template: lib
# Command: qmake -win32 "INCLUDEPATH+=c:\Program Files\MySQL\MySQL Server 5.0\include" "LIBS+=c:\Program Files\MySQL\MySQL Server 5.0\lib\opt\libmysql.lib" -o Makefile mysql.pro
################################################## ###########################

first: all
install: debug-install release-install
uninstall: debug-uninstall release-uninstall
MAKEFILE = Makefile
QMAKE = qmake
DEL_FILE = del
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
COPY = copy /y
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
DEL_FILE = del
SYMLINK =
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
SUBTARGETS = \
debug \
release

debug: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug
debug-make_default: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug
debug-make_first: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug first
debug-all: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug all
debug-clean: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug clean
debug-distclean: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug distclean
debug-install: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug install
debug-uninstall: $(MAKEFILE).Debug FORCE
$(MAKE) -f $(MAKEFILE).Debug uninstall
release: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release
release-make_default: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release
release-make_first: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release first
release-all: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release all
release-clean: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release clean
release-distclean: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release distclean
release-install: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release install
release-uninstall: $(MAKEFILE).Release FORCE
$(MAKE) -f $(MAKEFILE).Release uninstall

Makefile: mysql.pro ..\..\..\..\.qmake.cache ..\..\..\..\mkspecs\win32-g++\qmake.conf ..\..\..\..\mkspecs\features\exclusive_builds.prf \
..\..\..\..\mkspecs\features\default_pre.prf \
..\..\..\..\mkspecs\features\win32\default_pre.prf \
C:/Qt/4.2.3/.qmake.cache \
C:/Qt/4.2.3/mkspecs/qconfig.pri \
..\..\..\..\mkspecs\features\qt_functions.prf \
..\..\..\..\mkspecs\features\qt_config.prf \
..\..\..\qt_targets.pri \
..\..\qpluginbase.pri \
..\qsqldriverbase.pri \
..\..\..\..\mkspecs\features\debug.prf \
..\..\..\..\mkspecs\features\debug_and_release.prf \
..\..\..\..\mkspecs\features\default_post.prf \
..\..\..\..\mkspecs\features\qt.prf \
..\..\..\..\mkspecs\features\win32\thread.prf \
..\..\..\..\mkspecs\features\moc.prf \
..\..\..\..\mkspecs\features\win32\rtti.prf \
..\..\..\..\mkspecs\features\win32\exceptions.prf \
..\..\..\..\mkspecs\features\win32\stl.prf \
..\..\..\..\mkspecs\features\shared.prf \
..\..\..\..\mkspecs\features\dll.prf \
..\..\..\..\mkspecs\features\warn_on.prf \
..\..\..\..\mkspecs\features\win32\windows.prf \
..\..\..\..\mkspecs\features\resources.prf \
..\..\..\..\mkspecs\features\uic.prf
$(QMAKE) -win32 "INCLUDEPATH+=c:\Program Files\MySQL\MySQL Server 5.0\include" "LIBS+=c:\Program Files\MySQL\MySQL Server 5.0\lib\opt\libmysql.lib" -o Makefile mysql.pro
..\..\..\..\mkspecs\features\exclusive_builds.prf:
..\..\..\..\mkspecs\features\default_pre.prf:
..\..\..\..\mkspecs\features\win32\default_pre.prf :
C:/Qt/4.2.3/.qmake.cache:
C:/Qt/4.2.3/mkspecs/qconfig.pri:
..\..\..\..\mkspecs\features\qt_functions.prf:
..\..\..\..\mkspecs\features\qt_config.prf:
..\..\..\qt_targets.pri:
..\..\qpluginbase.pri:
..\qsqldriverbase.pri:
..\..\..\..\mkspecs\features\debug.prf:
..\..\..\..\mkspecs\features\debug_and_release.prf :
..\..\..\..\mkspecs\features\default_post.prf:
..\..\..\..\mkspecs\features\qt.prf:
..\..\..\..\mkspecs\features\win32\thread.prf:
..\..\..\..\mkspecs\features\moc.prf:
..\..\..\..\mkspecs\features\win32\rtti.prf:
..\..\..\..\mkspecs\features\win32\exceptions.prf:
..\..\..\..\mkspecs\features\win32\stl.prf:
..\..\..\..\mkspecs\features\shared.prf:
..\..\..\..\mkspecs\features\dll.prf:
..\..\..\..\mkspecs\features\warn_on.prf:
..\..\..\..\mkspecs\features\win32\windows.prf:
..\..\..\..\mkspecs\features\resources.prf:
..\..\..\..\mkspecs\features\uic.prf:
qmake: qmake_all FORCE
@$(QMAKE) -win32 "INCLUDEPATH+=c:\Program Files\MySQL\MySQL Server 5.0\include" "LIBS+=c:\Program Files\MySQL\MySQL Server 5.0\lib\opt\libmysql.lib" -o Makefile mysql.pro

qmake_all: FORCE

make_default: debug-make_default release-make_default FORCE
make_first: debug-make_first release-make_first FORCE
all: debug-all release-all FORCE
clean: debug-clean release-clean FORCE
-$(DEL_FILE) c:\Qt\4.2.3\plugins\sqldrivers\libqsqlmysql.a
distclean: debug-distclean release-distclean FORCE
-$(DEL_FILE) Makefile

debug-mocclean: $(MAKEFILE).Debug
$(MAKE) -f $(MAKEFILE).Debug mocclean
release-mocclean: $(MAKEFILE).Release
$(MAKE) -f $(MAKEFILE).Release mocclean
mocclean: debug-mocclean release-mocclean

debug-mocables: $(MAKEFILE).Debug
$(MAKE) -f $(MAKEFILE).Debug mocables
release-mocables: $(MAKEFILE).Release
$(MAKE) -f $(MAKEFILE).Release mocables
mocables: debug-mocables release-mocables
FORCE:

$(MAKEFILE).Debug: Makefile
$(MAKEFILE).Release: Makefile


I've also attached same file

wysota
26th March 2007, 15:03
If I try to pass to nmake some paramaters, I still get same error, which is very very weird!

What parameters? The ones I asked you to try?

MarkoSan
26th March 2007, 16:44
What parameters? The ones I asked you to try?

I tried:


nmake /?



nmake /help
and still same error.

wysota
26th March 2007, 20:18
what about nmake /R?

MarkoSan
26th March 2007, 20:26
Same shit, i am desperate!

wysota
26th March 2007, 21:17
I second the idea of reinstalling VS then :)

MarkoSan
25th May 2007, 13:57
Well, we solved problem together with Microsoft!

I had MAKEFLAGS flags pointing to QNX Neutrino makefile settings and after I cleared MAKEFLAGS, compilation of drivers was sucessfull!!!!