How to fix Code Runner ReferenceError: function is not defined issue? - vscode-code-runner

I've already installed node.js and i've done all the path stuff, but still Code Runner isn't working as expected, this is the output after running the code:
console.log(sum(5, 2))
^
ReferenceError: sum is not defined

Related

Undefined reference to symbol error when linking Mongo C driver static library

I'm trying to build a program using the Mongo C driver. My CMake configuration includes this:
include_directories("/usr/local/include/libmongoc-1.0")
include_directories("/usr/local/include/libbson-1.0")
...
SET (STATIC_LIBS
...
libmongoc-static-1.0.a
libbson-static-1.0.a
)
TARGET_LINK_LIBRARIES(myapp ${STATIC_LIBS})
Compile stage goes fine (so it seems that includes are correctly found), but when the linking stage takes place I get this error:
/usr/bin/ld: /usr/local/lib/libmongoc-static-1.0.a(mongoc-counters.c.o): undefined reference to symbol 'shm_unlink##GLIBC_2.2.5'
//lib/x86_64-linux-gnu/librt.so.1: error adding symbols: DSO missing from command line
It seems it correctly find the static library file but something in it doesn't like it...
Somebody has found a similar error? Is there any known solution?
Some additional info about my system:
gcc version: 6.3.0
Mongo C driver version: 1.16.0
MongoDB version: 4.4.1
Operating system: Debian 9.3
Thanks!
EDIT: debugging on this, I have discovered that if I build the Mongo C driver without SHM counters support this way:
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_SHM_COUNTERS=OFF -DENABLE_STATIC=ON ..
Then the above error disappears. However, this new and similar one happens:
/usr/bin/ld: /usr/local/lib/libmongoc-static-1.0.a(mongoc-scram.c.o): undefined reference to symbol 'usprep_close_57'
//usr/lib/x86_64-linux-gnu/libicuuc.so.57: error adding symbols: DSO missing from command line
I think I finally solved the problem this way (after looking to this piece of documentation):
include_directories("/usr/local/include/libmongoc-1.0")
include_directories("/usr/local/include/libbson-1.0")
...
find_package (mongoc-1.0 1.17.4 EXACT)
SET (STATIC_LIBS
...
mongo::mongoc_static
)
TARGET_LINK_LIBRARIES(myapp ${STATIC_LIBS})
I didn't need to use -DENABLE_SHM_COUNTERS=OFF -DENABLE_STATIC=ON to build the driver and the recommended way in documentation worked:
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..

Get Error in WebGL: ReferenceError: $ is not defined

I have Unity project created in Unity 5.2.3. I open this project in Unity 5.3.3p3 and compile for WebGl and get error: Invoking error handler due to
ReferenceError: $ is not defined.
I find answer: in my code was line: Application.ExternalCall("$('#ViewerBox').data('unityViewer')." + method, values);
With symbol $

webpack silently continues despite typescript errors

I'm playing around with typescript in an existing coffeescript project that uses gulp and webpack.
I noticed when there's a syntax error in the coffeescript, it will fail the gulp task and not continue with the following steps, which is the desired behavior. With the typescript loader I'm using (ts-loader), I can see error messages in the terminal, but the webpack task succeeds from gulp's perspective and continues on. I imagine this is a difference in how the coffeescript loader and the typescript loader handle errors.
For example, I can add the following typescript file:
function greet(name: string) {
return 'Hello '+name;
}
export = greet;
{
and see the error in the build:
ERROR in ./bin/arranged/webkit/hcube/dummy.ts
(8,1): error TS1005: '}' expected.
but it still continues with the rest of the build like webpack didn't return any errors.
I realize that unlike coffeescript, typescript has a lot of inter-file dependencies, which makes the ts-loader much more complex, but I feel like it should still be failing at some point. Running the typescript compiler on the command line returns the expected exit code when there are syntax errors, so I feel like the problem lies in the loader itself.
In the after-compile plugin of ts-loader should it be reporting errors to webpack differently to propogate up? Right now it looks like it just attaches the errors to webpack in the after-compile plugin and webpack just keeps on trucking (see https://github.com/TypeStrong/ts-loader/blob/master/index.ts#L398). Should the loader be raising an error in this plugin if errors are encountered? Or calling the callback differently? Or should this be handled in some other part of the loader? Again, this particular example is a syntax error, so I imagine it would be caught/raised before after-compile is executed.

Compiling vb project using VBC throwing error

I have VB project, which is compiling/building perfectly using vb6 IDE in XP mode.
My objective is to automate the deployment process, so am trying to build this project in command line using VBC.
But while compiling vb project in window 7 using VBC.exe and cmd its throwing following error/exception.
Example:
error: BC30203: Identifier expected.
error: BC30481:'class' statement must end with matching end class.
error: BC30617:'Module' statement can occur only at file or namespace level.
Does anybody have any suggestion ideas what am missing here.
Thanks in advance.

Zephir Error : Unable to load dynamic library '/usr/lib/php5/20121212/utils.so'

Today, i installed 'Zephir' on my ubuntu machine. After spending some hour(going through zephir docs) with Zephir I noticed 2 things.
- The 'config.json' file which suppose to be created inside of "utlis" folder(as of zephir doc) it's getting created outside of "utlis" folder.
- After successfully testing 1st example 'Greeting'(as of zephir doc ) when i created the 2nd example of "Filter" Class & tried to build the extension by "zephir build" command i got following error..
Error message : PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/utils.so' - /usr/lib/php5/20121212/utils.so: undefined symbol: zephir_Utils_Bark_init in Unknown on line 0
In fact, i feel whenever i tried to create a new Class inside "utlis" folder i got that error. I made some quick google search about the error but didn't get any result.
Guys any idea, what's going wrong... ?