I am trying to compile this example from for ARM/Windows RT, and I keep getting the following error from my compiler:
1>LINK : fatal error LNK1104: cannot open file 'vccorlibd.lib'
I did a search on my computer and found this lib does exist and it lives in
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib". So I am not sure what is going wrong. Anything would be helpful.
The path to the application contains spaces. Put the path to the lib in double quotes, as per Why does fatal error "LNK1104: cannot open file 'C:\Program.obj'" occur when I compile a C++ project in Visual Studio?.
If that fails, ensure the directory you mention is in the list of lib search directories. See LINK : fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-1_45.lib' for more information.
Related
Question: where do I get and how do I make strsafe.h work with Tiny C Compiler by Bellard.
Here is my Journey with MinGW header files, which is unsuccessful,
as I was unable to make strsafe.h headers of MinGW work with Tiny C Compiler.
The beginnings.
I wanted to run/compile some text-editor project written in C and
suddenly strsafe.h header was missing in the Tiny C Compiler \include folder.
jittey-main>tcc -run main.c
main.c:4: error: include file 'strsafe.h' not found
strsafe.h header seems to not be included in the Tiny C Compiler.
So I tried to download strsafe.h header from mingw project (strsafe.h)
I placed it into the /include folder and suddenly another missing header file poped up.
tcc -run main.c
In file included from main.c:4:
other/strsafe.h:9: error: include file '_mingw_unicode.h' not found
Alright, I tried to find _mingw_unicode.h in the mingw project.
And here I found it:
mingw project (_mingw_unicode.h)
I placed it into /include folder just like before.
tcc -run main.c
In file included from main.c:4:
other/strsafe.h:13: error: include file 'specstrings.h' not found
Once again I was welcomed with another missing header file.
Here it is: mingw project (specstrings.h)
I placed it into /include folder just like before.
tcc -run main.c
In file included from main.c:4:
In file included from other/strsafe.h:13:
other/specstrings.h:12: error: include file 'sal.h' not found
Now this is getting repetitive... Alright It's here.
mingw project (strsafe.h)
I placed it into /include folder just like before.
Last one to resolve? I hope so.
tcc -run main.c
In file included from main.c:4:
In file included from other/strsafe.h:13:
other/specstrings.h:336: error: include file 'driverspecs.h' not found
Here it is: mingw project (driverspecs.h)
I placed it into /include folder just like before.
Slight change in errors. strsafe.h header contains C++ syntax? I'm stuck here.
From this error I guess that strsafe.h header from the MinGW project is not compatible with C89 C99 or C11 languages.
tcc -run main.c
In file included from main.c:4:
other/strsafe.h:131: error: ',' expected (got "dwFlags")
The exact error line can be found here: strsafe.h:131: error
I don't know what to do now.
This is incomplete answer.
Does not answer how to setup TCC with windows-10-sdk.
Location of strsafe.h
I did some research and I've found that strsafe.h is part of windows-10-sdk
The setup file of windows-10-sdk is named winsdksetup.exe
The setup size is unexpectedly small. (1,29 MB)
However, the setup downloads and produces additional (1,86 GB) after installation.
windows-10-sdk gets installed into this directory by default:
C:\Program Files (x86)\Windows Kits\10
After installation of windows-10-sdk
The location of strsafe.h is here:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\strsafe.h
The strsafe.lib file can be found here:
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86\strsafe.lib
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64\strsafe.lib
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\arm64\strsafe.lib
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\arm\strsafe.lib
10.0.19041.0 is a version number of windows-10-sdk.
x86 x64 arm64 arm are the instruction set architectures.
Some additional required .h headers can be found here
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\
Further failure to compile using Windows SDK
I had some trials to compile the previously mentioned text-editor project.
I found some instructions regarding compiling the project
with other compilers rather than Tiny C Compiler
I tried Linking the include .h headers of Windows SDK
tcc main.c "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared"
But it still came out as a failure.
I received the following errors:
jittey-main>tcc main.c "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" "-LC:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86"
In file included from main.c:4:
In file included from c:/users/juozas/desktop/latest-built/include/winapi/windows.h:66:
In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/shared/windef.h:1:
C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/shared/winapifamily.h:226: warning: WINAPI_FAMILY_PARTITION redefined
In file included from main.c:4:
In file included from c:/users/juozas/desktop/latest-built/include/winapi/windows.h:67:
c:/users/juozas/desktop/latest-built/include/winapi/winbase.h:150: error: ';' expected (got "WINBOOL")
I suspect this error might be showing that the windows.h that already exists in Tiny C Compiler and is incompatible with the headers of Windows SDK.
I think Tiny C Compiler requires modified headers of Windows SDK, that could merge well.
Back to MinGW
After installation of Windows SDK and linking the .lib files.
As the same headers problems still occur and persist.
I think setting up TCC with MinGW might be worth a try.
One more suggestion is to re-compile Tiny C Compiler with MinGW headers.
But I'm not sure about that, not sure if it would do anything.
But I might try at some less busy day.
Compiling a file with TCC on windows with a library from C99
my simple c program is not compiling in microsoft visual studio. when i run it, i get a error stating:-
gcc: fatal error: no input files
I used the extension "C Compiler" by brapifra (brapifra.c-compiler) Screenshot of the error
gcc: fatal error: no input files
This tells that you might be in a wrong directory. Just check the path you are providing for the build.
Also, provide more details related to the task file you created
I have the following C file.
#include <stdio.h>
I open an instance of Developer Command Prompt for VS 2017 and type the command.
cl [my-file.c]
I get the following error message
fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory.
I am unsure how to resolve this problem.
The include directories for the current session are stored in the INCLUDE environment variable.
You can view this by typing echo %INCLUDE% on the command prompt.
To add a directory to the include path, use the command set INCLUDE=%INCLUDE%;C:\foo\bar.
The fact, however, that the compiler isn't finding a standard and ubiquitous header like <stdio.h> indicates a serious problem with your Visual Studio installation. I would run a repair install if I were you.
I'm to continue maintenance on several programs called "Legacy Projects". I have a separate Windows XP system for that.
Most of these are VB6 programs. I have one to which I was forced to make changes. Only now it refuses to make the new executable, giving the above error message :
LINK : fatal error LNK1104: cannot open file "C:\Documents And Settings\Me\My Documents\VB6 Projects\Some Directory Path Name\MyProjectDirectory\MyProjectExecutable.exe
I've opened an older version of the project and it compiled and created the executable fine.
Out of frustration, I created a brand new project, moved the source files ( forms, modules and class modules ) over to it, and tried again. It failed. Again. Still.
Why.
I'll take a guess on insufficient information.
PRB: LINK Fatal Error LNK1104 Cannot Open File
Q166470
SYMPTOMS
When compiling an ActiveX component with binary compatibility set to the same file the compile is attempting to overwrite, the following error occurs:
LINK fatal error LNK1104 cannot open file.
RESOLUTION
To work around this problem, copy the ActiveX executable or DLL to a separate directory. Set binary compatibility to the copied file, and
compile to the original directory. This procedure is described in
Microsoft Visual Basic Books Online.
More generally you could have looked up the VC++ linker reference, which all MS languages use.
Linker Tools Error LNK1104 cannot open file "filename"
The tool could not open the given file.
Tips
One of the following may be a cause:
There was not enough disk space.
The file does not exist.
The filename or its path was incorrectly specified.
The specified drive is invalid.
The file does not have the appropriate permissions.
The path for filename expands to more than 260 characters.
If the given file is named LNKn, which is a filename generated by the
linker for a temporary file, then the directory specified in the TMP
environment variable may not exist, or more than one directory is
specified for the TMP environment variable. (Only one directory path
should be specified for the TMP environment variable.)
If the error occurs on the executable filename, an earlier version of
the executable may still be running. You will need to terminate the
executable before linking it. In Windows NT or Windows 95 you can use
the utility PVIEW to look for and kill instances of the application.
PVIEW.EXE is shipped with Visual C++.
If the error message occurs for a library name, and you recently
ported the .MAK file from a previous Microsoft Visual C++ development
system, the library may no longer be valid. Ensure that the library
still exists in this circumstance.
From last few days am trying to build apache version 2.4.20 source code with visual studio 2010 on windows 7 64 bit OS but am getting following errors.
I compiled many times, while compiling am getting different link errors but these are the common errors for every build.
error MSB6003: The specified task executable "CL.exe" could not be run. The process cannot access the file 'C:\httpd-2.4.20\support\Debug\cl.read.1.tlog' because it is being used by another process. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets
error FTK1011: could not create the new file tracking log file: Path(C:\httpd-2.4.20\modules\loggers\Debug\link-cvtres.read.1.tlog). The file exists.
Both errors are coming for different paths(C:\httpd-2.4.20\modules\aaa\Debug\cl.read.1.tlog) etc.
error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\ide\devenv.COM"' : return code '0x1' C:\httpd-2.4.20\NMAKE
error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\nmake.exe"' : return code '0x2' C:\httpd-2.4.20\NMAKE
I don't know why these errors are coming could you please help me to get out from these errors.
Thanks.