c function in c++

M

mathudiv

error LNK2019: unresolved external symbol __imp__fwrite referenced in
function "void __stdcall dg729(void)" (?dg729@@YGXXZ)

error LNK2001: unresolved external symbol __imp__fwrite

how to use .c function in c++ code
 
I

Ian Collins

error LNK2019: unresolved external symbol __imp__fwrite referenced in
function "void __stdcall dg729(void)" (?dg729@@YGXXZ)

error LNK2001: unresolved external symbol __imp__fwrite

how to use .c function in c++ code

Make sure it is declared extern "C".
 
J

Jim Langston

error LNK2019: unresolved external symbol __imp__fwrite referenced in
function "void __stdcall dg729(void)" (?dg729@@YGXXZ)

error LNK2001: unresolved external symbol __imp__fwrite

how to use .c function in c++ code

extern "C"
{
void __stdcall dg729();
}

int main()
{
dg729();
}
 
E

Eberhard Schefold

error LNK2019: unresolved external symbol __imp__fwrite referenced in
function "void __stdcall dg729(void)" (?dg729@@YGXXZ)

error LNK2001: unresolved external symbol __imp__fwrite

This is an error specific to your particular development system (MS VC),
and therefore off-topic in this newsgroup.

In a nutshell, you (or somebody else in case you're using a third-party
lib) compiled code with an option (/MD) to use the C Runtime code of a
shared DLL, but then you try to link with the static library version of
that Runtime code.

Consolidate your project settings (or, in case of a third-party lib, get
the version that was appropriately compiled).

If you have further questions, look for the appropriate newsgroup in the
microsoft.* hierarchy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top