Duplicate symbol show with Xcode8 - duplicates

my project running was fine yesterday, but after update Xcode8, same project can't build with this error:
libUMSCashierPlugin.a
I have try lipo and ar, nothing working, and when I build with Xcode7.3.1, nothing happen, no warning, no error. How can I fix it?

code recommended to use warning flags and set GCC_NO_COMMON_BLOCKS to YES.
Setting it back to NO solved the problem!

I declared "static const" for variable instead of "const"
You may use const variable like below.
NSString *const OPERATECODE_GET_AID = #"{SOMETHING}";
I recommend to change like this.
static NSString *const OPERATECODE_GET_AID = #"{SOMETHING}";

Related

unable to unrar when the syntax built from function

I work in google colab, I've got an error with this code...
I have so many rar files, and I need to unpack them, those are in different path and I made a function in to simplify my work. I made variables those are changeable so I can replace the path to something else, unfortunately the result says No file extracted or asking me a password even I have true password it doesn't wanna stop asking
type hereaddress = "/content/temporary/myfile.rar"
foldestny = "/content/hasilekstrak"
ps ="pass2345"
def rara(adrs, fdstn, pswrd):
!unrar x "$adrs" "$dstn" "-p$psward"
rara(address, foldestny, ps)
however if I type the code in singgle line, it will work.
why does this happen?
I hope I can make a function to extract anything when I need, so simple by typing variables

Invalid method when method is valid

I have just started a new version of my Crysis Wars Server Side Modification called InfinityX. For better management, I have put the functions inside tables as it looks neater and I can group functions together (like Core.PlayerHandle:GetIp(player)), but I have ran into a problem.
The problem is that the specified method to get the players' name, player:GetName() is being seen as an invalid method, when the method actually is completely valid.
I would like to know if using the below structure is causing a problem and if so, how to fix it. This is the first time I've used this structure for functions, but it is already proving easier than the old method I was using.
The Code:
Event =
{
PlayerConnect = function(player)
Msg.All:CenteredConsole("$4Event$8 (Connect)$9: $3"..player:GetName().." on channel "..player.actor:GetChannel());
System.LogAlways(Default.Tag.."Incoming Connect on Channel "..player.actor:GetChannel());
Event:Log("Connect", player);
end;
};
The below code works when I bypass the function and put the code directly where it's needed:
Msg.All:CenteredConsole("$4Event$8 (Connect)$9: $3"..player:GetName().." on channel "..player.actor:GetChannel());
System.LogAlways(Default.Tag.."Incoming Connect on Channel "..player.actor:GetChannel());
The Error:
[Warning] [Lua Error] infinityx/main/core.events.lua:23: attempt to call method 'GetName' (a nil value)
PlayerConnect, (infinityx/main/core.events.lua: 23)
ConnectScript, (infinityx/main/core.main.lua: 52)
OnClientEnteredGame, (scripts/gamerules/instantaction.lua: 511)
(null) (scripts/gamerules/teaminstantaction.lua: 520)
Any clarification would be appreciated.
Thanks :)
Well, as PlayerConnect is inside the table Event, and you are calling with a ":", add self as first arg in the function, like:
PlayerConnect = function(self, player)
Clearly, player in the first block of code is not the same as player in the second block of code. The problem must be that the caller of Event.PlayerConnect is not passing the same value.
To test that your Event.PlayerConnect function works, try this in the same place as your second block of code:
Event.PlayerConnect(player)
That should work as you expect.
So, the problem comes down to how Event.PlayerConnect is called without the second block of code. I'm not familiar with that game engine so I don't know how it is done. Perhaps reviewing the documentation and/or debugging that area would help. If you print(player) or call the equivalent log function in both cases, you should see they are different. If you can't run in a debugger, you can still get a stack trace with print(debug.traceback("Accessing player, who's value is: "..player)). If there is indeed some kind of table-based player object in both cases, you can try comparing their fields to see how they are different. You might need to write a simple dumping function to help with that.

What are the ramifications of duplicate variable definitions?

I have code that looks like this:
var variableX:uint = something;
if (variableX > 1)
{
var variableY:uint = foo;
}
else
{
var variableY:uint = bar;
}
When compiled in FlashDevelop, the compiler gives the following warning:
Warning: Duplicate variable definition.
Being a beginner with AS3 and programming I don't like compiler warnings. The compiler is looking at me through squinted eyes and saying "Ok, buddy, I'll let you off this time. But I'm warning you!" and then doesn't tell me what's so wrong about what I'm doing.
What should I be aware of when I do something like this? I mean I could obviously define the variable outside of if and then this wouldn't be a problem, but maybe there's something more to this? Or is the compiler just giving a helpful nudge saying "hey, you might have accidentally created two different variables with the same name" ?
You're correct in your assessment of the warning. It's just letting you know there was already a variable in scope with that name and that you're about to redefine it. This way you don't accidentally overwrite a variable. Although they may not appear to be in the same scope if you check out variable hoisting on this page you'll see what the deal is: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7f9d.html
An interesting implication of the lack of block-level scope is that
you can read or write to a variable before it is declared, as long as
it is declared before the function ends. This is because of a
technique called hoisting , which means that the compiler moves all
variable declarations to the top of the function. For example, the
following code compiles even though the initial trace() function for
the num variable happens before the num variable is declared:
My personal tendency is to just bring the definition up top myself to avoid having extra warnings that make me miss more important issues. Been out of AS3 for a while but in large projects people let things go and you end up with 100s-1000s of warnings and relevant ones get buried.

Why does "using namespace System;" result in a missing type specifier?

I was working on a class "Board" that seemed to do everything just fine. Somehow, after about an hour of work on other classes, Board showed some pretty odd behavior in terms of errors.
//headerfile
#pragma once
using namespace System;
#include "stdafx.h"
ref class Board
{
public:
Board();
~Board();
void printToConsole();
private:
array<int^, 2>^ boardData;
};
The Errors i got for this code are:
Error 1 error C2143: syntax error : missing ';' before 'using' e:\users\felix\documents\visual studio 2012\projects\consoleapplication1\consoleapplication1\Board.h Line:4 Column:1 ConsoleApplication1
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\users\felix\documents\visual studio 2012\projects\consoleapplication1\consoleapplication1\Board.h Line:4 Column:1 ConsoleApplication1
Line 4 is "using namespace System;" Can anybody explain what I did wrong?
This seems particularly odd because I've got another class "Pattern" that looks pretty much like this but does not output any error.
EDIT:
So as some of you already told me, the semicolon may be missing in the headerfile i included before this one. Also there was a similar question, thanks for posting that one ;)
so this now is my stdafx.h (without comments):
#pragma once
#include "Board.h"
#include "Pattern.h"
#include <string>
#include <iostream>
as far as I know this pragma was there when I created this Console Application with VS, so there doesn't seem to be anything ever executed before including "Board.h".
I overlooked all my other files and I have never included Board anywhere else than here...
EDIT 2:
as I try to track down the error further, i noticed a missing "using namespace System;" in another class which I inserted. This resulted in a pretty interesting behavior, as the error now gets located in stdafx.h when I use namespace System in there aswell. If I don't the error will be located in the first file that gets included in stdafx.h
When I change the order of files, the first one always is the one that seems to be missing a ; before "using"... strange thing.
Heureka!
The mistake lay in stdafx.cpp wich I find strange because I can't remember to have ever edited it but, oh well.
stdafx//.cpp : source file that includes just the standard includes
// ConsoleApplication1.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
as you can clearly see, "stdafx" got interpreted as an incomplete statement where a type-specifier and a ';' were missing, thus the two errors.
As everyone in the comments already told me correctly, the error then was kinda send downwards by inclusion to the other classes. and was shown where the first real line of code (not directives) occurred.
the chain worked as follows:
stdafx.cpp -> stdafx.h -> the first headerfile included in stdafx.h -> "using namespace System;"
Anyway thanks for the help, I wouldn't have figured this out anyway else :)

Why does PhpStorm not suggest a variable name in a string?

Given the fantastic coding guidance PhpStorm offers I am a bit confused regarding the lack of variable name suggestions for variables used in strings.
$variable = "something";
// A:
$variable;
// B:
$str = "$variable";
// C:
$str = "{$variable}";
In case A PhpStorm suggests variables, not in cases B and C though.
As this is a very straightforward feature and Eclipse offers it too, I guess I have to adjust my configuration.
Any ideas?
Works fine in both cases (verified in 2.1.4), however automatic completion is not enabled in order not to distract you from the actual string editing and you have to press Ctrl+Space to invoke code completion: