VS compiler does not create inner folders for objects - visual-studio

VS compiler generates the folder where the objects should be created:
OBJS=obj\class_A.obj
obj\class_A.obj : class_A.cpp class_A.h
When generating the above - folder obj is created.
But: In case inner folders are used:
OBJS=obj\INNER\class_A.obj
obj\INNER\class_A.obj : class_A.cpp class_A.h
Trying to build the above, causes error:
fatal error C1083: Cannot open compiler generated file: 'obj\INNER\class_A.obj': No such file or directory
Any ideas?
Is this a VS compiler bug?
This, btw, compiles well with Cygwin.

Related

c++ -- Visual Studio 2010 Linker Error LNK1104: 'cannot open file Debug\AssemblyInfo.obj' [.obj files are not created at compile time]

After a great deal of searching and head banging, i'm asking this question.
I started a new Windows Forms Application in Visual Studio 2010. Gave it a name and stored it in a location. Nothing added or edited in the same. No changes in the project properties either.
Here is a copy of the Solutions Explorer.
I'm building the empty form and I get the following error.
1>------ Build started: Project: TestProject, Configuration: Debug Win32 ------
1>Build started 27/11/2013 1:35:27 PM.
1>InitializeBuildStatus:
1> Touching "Debug\TestProject.unsuccessfulbuild".
1>GenerateTargetFrameworkMonikerAttribute:
1>Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
1>CoreResGen:
1> Processing resource file "Form1.resX" into "Debug\TestProject.Form1.resources".
1>LINK : fatal error LNK1104: cannot open file 'Debug\AssemblyInfo.obj'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.41
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Now I have checked every damn page relevant to the error (6 hrs. of googling!!)
Here is a list of the possible errors as suggested by MSDN. Now I'm new to MSVS 10, so I figure out that the .obj file is not present in the Debug Window, but AssemblyInfo.cpp is present. What should I do in the project settings so that the .obj gets compiled and the error goes away.
Update: Still no answers!! I'm amazed how NOBODY is getting this issue. Here is what I have tried soo far and the following happens:
Opened new Visual C++ Windows Forms Application (no modifications!)
Write ABSOLUTELY NO CODE.
Build Project
And the error occurs.
Next
Opened an old solution, where the .obj files were present.
Made a rebuild of the solution.
Same Error.
I look up the solution in the windows explorer. All .obj files are gone(which should happen as a rebuild would clean the .obj files). But what remains are onlt the .log files.
Thus, I have isolated the error that the compilation is not occuring as the linker files are not being created. As a result, the linker error LNK1104 or LNK1181 happen.
Can somebody tell me why is this problem. Has anyone seen this before. Can anyone provide a solution, if possible??
The compiler says there are not modification in any of the files "Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files." So it'll skip the compilation phase (which generates the .obj files).
But the linker needs these files and for some reason they don't exist (at least that's what you claim is happening).
So you can try to force the compilation by doing a clean and than rebuild.
EDIT:
This particular issue can also be caused by specifying a dependency to a lib file that has spaces in its path. The path needs to be surrounded by quotes for the project to compile correctly.
On the Configuration Properties -> Linker -> Input tab of the project’s properties, there is an Additional Dependencies property.
C:\Program Files\<lib> -> "C:\Program Files\<lib>"
This problem got solved long ago.
1>LINK : fatal error LNK1104: cannot open file 'Debug\AssemblyInfo.obj'
1>
1>Build FAILED.
This was happening because the file Debug\AssemblyInfo.objwas simply not being created. This was due an error in the VS registries.
I did a clean, fresh install of windows and VS. This fixed the registry issues, and the file was being created perfectly.
I hope this helps people. Cheers!
I had a similar problem recently and it turned out to be due to the fact that I'd forgotten to unset /P in my compiler settings. Even though it seems like your problem is distinct, we both got the same error message.
When you preprocess to a file, cl stops producing .obj files.

compiling source files in different directory

I am trying to compile source files from one level up from folder where my source and makefile is present. following is the my directory structure and I have implemented source file..
Directory structure..
project \common\a.c
\platform\win\source
\makefile
Since my source file and make file, both are in win folder so I am trying to compile a.c from win folder
c:\project\platform\win\build -Cez
SOURCE FILE:
DIR=..\ ..\common
SOURCE= \
$(DIR)\a.c
I am getting error "Invalid directory". Can any body suggest me what I am doing wrong or give any clue.
Thanks

gsoap : plug in stlvector

I'm writting hellow-world program using gsoap v 2.8 and trying to compile it in Visual Studio 2010. I want to use stl-vector functionality. But there are import errors in directive
#import "import/stlvector.h"
The error:
error C1083: Cannot open type library file: 'r:\work\vs2010\xmlme\xmlme\import\stlvector.h' Error while loading library r:\work\vs2010\xmlme\xmlme\xmlme.h
And consequence:
IntelliSense: cannot open source file "R:/Work/VS2010/XmlMe/XmlMe/Debug/stlvector.tlh" r:\work\vs2010\xmlme\xmlme\xmlme.h
Cannot figure out what Intellisense wants from me. I copied import folder from gsoap directory to my project and referencing it properly as I think.
my solution archive (link may expire)
UPDATE:
I've tried -s parameter for wsdl2h utility to exclude stl-dependency from xmlme.h file. And now I've similar error:
error C1083: Cannot open type library file: soap12.h: Error while loading library. xmlme\xmlme.h
... producing the same weird consequence:
IntelliSense: cannot open source file "XmlMe/Debug/soap12.tlh" \xmlme\xmlme.h
The thing is to not include XmlMe.h (file generated with wsdl2h.exe tool) in the project. It uses soapcpp2-compliant language (C-based but not C and that's why VS10 compiler generates error when including such a file).
Also you need to include .nsmap file, for e.g. in your main function definition file.

Where can i find the 16F877A.h?

When i run my program in MPLAB. ( Project wizard -> PIC16F877A -> Hi Tech Ansi C Compiler -> RUN )
Error [141] C:\Users\WhyWhy\Desktop\test.c; 1.22 can't open include file "16F877A.h": No such file or directory
Where can i find the header file for the 16F877A?
Chip-specific header files should not be explicitly included in HITECH-C, the documentation clearly states that. Instead, you include the compiler header, which will take care of including the chip-specific file for you:
#include <htc.h>
All you need for this to work is to configure correct chip in the project settings. The 16F877A.h file exists in the compiler directory, but including it directly will throw a warning.
C:\Program Files\HI-TECH Software\PICC\9.70\include
In my case , I have installed HITech Compiler In C:\ Program Files.
You have to know, where have you installed the files of the compiler.
This file is from the compiler, so in your case the Hi Tech you can find here:
C:\Program Files\HI‐TECH Software\PICC\\include\
Before you have found the file you have to add in the Header Files folder in the Project window on MPLAB.
And in your code you have to include it
#include <16F877A.h>

Builds with command line "devenv" but not with Visual Studio (sln) and MSBUild

I'm trying to set up a project with TeamCity and I was wondering what does exactly happen when I choose “Visual Studio (sln)” from the drop down menu under "Runner Type". When I choose this option my project fails to build and I get a bunch of compilation errors like this :
Logging\LoggingSingleton.cpp(19, 0): error C1083: Cannot open include
file: 'Auto/AutoHandle.h': No such file or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\auto\AutoTempFile.h(16,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\auto\AutoTempFolder.h(23,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\logging\McLog2.h(8,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\encryption\McAfeeObfuscation.h(2,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\file\BaseIniReader.h(21,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\file\IniReader.h(21,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\file\BaseIniReader.h(21,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\file\BaseIniReader.h(21,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
However, if I choose “Command Line” as my runner type, and run my solution like : devenv ………../LogReader.sln /Build “Debug” it builds fine with no compilation error. But we don’t want our teams to manually put in the parameters every time, and either build it with MSBuild (gives same errors as Visual Studio sln) or “Visual Studio (sln)”.
You might verify the platform that it is building with, or specify it. We've had similar issues in the past when the project settings were inconsistent across platform, and the platform being built was not the one that was expected. In this case, I would suspect that one platform does not have the same include directories as another.
TeamCity is a build server which has a set of plugin support to perform the more than one type of build process in a very smoother fashion. TeamCity downloads the code from the Source Control application to a working folder and starts the build process. The build process expects the assembly references and libraries as similar to a developer machine. For example, a basic .net application requies the appropriate .net framework to perform the build process. Similarly in your case, the libraries. If you can make the library files available, the build process will run without an issue.

Resources