XCode 4 - linker errors - linker

After having upgraded to XCode 4 im getting some linker warnings that Im a bit baffled about.
My first 2 linker warnings are related to InMobi libraries (an Ads provider).
These warnings are complaining about a Directory that can't be found.
The only thing I can see is that perhaps "Xcode" doesn't like a directory path with a "../" in it.
The "library search paths" look correct.
\"$(SRCROOT)/../AdUtilities/AdProviders/InMobi/iPhone_3.x\"
Note that the SRCRoot (the App folder) is a sibling (the same folder location) as the Adutilities folder. What could be it's problem???
* updated *
I tried providing the full library path, but still same warnings.
* updated 2 *
the ad provider causing the link issues was InMobi.
I removed all references to InMobi, now things are building without warnings.

* Updated *
This was causing more problems that what it was worth. I just removed InMobi as one of my ad providers. now everything builds with errors or warnings.

Related

Imposible to debug one create-react-app, I only see the bundle.js errors

I am launching the create-react-app and if throws me one error, but if I see it on Chrome dev tools it refers to one line in the bundle.js that is generated by webpack by default in create-react-app... So it's not useful for debuging.
Are there any way of that Google Chrome Dev Tools show me the error link line to the original .js file and not to the bundle.js one?
Now I only see this error:
This particular warning will lead you only as far as react-dom.development.js, which is equally useless in my opinion. But if you really want to know what happened, my guess is that you started the production server instead of development.
Either way, the warning is still very revealing and might help you discover the problem even without knowing the exact file. It's telling you that you set the c prop to a boolean on a <div> element (you can know this from the "at div" part of your warning), which is unsupported. This is was most likely a typo or hitting the key accidentally without wanting to type anything, so you might have something like <div c> somewhere.
You can search for this in your project using a regex like \bc\b, or search for a string like c={ in case your mistake was more deliberate.

React application on Safari throws SyntaxError: Invalid regular expression: invalid group specifier name

I've just updated some depencencies in a React project using npm install and the updated project works nicely on all browser except Safari.
On Safari it shows a blanks screen and an error in the console:
SyntaxError: Invalid regular expression: invalid group specifier name
file: 2.f80ba52b.chunk.js
I can exclude breaking changes from updated dependencies, otherwise it would have broken on other browsers too. Despite that, I cannot figure out what is causing it.
Even if similar questions exist, and the root cause has been already recognized as the missing Safari support for lookbehind regex, I would like to provide a general way to handle those situations where, as described in the main question, you can not just fix a line of code - for example when the issue is caused by an external library.
How to handle broken external depencencies
In my case, the bug had been introduced with draft-js-utils 1.4.1, so I solved it downgrading to the first know working version (1.4.0). In order to achieve this, I edited the package.json file changing the dependency line from
"draft-js-utils": "^1.4.0"
to
"draft-js-utils": "1.4.0"
TIP: Avoiding the caret range, you can stick it to a specific version.
How to find broken external depencencies
The only way to find out what dependencies have been affected by this bug is to look for the error message in Github/Gitlab search - currently almost 300 public repositories have a related issue opened.
The hardest thing about this bug is that it could be hidden inside transitive dependencies.
You might not even know you are using that package.
If you are not lucky enough to spot it using a Github/Gitlab search, you could try with a local search using your IDE or grep. You need to look for the lookbehind symbols ?<!:
grep -r "?<\!" node_modules
Being a last resort, this approach could be either very slow or produce a huge-and-hard-to-read output.
A sad note
It looks like Webkit developers are not going to add lookbehind regex support soon - the issue has been created in July 2017 without receiving attention from them. Moreover, even if the Safari's issue has been recognized and tracked, no polyfill exists to fix it at the build level (e.g. using Babel).
I just want to add that I spent a week downgrading Babel and other packages to pre-2018 packages, only to realise that my problem was in a helper function within my own code that was to filter for malicious html code.
#lifeisfoo mentions to grep for the string '?<!' above in node_modules, but i recommend also grepping the entire project.
fyi, my regex that was breaking Safari was '?<=!'. Which is also an unsupported lookbehind
I tested my regex: (?<=![)(.*?)(?=]) in Safaris regex tester https://www.regextester.com/ and the output says 'Lookbehind is not supported in Javascript'
To end, I found Safaris console error message worthless and spread around the 10,000s of lines of the bundle.js, giving the impression that the issue was within the packages/dependancies, which it clearly was not.
I spent ages downgrading the packages only to find the same error message appear on a different line of the bundle.js code.

Why can't I call this C function from my Swift code?

I am trying to call this C library from my Swift code. I dragged the source files into my project and created a module.map file and added the directory containing the module map to Build Settings->Search Paths->Import Paths.
It seems to work. I can import the library and the name even shows up in autocomplete:
And I can access functions from the library and again autocomplete knows they are there:
But when I build, I get this error:
This name, "_mtex2MML_parse", is the same as the name of C function I'm trying to call except prefixed with an underscore.
I've gotten this same error before in similar circumstances trying to get cmark to work, but fixed it there by making sure that the .c file was included in the Target Membership, and then everything was fine. When I fiddled with doing that in this project, I've not had any luck. And in that case, autocomplete didn't even know about the function.
I've tried cleaning, deleting derived data, quitting Xcode, restarting computer, etc. I've tried on Xcode 8.3.3 Swift 3.1 and on Xcode 9b4, Swift 4.0. I'm on macOS 10.12.6. There is no other thing in the project besides this.
Can anyone offer any advice on how to proceed? Thanks.

Wrong WebStorm TypeScript Warning "unresolved variable or type angular"? [duplicate]

I started using Typescript with Webstorm today and I am getting real crazy understanding what's going on. Imagine a project using tsd loading definition types on typings/. For background, angular defines an angular module aliased to ng and then there is other d.ts files appending more modules into angular (and technically ng).
When I require for example the router I get:
In fact, if you go to angular-route.d.ts (from DefinitelyTyped) you can see the same:
The d.ts files are technically correct because tsc compiles them giving it those definition files.
On the other hand, Webstorm allows you to load libraries (typescript stubs from DefinitelyTyped). If I go there and I download the angular ones (which are 100% the same as the one I have on typings/) I get:
Same error but at least I don't get the red wiggle in the solution explorer. Still, it doesn't give me any intellisense when writing ng.route.<ctrl+space>, it just turn blue when I finish writing it (in fact, I can cmd+click and go to the definition).
Who's failing here? The typescript plugin? It is weird that it fails using typings/ and somehow work with Webstorm's libraries menu (using the same file).
Who's failing here? The typescript plugin?
Yes. You need to use the Webstorm beta channel to get support for TypeScript 1.4 union Types at the moment.

Code composer inline function linker error

I am working with Code Composer Studio and I need to inline some functions.
So I put them in a header file (or in .inl file referred by a header, both ways) and try to build my project.
The problem comes when I increase the optimization level. The project builds successfully under no optimization, (off or none) but the linker fails to link them and returns:
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking;
Has anyone encountered similar issues?
Is is because am not utilizing some kind of flag in the compiler options?
Please check this link http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/249183.aspx .
When SW_ROOT was correctly defined, this issue was resolved.

Resources