Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8200297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:23:49+00:00 2026-06-07T06:23:49+00:00

When building a simple hello-world-style project trying to embed v8 I get an error

  • 0

When building a simple hello-world-style project trying to embed v8 I get an

error LNK2001: “”public: static class v8::Local __cdecl v8::String::New(char const *,int)” (?New@String@v8@@SA?AV?$Local@VString@v8@@@2@PEBDH@Z)”

Something’s wrong with my project settings and I can’t seem to figure it out. This is my source file:

#include "stdafx.h"
#include "v8.h"

using namespace System;

#pragma unmanaged

void test()
{
    v8::Local<v8::String> source = v8::String::New("'Hello' + ', World'");
}

#pragma managed

int main(array<System::String ^> ^args)
{
    return 0;
}

Compiling seems to work fine, I added the v8 directory of the node 0.8.0 project (node-v0.8.0\deps\v8\include). In terms of linking, I added these libs as additional dependencies.

node-v0.8.0\Release\lib\v8_base.lib
node-v0.8.0\Release\lib\v8_snapshot.lib

I’m on Windows 7, 64 bit. My project is set to build x64, as is node.js (installed using the ‘Windows x64 installer’). What’s wrong?

Update I figured that when building for x64, the additional dependencies I added are completely ignored (the error messages are the same whether I add them or not). But when building for win32, I get different error messages. (Btw: Does that mean the lib files are for x86 and not x64 – as I assumed – and why didn’t the linker tell me so? Update: dumpbin told me, the lib files are indeed for x86).

In addition to v8_base and v8_snapshot, the linker errors lead me to add

winmm.lib
ws2_32.lib

Which gets rid of all “unresolved external symbol” errors. But now I get a LNK2005 “already defined” error:

エラー 1   error LNK2005: __matherr は既に LIBCMT.lib(_matherr_.obj) で定義されています。   c:\...\HelloC++CLIWorld\HelloC++CLIWorld\MSVCRTD.lib(merr.obj)  HelloC++CLIWorld

I tried /NODEFAULTLIB:LIBCMT, then I get an LNK2001 “unresolved external symbol”:

エラー 1   error LNK2001: 外部シンボル "__HUGE" は未解決です。  c:\...\HelloC++CLIWorld\HelloC++CLIWorld\v8_base.lib(heap.obj)  HelloC++CLIWorld

I also tried `/NODEFAULTLIB:MSVCRTD’, but then I get tons of LNK2001s again. A tiny selection:

エラー 1   error LNK2001: 外部シンボル "___native_dllmain_reason" は未解決です。    c:\...\HelloC++CLIWorld\HelloC++CLIWorld\MSVCMRTD.lib(mstartup.obj) HelloC++CLIWorld
エラー 2   error LNK2001: 外部シンボル "___native_vcclrit_reason" は未解決です。    c:\...\HelloC++CLIWorld\HelloC++CLIWorld\MSVCMRTD.lib(mstartup.obj) HelloC++CLIWorld
エラー 3   error LNK2001: 外部シンボル "___native_startup_state" は未解決です。 c:\...\HelloC++CLIWorld\HelloC++CLIWorld\MSVCMRTD.lib(mstartup.obj) HelloC++CLIWorld
エラー 4   error LNK2001: 外部シンボル "___native_startup_lock" は未解決です。  c:\...\HelloC++CLIWorld\HelloC++CLIWorld\MSVCMRTD.lib(mstartup.obj) HelloC++CLIWorld
エラー 5   error LNK2001: 外部シンボル ""extern "C" int __cdecl __wgetmainargs(int *,wchar_t * * *,wchar_t * * *,int,struct _startupinfo *)" (?__wgetmainargs@@$$J0YAHPAHPAPAPA_W1HPAU_startupinfo@@@Z)" は未解決です。 c:\...\HelloC++CLIWorld\HelloC++CLIWorld\MSVCMRTD.lib(ManagedMain.obj)  HelloC++CLIWorld

Now what?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:23:50+00:00Added an answer on June 7, 2026 at 6:23 am

    I figured out 2 things:

    • Visual Studio will not complain about the wrong architecture in a lib file you add to the linker settings as additional dependencies, but just ignore the file (I think I’m running at the default warning levels)
    • using dumpbin mylib.lib /headers|more revealed that the libs I thought were built for x64 were in fact built for x86

    As written in the Update part of my question, I could not get an x86 build to work, due to LNK2005 errors, but linking worked when I built for x64 against a x64 v8 lib (or rather, node.lib, which contains v8).

    The bad news: After having managed the compilation step, and now the linking step, I get a runtime exception, even when I, as I’m supposed to do, do a

    HandleScope handle_scope;
    

    before new’ing the v8::String. But that’s for another question. For now, linking is solved, at least on x64. Oh happy day!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building an application with the Dyninst API, and with a simple Hello World
Hello I am building a simple aggregator script and I am trying to have
I'm trying to compile a simple hello world kernel module but after the make
I'm using eclipse and I'm building a simple program, but I get an error
I'm building a web service using Flask and I'm trying to deploy a simple
I building a simple class that is supposed to mimic the functionality of the
I need to generate a simple "Hello World" ELF32 executable using gcc . I
I'm building a JavaScript engine. I used a simple function as a class, added
Building simple code (example is below) returns error on eclipse, while g++ from commandline
I am building simple notificiation system and I just wanted to know what is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.