Zero-to-Hero Tutorial - nearprotocol

Followed the tutorial and all looked like it was working until I tried to call the function
near view crossword.friend.testnet get_puzzle_number
and got the error
{
"block_hash": "GxTcbrAXiL3Ad4viEiDM62pVfZaFJzRewtXo8UU2tMi9",
"block_height": 91856013,
"error": "wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound))",
"logs": []
}
I used my account rather than 'friend'. Using Windows. Tried from admin console. I can see the transactions in the explorer and error there.
Any idea what I'm doing wrong?

Figured the answer. When compiling it did not highlight that I had not imported the near_sdk::env library in Visual Code. It was missing some extensions. Did it again with that import and VS extensions and it has worked! Sorry to bother.

Related

Error when importing package (google.golang.org/api/option): "error reading symbol: EOF"

I'm trying to build out a simple URL shortener in Go to get familiar with the language. As part of this I'm trying to use an underlying firebase datastore which I'm authenticating against using a Service Account.
After configuring the firestore client I tried to build for the first time and started encountering the following error
$ go build
# _/C_/Users/emmao/Documents/Go/UrlShortener
2020/05/10 17:52:18 C:\Users\emmao\go\pkg\windows_amd64\github.com\golang\protobuf\ptypes.a(_go_.o): error reading symbol: EOF
After stripping back chunks of code, this is the minimum amount required to reproduce the issue:
package main
import (
"fmt"
"google.golang.org/api/option"
)
func main() {
// Use a service account
sa := option.WithCredentialsFile("path/to/serviceAccount.json")
fmt.Println(sa)
}
I'm a bit lost with it to be honest. I'm getting no syntax highlighting to indicate I've done anything wrong. And while this is an early project for me with I've built some other simple stuff which required external imports and they worked okay.
I'm using a Windows PC with Visual Studio Code as an IDE. Tried both CRLF and LF line endings. I also tried just rewriting the file again from scratch using vanilla notepad and encountered the same problem.
The extensions I have on VS code are underlining package main and showing the same error as I get on build.
Anybody encountered anything like this before?
your code is fine i test it on my mac, but it can be some outsider causes, for example: windows firewall - which blocked requests to download some go packages
see this similar issues:
https://github.com/PaloAltoNetworks/pango/issues/11#issuecomment-492211040
Go failing - expected 'package', found 'EOF'
sometimes in similar situations i got inconspicuous notifications about blocked process, etc in taskbar or small window on desktop , so you need to check your environment

What does <autogenerated>:1 mean when debugging Go package with delve?

I was trying to debug a Go package with lots of dependencies, trying to trace function calls across dependencies to get to the bottom of a bug.
Delve – via both CLI and VSCode GUI debugger – followed function calls to a certain depth, but then suddenly refused to go any deeper and instead of allowing me to access the local variables in that function call, produced a cryptic <autogenerated>:1 (PC: 0x141e850).
On VSCode I get this error instead: go list failed on .: can't load package: package .: no Go files in C:\Program Files\Microsoft VS Code
I know this is kind of vague, but can anybody point me to what this might mean?
This might answer your doubt: Github: go-delve/delve #1908
Read the full thread.
For anyone who runs into this in the future:
The solution is to set breakpoints IN the functions that are getting called as well. I tried this, and it does in fact follow the function calls properly.

basic_timed_mutex.hpp(159): fatal error C1001: An internal error has occurred in the compiler

I have problem when I am building project in Visual Studio 2010 for 64bit. I couldn't able to build for 64bit with boost library, I am getting below error. I can build for 32bit but not for 64bit.
\boost_1_49_0\boost\thread\win32\basic_timed_mutex.hpp(159): fatal error C1001: An internal error has occurred in the compiler
(compiler file 'f:\dd\vctools\compiler\utc\src\p2\wvm\mdmiscw.c', line 2704)
5 To work around this problem, try simplifying or changing the program near the locations listed above.
5> Please choose the Technical Support command on the Visual C++
5> Help menu, or open the Technical Support help file for more information
5> The command exited with code 2.
It is pointing error to the below code and ofcourse I can't change the boost library. I am confused with this error
void unlock()
{
long const offset=lock_flag_value;
long const old_count=BOOST_INTERLOCKED_EXCHANGE_ADD(&active_count,lock_flag_value);
if(!(old_count&event_set_flag_value) && (old_count>offset))
{
if(!win32::interlocked_bit_test_and_set(&active_count,event_set_flag_bit))
{
win32::SetEvent(get_event());
}
}
}
Can you please help me,
Thank you
Edited :
I am not sure where the error but I think its in the boost libraries, there is a cpp file like
Class a::a(, point, )
{
}
and the "point" is a namespace which is defined in a header file which is using boost libraries and it has following code
#include <boost/thread.hpp>
#include <boost/thread/recursive_mutex.hpp>
namespace point
{
// some work1
void fun()
{
boost::unique_lock< boost::recursive_mutex > lck(*m_RedrawMutex);
// some work2
}
// some work3
}
Answer :
It finally worked !! After two days of search, I found another way.I just changed the order of include path in the project header where it was using boost basic_timed_mutex.hpp. I placed boost include path at the top and it worked. It's strange!!!
I've had this same issue myself - and it seems to be related to certain code-blocks in boost itself. It appears to be caused by a bug in the MSVC compiler toolchain.
Disabling optimisation appears to solve the issue for many users As per this MSDN article - Source from MSDN suggesting this fix Souce on stack-overflow
I wish I could present a logical cause, or bug report on the issue, but for myself the problem was solved by upgrading to Boost 1.60.
That said, other uses have reported that trailing-slashes are the cause!
update:
After some browsing it appears this issue can be caused by everything from infinite-loops, though to templates types holding function pointers. and doesn't always list the actual-source of the error correctly (eg: it's not where the error message says it is). That said, disabling optimisation appears to solve the issue near universally - at the cost that your software may run slower.

What does this Xcode link warning mean? can't add line info to anonymous symbol

I am working towards getting rid of all link warnings, but I am getting three that I don't quite understand and a google search for this warning hasn't been helpful.
The output to Xcode looks like:
ld: warning: can't add line info to anonymous symbol __ZN16CLineAlignWidgetD0Ev.lsda from /path/to/CLineAlignWidget.o
What causes this warning and what can be done to fix it?
I have looked at the CLineAlignWidget class and it looks like other classes which aren't generating this warning.
Thank you.
I went to the llvm IRC channel and asked this question and got back the following response:
d0k: It's a compiler bug, but I think it's harmless

Why VM Debugger in Visual Studio 2008 throws "unable to detected startup project"?

I have a problem with VM-Debugger in Visual Studio 2008 (VMWare Workstation 6.5.3). Always when i try to Start the VM-debugging the debugger tells me the following:
Error: Unable to detect the current startup project.
I only have one startup-project but there are several other projects are in my solution.
The debugger-log says only this:
27.10.2009 14:35:29:
27.10.2009 14:35:29: Debugging started...
27.10.2009 14:35:29: ERROR: pEnumerator->Reset()
27.10.2009 14:35:29: An error occurred in .\Connect.cpp at line 2369.
27.10.2009 14:35:29: ERROR: FindProject(pEV, startupName, pProject)
27.10.2009 14:35:29: An error occurred in .\Connect.cpp at line 2412.
27.10.2009 14:35:30: Error: Unable to detect the current startup project.
27.10.2009 14:35:30: ERROR: DoStart()
27.10.2009 14:35:30: An error occurred in .\Connect.cpp at line 549.
The logs of VMWARE-Workstation-Program say nothing that seems like an error.
I already have tried to build a new solution and add my existing projects, but the same effect appears. I already have re-installed the vmware-visual-studio-plugin. There was noch change.
Do you perhaps know what's the problem and how it could be fixed.
Greetings, Martin
It appears that this is a known issue. However, as far I know, VMWare has not released a fix for this even when there have been reports about this since 2 years.
May be your startup project is under a solution folder. On this case, a workaround is to place your startup project at the main level of your solution.
Depending on the structure of your solution, this workaround may be useful or may not work.
For me, even with this workaround, VM-Debugger reuses to work. On my solution, VM-Debugger only worked with the project that is created on a fresh solution (the very, very first project on any solution). Since we removed that project from our solution, it doesn't matter what we do, VM-Debugger simply does not work.
"One more minor note: If you install VMWare 6.5, it will re-map F6 to "Start debugging in a virtual machine," causing an "Unable to detect the current startup project" error dialog to appear. To correct this, re-map F6 back to Build.BuildSolution. "
(taken from http://mark.michaelis.net/Blog/VisualStudioKeyboardShortcutsForCompilingMSDNFlashDec292008.aspx)
Maybe this will be helpful.

Resources