This is very frustrating, I am trying to add the Parse framework but every time I do, my app crashes (even with no code added). I get the following error:
dyld: Library not loaded: #executable_path/../Frameworks/ParseOSX.framework/ParseOSX
Referenced from: /Users/me/Library/Developer/Xcode/DerivedData/Popup-beyvddmmqfabhhghmlsnrvkissfw/Build/Products/Debug/Popup.app/Contents/MacOS/Popup
Reason: image not found
Sounds like it's having problems finding the framework? There have been other people with this problem but I can find no solution short of creating a new project. I'd rather just find another solution before doing that...
You need to add the frameworks to a new copy files build task. Make sure that they end up in the build products folder, and the "copy only on install" checkbox is NOT checked.
Related
Latest:
This is definitely a bug in msbuild. Other than that there cannot be any other explanation. This could only be happening on Linux or possibly on a wider range.
So i decided to just build one single project with absolutely no dependencies on others in the solution.
Looking at the captured diagnostics, I see these lines which are very promising:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
Input files: Annotations.cs;Auth.cs;AuthorizationConfig.cs;Backend.cs;Billing.cs;Code.cs;...
Output files: .obj/TheAgent.dll;.obj/TheAgent.pdb
Set Property: NoWarn=;1701;1702
15:23:27.396 1>Done building target "CoreCompile" in project "TheAgent.csproj".: (TargetId:40)
It looks like my dll and my pdb weren't built which is what I expected.
However, something must be happening before or after causing the timestamp to change (be that of this build time and not the last).
The timestamp of the dll is updated both in the intermediate object folder (.obj/) and also in the output folder.
Is there a known way of stopping msbuild right after its CoreCompile task?
Update:
I decided to search for is newer this time and found instances of these. I don't know how they have got to the solution/project files though:
Input file ".obj/Common.csproj.CoreCompileInputs.cache" is newer than output file ".obj/Common.pdb".
Further to the above, I came across this:
https://github.com/dotnet/project-system/issues/4736
Thinking that this was the issue, I upgraded to dotnet sdk version 2.2.402.
The end result is still the same :(
Original:
I need some pointers on how to troubleshoot this issue. I am using /t:build to build a solution file.
The resulting executable keeps getting refreshed each time.
First i thought the package restore was causing this. I have removed that step however it didn't make a difference.
Then I looked at this:
https://oz-code.com/blog/visual-studio-keeps-rebuilding-projects-no-good-reason/
I'm basically looking for some text in the diagnostics output which tells me if a target or a file is out of date and needs to be rebuilt. The above link talks about "project 'B' is not up to date". I don't have a not up to date in my msbuild output.
I already had two resources with CopyAlways which I changed to CopyIfNewer.
The above article also talks about circular dependencies. I am checking everything manually. And yes the references to dependent project are actually references to the project outputs (dll's /exe's). So Finding a circular dependency by just checking for that pattern seems a little odd.
There was one more problems in the dotnet platform and/or msbuild causing this to fail.
One of those was this https://github.com/dotnet/project-system/issues/4736
Installing SDK 3.0.100-preview7-012821 or better solved the problem
A number of times now the auto generated Swift.h file that's required to use swift code in objective-c is not being found.
I've removed and reinstalled Xcode. Made sure all the correct boxes for it to be generated are checked and that I'm using #objc on Swift classes.
Sometimes it works fine but then there are significant periods where for an unknown reason its no longer able to find that file.
The app does build successfully, but the editor after building claims the file is missing.
The project this is being used in has multiple targets but I've made sure that the Swift.h file is using the same name in all targets.
At this point it seems there is no way to consistently have the file be available for auto completion purposes.
Any suggestions on what else to try would be appreciated as I'm at a loss.
After seeing this issue occur randomly a number of times I discovered that I needed to build all the targets for this app. Doing that meant that the -Swift.h file that was missing was now available.
I had one target that I wasn't building as that app which was part of the project wasn't being actively worked on, but building that was the solution to the problem.
I was trying to use the sha2.c file from polarssl at this link,
https://polarssl.org/sha-256-source-code
I am actually quite a newbie to this, but I was able to get this on Eclipse and when I tried to build it, it gives the error
c:/mingw/x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text+0x3d): undefined reference to `WinMain'
do I have to pass some kind of data in the arguments? how can I find out how to use it?
The problem is not in the source file you downloaded, but the fact that you need to make 'an application'. Eclipse cannot compile 'just some functionality' unless you instruct it to build a library. You will have to provide a WinMain / main function so that Windows knows what to do when you start the application.
That is what the compiler is complaining about, there is no main() functions it can compile into the application!
Easiest way to start is to start a Generic C Application in Eclipse and then add this sha2 source file and header to that project. The Generic C application project already has a main function you can work from..
I created a new VB.net windows applications project and added a reference to my utilities project like I have done many times before. When I start coding, the editor will find the utility namespace without difficulty but when I build I get "Type My.Utils.Data is not defined".
I've compared my project to my other projects and can't find a difference.
When I try to debug, I get a dialog saying "Visual Studio cannot start debugging because the debug target "C:.....\myproject.exe" is missing
You need to make sure that the consuming project is targeting a .NET Framework version which is equal to or higher than the other project that it is referencing. If the referenced project is targeting a higher version of the framework, Visual Studio will not give you a useful message like, "Wrong Framework Version". Instead, it gives you a very confusing error about the assembly being missing, even though it's there.
I ran into this error and had a more unusual root cause. I'll add it here because someone may experience the same. (I don't expect this to be the "normal" cause of this error.) Anyway, I created a service reference and I removed the text "Reference" from the name of it and called it "ServiceName" rather than "ServiceNameReference. Apparently that created a naming conflict that blew up the reference.vb file.
i tried to port the SimpleFTPsample from apple from this IOS project to my OSX project, but when I try to build I get the following error.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_NetworkManager", referenced from:
objc-class-ref in Document-DAE96E3625ECED63.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've searched online, and have been checking all the code I copied twice, all frameworks are added, and the headers included. could somebody please help me to find whats wrong, or even better explain what this means so i can solve it myself in the future? how can i find out what is wrong in the NetworkManager class? i dont get any errors before compiling.
thanks
---EDIT---
forgot to mention that i only need the PUT part of the code in the example, i am only examinating that part. all the rest hasnt been copied over. i copied the NetworkManager.h, NetworkManager.m and copied over the parts of the code that i need from the PUT file.
Usually, when the linker says “what? I've never heard of that class”, it means that the module that implements that class (SomeClass.m) didn't get compiled.
There are two ways that that happens:
Compilation failed
This one would cause an error asking for SomeClass.o (in your case, NetworkManager.o). That's not the error you got, but similar enough that I felt it was worth listing here.
The linker will want an object file, which is produced by a successful compilation. If compilation fails, the object file doesn't exist, so you'll get the “file not found: blah/blah/blah/SomeClass.o” error.
999‰ of compilation failures are because the module contains an error—a syntax error, an unrecognized name (e.g., spelling error/typo), or some other flaw that fails compilation.
Build errors causing other build errors is fairly common, so you should always tackle errors from the top of the list downward.
The solution to this one is to navigate to SomeClass.m and fix everything that's wrong with it, and then try the build again.
You didn't even try to compile it
This is the one you ran into.
Every target has a list of build phases, each describing something that needs to be done to build the target. Most targets have at least Compile Sources and Link Binary with Libraries phases. Every build phase has a list of input files.
The input files for a Compile Sources phase are the module files that Xcode will try to compile. Link Binary with Libraries will implicitly link in everything that the compiler produced—all of the object files—along with the libraries in its list, such as Cocoa.framework.
For each target, Xcode will only try to compile modules that are in that target's Compile Sources build phase.
It's quite possible to forget to add a module to a target but still try to use it in another module within the same target. Maybe you made the module a long time ago for another target, and now want to use that code in the target you're working on now, or maybe you simply forgot to check the box when you created the module or otherwise added it to the project.
Either way, you'll get that error message, telling you that the module whose contents you're trying to use isn't listed for compilation in the target you're trying to use it in.
There are two ways to fix it:
Select or navigate to the “missing” module and show the File Inspector (⌘⌥1), and check the box for the appropriate target under “Target Membership”.
Select the project object in the Project Navigator, select the target within the editor, switch to the Build Phases tab, and drag the “missing” module from the Project Navigator into the Compile Sources build phase.
The way to prevent it is to make sure the relevant targets are checked when you add the module to the project. This includes both creating new modules and adding modules you've obtained from other people (e.g., open source reusable classes).