Hi All
Desperately I try to include some file operations (like fopen(), fclose()
or fgetc()) in my source code (a modified version of 1394api) and make a
dll file out of it using the provided “source” file from the 1394diag
sample. Without these file operations it works perfectly but as soon as I
include them I have this linker error (VC6, win2k):
libc.lib(crt0.obj) : error LNK2001: unresolved external
symbol _main
I suspect that this has something to do with the “source” file provided
with the sample (1394diag). Is there anybody ever had a similar problem?
What I don’t understand is why is the linker using libc.lib eventhough
this lib file is not specified in the “source” file under TARGETLIBS, how
can I exclude it?
And why the unresolved symbol _main? According to the MSDN help it cannot
find the entry point of the dll, but why an entry point if I want to use
just some parts of the lib?
Thanks in advance for help
Daniel
Use CreateFile, ReadFile, WriteFile, etc. to do your file operations.
Chris
“Daniel Luethi” wrote in message news:xxxxx@ntdev…
>
> Hi All
>
> Desperately I try to include some file operations (like fopen(), fclose()
> or fgetc()) in my source code (a modified version of 1394api) and make a
> dll file out of it using the provided “source” file from the 1394diag
> sample. Without these file operations it works perfectly but as soon as I
> include them I have this linker error (VC6, win2k):
>
> >libc.lib(crt0.obj) : error LNK2001: unresolved external
> symbol _main
>
> I suspect that this has something to do with the “source” file provided
> with the sample (1394diag). Is there anybody ever had a similar problem?
>
> What I don’t understand is why is the linker using libc.lib eventhough
> this lib file is not specified in the “source” file under TARGETLIBS, how
> can I exclude it?
>
> And why the unresolved symbol _main? According to the MSDN help it cannot
> find the entry point of the dll, but why an entry point if I want to use
> just some parts of the lib?
>
> Thanks in advance for help
> Daniel
>
>
>
>
This is what you r mismatching project settings…
You might have compiled a c or cpp file without creating a project.
Well a solution is create a new project of type “Win32 DLL” choose empty
project. then add all files which you r trying to compile …
_main symbol is needed when project type is a console application.
Thank you very much Chris!!! The whole day yesterday I wasted trying to
change something on the linker switches…
With changing to CreateFile() and ReadFile() the linker didn’t complain
anymore!!! Wow!
Still, I’d like to know why the fopen(), fgetc() and fclose() doesn’t work
in this context, do you or anybody else know why? I suspect it must have
something to do with the standard libraries libc.lib and libcmt.lib,
there’s a lot written in the MSDN help but all my project adjustings
seemed to be correct.
Daniel