__imp__fopen linker error

Started by
4 comments, last by Spudder 18 years, 9 months ago
after calling fopen() in my code, i get this linker error: Core_System.obj : error LNK2019: unresolved external symbol __imp__fopen referenced in function "public: int __thiscall cDataPackage::Save(char *)" (?Save@cDataPackage@@QAEHPAD@Z) i have been trying to fix it for days, and i cannot do it. i have included stdio.h, but i don't know which libs i need to add. i am using Microsoft Visual C++ Toolkit 2003 compiler and linker with Code::Blocks IDE PLZ HELP ME!!!
Advertisement
This page details the different versions of the C runtime library available, you just need to choose version to use - single threaded/multi-threaded or release/debug versions.
Ok, i included msvcrt.lib, but there it was located in the AMD64 folder and the IA64 folder. when i compile with either one of these i get:

msvcrt.lib(ti_inst.obj) : fatal error LNK1112: module machine type '**AMD64 or IA64**' conflicts with target machine type 'X86'

i don't really know what's happening, as i don't have an X86 folder

in fact, i don't even know what AMD64, IA64, and X86 even mean
The Platform SDK contains the source code for the c runtime, so at the very least, you should be able to build the lib.
.
are you sure it has the source for msvcrt.lib?

i couldn't find it in the src/crt directory.

by the way though, how do you build a lib, as i have never learnt how.
is it just a compiler option or something?
The tool to create .lib files (lib.exe) I believe is missing from the toolkit, this program is simple a stub for running the linker and the source for a replacement program can be found here. You might also want to check out this page which is the MSDN documentation for the lib tool.

This topic is closed to new replies.

Advertisement