getenv in Visual C++ 2012 -


i want use getenv function c in c++ project in visual studio 2012.

the code:

extern "c" system::sbyte^ getenv(const system::sbyte^ name); 

and in function:

string^ h1 = "homedrive"; const system::sbyte^ c1 = dynamic_cast<const system::sbyte^>(h1); getenv(c1); 

the error get:

error   11  error lnk2019: unresolved external symbol "extern "c" class system::sbyte ^ __clrcall getenv(class system::sbyte const ^)" (?getenv@@$$j0ymp$aavsbyte@system@@p$abv12@@z) referenced in function "public: void __clrcall kameleon::form1::createconfig(void)" (?createconfig@form1@kameleon@@$$fq$aamxxz)   c:\users\michal\desktop\kameleon\kameleon\kameleon\kameleon.obj kameleon 

i think c++ project can use getenv <cstdlib>, not c++/cli one.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -