Has anyone been able to build with nmake? This keeps giving an error when "Building RC object src/other/tcl/CMakeFiles/tcl.dir/win/tcl.rc.res".
It works fine when I build a VS solution and then open it with VS IDE and build. But when I make an NMAKE solution with CMAKE and try to run nmake it gives the error.
I can continue this with -I flag to nmake. But then everything that depends on TCL are not built
No, we've not tried an nmake build for a (very) long time. Why do you want nmake as opposed to VS? If you want a command line only build, I'd suggest looking into using ninja build tool on Windows before looking at nmake.
On Ubuntu it took only seconds to build when it has already been built once. Compiling only the changed parts is done in a very short time.
VS is taking a long time for building even after the first build. I thought I might be able to improve if I ran something closer to Ubuntu's CMAKE, MAKE system.
Yeah, I'd try ninja - nmake I don't think is terribly fast
@Sadeep Darshana can you post a more complete build error? It should still work, might be something trivial you can fix.
I got it built.
I had to change several files.
src/other/tcl/CMakeList.txt, src/other/tk/CMakeList.txt, and a deprecated method in a Windows 10 SDk header file.
CMake and NMake run without errors.
I know this is not exactly a fix. Changing Windows 10 SDK headers and outside libraries is not a solution. But would be sufficient for my works.
Btw Archer seems to be broken (it does not start, not error messages,nothing) likely due to the changes to TCL/TK. MGED is fine. I won't be working with TCL/TK.
Cool, @Sadeep Darshana that's great. Can you post a patch of your changes?
You're right that changing a system header isn't an option. Maybe you can figure out a different workaround -- or post the full error here, might have some ideas.
as for archer - check if mged works and if fbhelp works.
Not sure if I should make a patch because I simply removed and edited some stuff from the files. (I'm sure they were there for a reason)
By the way here is what I did.
1) Changed this in tcl CMakeLists file: line 107
if (MSVC)
add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEP -Ot -Oi -fp:strict -Gs -GS -GL -MD)
into
if (MSVC)
add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEP )
2) Changed this in tk CMakeLists file: line 101
I'm building this for x86 to see anything is different. (previously I built for x64)
if (MSVC)
add_definitions(-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -Ot -Oi -fp:strict -Gs -GS -GL -MD -DSUPPORT_CONFIG_EMBEDDED -DHAVE_UXTHEME_H=1)
into
if (MSVC)
add_definitions(-DUNICODE -D_UNICODE )
These 2 changes had to be done because Visual Studio's rc.exe gave an error message saying -Ot is an invalid operator, when I removed -Ot it said -Oi is valid. Then fp:strict was invalid and another error.
3)VS compilor (CL) gave this error "you cannot overload a function with 'extern "C"' linkage." when compiling corecrt_io.h (a windows 10 header).
Removing following lines(:502) from the file fixed it.
_Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_lseek)
_ACRTIMP long __cdecl lseek(
_In_ int _FileHandle,
_In_ long _Offset,
_In_ int _Origin
);
Archer does not work either in x86 or x64. MGED works (I could draw a sphere)
I'm trying to figure out how to operate fbhelp. It displays a Available devices and current selection when run without parameters.
Will reproduce and post exact error messages if necessary.
This is with nmake?
starseeker said:
This is with nmake?
yes
@Sadeep Darshana can you provide the exact output of the rc.exe ? that's odd because it should be the same set of supported options. it's still compiling via msvc
the second response at https://stackoverflow.com/questions/14372706/visual-studio-cant-build-due-to-rc-exe might be a hint if you've installed multiple versions of msvc or a mismatched sdk.
Sean said:
the second response at https://stackoverflow.com/questions/14372706/visual-studio-cant-build-due-to-rc-exe might be a hint if you've installed multiple versions of msvc or a mismatched sdk.
rc.exe runs and exits with a non zero.
I'm reproducing the error
@Sean
C:\gsoc2\brlcad-code\build>nmake
...
...
[ 5%] Building RC object src/other/tcl/CMakeFiles/tcl.dir/win/tcl.rc.res
fatal error RC1106: invalid option: -Ot
NMAKE : fatal error U1077: 'C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
hm, at a glance, I'd say that's because C++ compiler options are being passed to the resource compiler, which is odd because msvc also calls the resource compiler
nmake VERBOSE=1
[ 2%] Building RC object src/other/tcl/CMakeFiles/tcl.dir/win/tcl.rc.res
cd C:\gsoc2\brlcad-code\build\src\other\tcl
C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe -DBUILD_tcl -DGETTOD_NOT_DECLARED=1 -DHAVE_FLOAT_H=1 -DHAVE_GETCWD=1 -DHAVE_INTPTR_T=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MEMORY_H=1 -DHAVE_MKTIME=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_SIZE_T=1 -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UINTPTR_T=1 -DHAVE_ZLIB=1 -DMP_FIXED_CUTOFFS -DMP_NO_STDINT -DMP_PREC=4 -DNO_DIRENT_H=1 -DNO_DLFCN_H=1 -DNO_FSTATFS=1 -DNO_GETTOD=1 -DNO_REALPATH=1 -DNO_UNAME=1 -DNO_WAIT3=1 -DPSAPI_VERSION=1 -DSTDC_HEADERS=1 -DTCL_CFGVAL_ENCODING=\"cp1252\" -DTCL_COMPILE_DEBUG=0 -DTCL_PIPE_DLL=\"tclpip86.dll\" -DTCL_SHLIB_EXT=\".dll\" -DTCL_THREADS=1 -DTCL_TOMMATH=1 -DTCL_UNLOAD_DLLS=1 -DUSE_COMPAT=1 -DUSE_DIRENT2_H=1 -DUSE_THREAD_ALLOC=1 -DZ_PREFIX -DZ_PREFIX_STR=brl_ -D_CRT_NONSTDC_NO_DEP -D_CRT_SECURE_NO_DEPRECATE -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_UNICODE -D_WIN64 -D__CHAR_UNSIGNED__ -D_stati64=_stat64 -Dinline=__inline -Dtcl_EXPORTS -IC:\gsoc2\brlcad-code\build\include\brlcad -IC:\gsoc2\brlcad-code\build\include -IC:\gsoc2\brlcad-code\include -IC:\gsoc2\brlcad-code\src\other\tcl\win -IC:\gsoc2\brlcad-code\src\other\tcl\generic -IC:\gsoc2\brlcad-code\src\other\tcl\libtommath -IC:\gsoc2\brlcad-code\build\src\other\tcl\include -IC:\gsoc2\brlcad-code\src\other\libz -IC:\gsoc2\brlcad-code\build\src\other\libz -DWIN32 -D_DEBUG -Ot -Oi -fp:strict -Gs -GS -GL -MD /fo CMakeFiles\tcl.dir\win\tcl.rc.res C:\gsoc2\brlcad-code\src\other\tcl\win\tcl.rc
fatal error RC1106: invalid option: -Ot
NMAKE : fatal error U1077: 'C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
with verbose
C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe
-DBUILD_tcl
-DGETTOD_NOT_DECLARED=1
-DHAVE_FLOAT_H=1
-DHAVE_GETCWD=1
-DHAVE_INTPTR_T=1
-DHAVE_INTTYPES_H=1
-DHAVE_LIMITS_H=1
-DHAVE_MEMORY_H=1
-DHAVE_MKTIME=1
-DHAVE_SIGNED_CHAR=1
-DHAVE_SIZE_T=1
-DHAVE_STDINT_H=1
-DHAVE_STDLIB_H=1
-DHAVE_STRING_H=1
-DHAVE_SYS_STAT_H=1
-DHAVE_SYS_TYPES_H=1
-DHAVE_UINTPTR_T=1
-DHAVE_ZLIB=1
-DMP_FIXED_CUTOFFS
-DMP_NO_STDINT
-DMP_PREC=4
-DNO_DIRENT_H=1
-DNO_DLFCN_H=1
-DNO_FSTATFS=1
-DNO_GETTOD=1
-DNO_REALPATH=1
-DNO_UNAME=1
-DNO_WAIT3=1
-DPSAPI_VERSION=1
-DSTDC_HEADERS=1
-DTCL_CFGVAL_ENCODING=\"cp1252\"
-DTCL_COMPILE_DEBUG=0
-DTCL_PIPE_DLL=\"tclpip86.dll\"
-DTCL_SHLIB_EXT=\".dll\"
-DTCL_THREADS=1
-DTCL_TOMMATH=1
-DTCL_UNLOAD_DLLS=1
-DUSE_COMPAT=1
-DUSE_DIRENT2_H=1
-DUSE_THREAD_ALLOC=1
-DZ_PREFIX
-DZ_PREFIX_STR=brl_
-D_CRT_NONSTDC_NO_DEP
-D_CRT_SECURE_NO_DEPRECATE
-D_REENTRANT=1
-D_THREAD_SAFE=1
-D_UNICODE
-D_WIN64
-D__CHAR_UNSIGNED__
-D_stati64=_stat64
-Dinline=__inline
-Dtcl_EXPORTS
-IC:\gsoc2\brlcad-code\build\include\brlcad
-IC:\gsoc2\brlcad-code\build\include
-IC:\gsoc2\brlcad-code\include
-IC:\gsoc2\brlcad-code\src\other\tcl\win
-IC:\gsoc2\brlcad-code\src\other\tcl\generic
-IC:\gsoc2\brlcad-code\src\other\tcl\libtommath
-IC:\gsoc2\brlcad-code\build\src\other\tcl\include
-IC:\gsoc2\brlcad-code\src\other\libz
-IC:\gsoc2\brlcad-code\build\src\other\libz
-DWIN32
-D_DEBUG
-Ot
-Oi
-fp:strict
-Gs
-GS
-GL
-MD
/fo
CMakeFiles\tcl.dir\win\tcl.rc.res
C:\gsoc2\brlcad-code\src\other\tcl\win\tcl.rc
These are all the parameters passed to rc.exe @Sean
I looked at the RC_DEFINES, RC_INCLUDES, RC_FLAGS variables. Here are the results. (I split into lines by space for readability)
RC_DEFINES
-DBUILD_tcl
-DGETTOD_NOT_DECLARED=1
-DHAVE_FLOAT_H=1
-DHAVE_GETCWD=1
-DHAVE_INTPTR_T=1
-DHAVE_INTTYPES_H=1
-DHAVE_LIMITS_H=1
-DHAVE_MEMORY_H=1
-DHAVE_MKTIME=1
-DHAVE_SIGNED_CHAR=1
-DHAVE_SIZE_T=1
-DHAVE_STDINT_H=1
-DHAVE_STDLIB_H=1
-DHAVE_STRING_H=1
-DHAVE_SYS_STAT_H=1
-DHAVE_SYS_TYPES_H=1
-DHAVE_UINTPTR_T=1
-DHAVE_ZLIB=1
-DMP_FIXED_CUTOFFS
-DMP_NO_STDINT
-DMP_PREC=4
-DNO_DIRENT_H=1
-DNO_DLFCN_H=1
-DNO_FSTATFS=1
-DNO_GETTOD=1
-DNO_REALPATH=1
-DNO_UNAME=1
-DNO_WAIT3=1
-DPSAPI_VERSION=1
-DSTDC_HEADERS=1
-DTCL_CFGVAL_ENCODING=\"cp1252\"
-DTCL_COMPILE_DEBUG=0
-DTCL_PIPE_DLL=\"tclpip86.dll\"
-DTCL_SHLIB_EXT=\".dll\"
-DTCL_THREADS=1
-DTCL_TOMMATH=1
-DTCL_UNLOAD_DLLS=1
-DUSE_COMPAT=1
-DUSE_DIRENT2_H=1
-DUSE_THREAD_ALLOC=1
-DZ_PREFIX
-DZ_PREFIX_STR=brl_
-D_CRT_NONSTDC_NO_DEP
-D_CRT_SECURE_NO_DEPRECATE
-D_REENTRANT=1
-D_THREAD_SAFE=1
-D_UNICODE
-D_WIN64
-D__CHAR_UNSIGNED__
-D_stati64=_stat64
-Dinline=__inline
-Dtcl_EXPORTS
RC_INCLUDES
-IC:\gsoc2\brlcad-code\build\include\brlcad
-IC:\gsoc2\brlcad-code\build\include
-IC:\gsoc2\brlcad-code\include
-IC:\gsoc2\brlcad-code\src\other\tcl\win
-IC:\gsoc2\brlcad-code\src\other\tcl\generic
-IC:\gsoc2\brlcad-code\src\other\tcl\libtommath
-IC:\gsoc2\brlcad-code\build\src\other\tcl\include
-IC:\gsoc2\brlcad-code\src\other\libz
-IC:\gsoc2\brlcad-code\build\src\other\libz
RC_FLAGS
-DWIN32
-D_DEBUG
-Ot
-Oi
-fp:strict
-Gs
-GS
-GL
-MD
These are the params passed to rc.exe
C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe $(RC_DEFINES) $(RC_INCLUDES) $(RC_FLAGS) /fo CMakeFiles\tcl.dir\win\tcl.rc.res C:\gsoc2\brlcad-code\src\other\tcl\win\tcl.rc
Last updated: Jan 09 2025 at 00:46 UTC