More than one source in Visual Studio Code project - task

How does my task.json look like when I have more than one source. In a makefile I would put a a create-line for each source and a linker line to create the whole project. How does this look like in VSC. And what about debugging (launch.json)?

Related

Qt5.5 qmake don't generate proper .pro file

Currently, I'm using Qt5.5 with Visual Studio 2015.
After making UI files, I want to make a .pro file using the command "qmake -project" (VS2015 environment is set). And the .pro file is generated.
After that I pass "qmake -tp vc qtexample.pro " to create visual studio project. The project is created without problem.
When I'm trying to build the project, it shows me a lot of linking errors. After googling the problem, I found a solution - to add this line "QT += core gui widgets" in the .pro file.
So, my question is: Why didn't qmake write that line in the .pro file? What's wrong here? Should I always add manually this line in the .pro file? Is there any way to avoid manually adding the line?
core and gui are added by default, however, widgets is not. This info is clearly stated in the documentation.

link obj files in embarcadero c++ builder Dunit Test Project

I'have added a test case to DUnit Test project in embarcadero c++ builder 2010. I can compile it fine but the linker fails saying "unresolved external" to a method in an .obj file from original project. If I add the .obj file to DUnit project it works fine. However I don't want to do it as there are huge number of .obj files in the original project and it will be a pain to add .obj files each time you want to test a new class. Is there a way to point the linker to search directories to look in for .obj files and get them from there. ( I'm not using the command line, but the c++ builder 2010 IDE).
If you go into Project Properties you can configure the directories that are searched for includes, libraries, etc. You can do this by build type or for all configurations.
However it's usually a bad idea to directly link other .obj files from a different project, as they may have been compiled with different settings . Why don't you just add your test case to the project without deleting anything from it?

Xamarin Studio Starter: Why am I getting native library reference error on build without native libraries?

I've been playing around with the Starter Edition of Xamarin Studio to determine if it will meet my needs. I understand (so I thought) the limitations of this edition; 32K compiled IL limit, no native libraries, etc. Now, I understand native libraries to be C/C++ libraries, or even native Java libraries. This does not seem to be the case.
I have a solution in Xamarin Studio with 2 projects. One is an Android Class Library, the other is an Android Application. When I reference the class library from the application project and build, I get the following error.
Your app references native libraries. This functionality requires Indie Edition or higher.
I beg to differ! Every .cs file in the referenced Android class library project is simple .NET code. What am I missing? I can successfully run the Tasky Android_Starter solution without issue, and it is made up of 2 projects like mine.
I had to delete the Resources folder and manually edit the Android class library project file in order to get this working. I looked at the Tasky sample's project file as a reference.
After deleting the auto-included Resources folder from the project, edit the .csproj file in a text editor to remove the following XML elements:
Project\ProjectGroup\AndroidResgenFile
Project\ProjectGroup\AndroidResgenClass
With those things taken care of, I no longer get the error. I'm guessing, Xamarin Studio thought I was referencing another Android application instead of a class library. Not sure why the default project template includes things to break such a flow, but perhaps I'm not "doing" right" either. Go figure.
Deleting the Resources folder and manually editing the csproj file didn't work for me. I had to create a new C# Library project instead of creating an Android Library Project and import my .cs files into that. After that it compiled and ran fine.

No symbols/source for external library in Xcode 4

My application is not seeing source code for a library:
If I "Jump to definition" on a library method, XCode takes me to the .h file but says there is no .cpp counterpart
When debugging, I see no source code and most of the call-stack is missing for the library:
I have made sure "Show disassembly when debugging" is UNchecked
I built the library as DEBUG and then packaged up the headers+.a file into a SDK dir. So I guess I need to either copy the debug files into that SDK dir as well, or tell my application where to look. I'm not sure how to do either.
To clarify, my application project doesn't maintain a reference to the library project, only to the .a files and the header dirs. This is because the library project is created by CMake and I don't want to modify it.
First of all, you should check the .debug_str section of your static library to verify it contains the appropriate debug information.
Try running this command on the terminal:
xcrun dwarfdump /path/to/library.a | grep "\.m"
You should see a bunch of your source (.m) file paths printed out. Theoretically, this is where Xcode is going to look when you stop in the debugger, so make sure the paths here are correct. If you don't see any paths, you will need to pass an appropriate debug flag (e.g. -g to the compiler when building your library.
If the paths are somehow incorrect, or you want to point them to some other location, you may be able to modify them as part of the build process in CMake, for example to make them relative to your project directory. Try looking at "Make gcc put relative filenames in debug information", which uses CMake to adjust these debug paths.

Why are libraries added to linker command line twice?

I have a Visual C++ 2003 project which depends on a 3rd party static library. My visual c++ project also compiles to a static library. I have referenced the 3rd party library from my project by editing the project properties, adding the 3rd party library's directory to the Additional Library Directories (e.g. ./LibDir) and the library's name to the Additional Dependencies (e.g. 3rdParty.lib).
On my machine this works as I expected, adding this to the linker command line:
/LIBPATH:"LibDir" 3rdParty.lib
On my colleague's machine it adds this to the linker command line:
/LIBPATH:"LibDir" 3rdParty.lib "LibDir\3rdParty.lib"
This causes the 3rd party library to be linked twice, resulting in lots of errors and warnings.
This problem isn't specific to this library - it seems that whichever 3rd party library we try to include in this way on my colleague's machine ends up being added to the command line twice.
What is causing the difference in behaviour between his machine and mine?
UPDATE:
I've now tested this on a third machine, which demonstrated the same behaviour as my colleague's machine, i.e. referencing an additional dependency causes it to be added twice to the linker command line (this difference happens when I open the exact same project files on each machine).
The only difference I can think of between my machine and the other two, is that I installed VC++ 2003 on my machine a couple of years ago and on the other two machines this week.
Also, it seems that this only happens if my project is compiled to a library - if it is compiled to an exe the 3rd party library only gets added to the linker command line once.
Any ideas...?
Check is there any unnecessary inheritance of dependencies in Your friends project in Additional directories.
Try to exclude Your 3rdParty.lib,
check is there any $(ProjDir) or any simmilar additional, differences in the properties.
Could You post Your command line from compiler/linker (this could be found in properites).
I had the same problem and moved the included libraries to a directory structure that didn't have any spaces in it. It worked fine then.

Resources