About libs and "Error 30 error LNK2001: unresolved external symbol _..."

.dorian's Avatar, Join Date: Oct 2007
Newbie Member
hey guys,

iam a java prgrammer who is new to c/c++.
I have a big VS.net c++ project file here and try to understand it in order
to transfer it to another system.

the project inlcudes a *.lib file (project properties > Linker > input). When this file is included, the program compiles and links well, when i remove it, (of course ) not doesnt anymore. i get error messages like :

" Error 30 error LNK2001: unresolved external symbol _x264_cpu_cpuid cpu.obj "

the funny part is that the function" x264_cpu_cpuid" is defined and declared in one of the project source and header files. so the linker doesnt really need some extra lib files.

for what is this (1.7 mb large) lib file used, and how can i get rid of it ? (my target compiler cant load VS lib files)


i hope you can help me
thanks
dorian

ps: if somebody has the time, i would send him the hole folder - to make it easer
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
You have defined x264_cpu_cpuid function but not _x264_cpu_cpuid. See the underscore at the begining.

I hope that clears thing out.
.dorian's Avatar, Join Date: Oct 2007
Newbie Member
hey shabbir,

i didnt find any (example here) _x264_cpu_cpuid calls in the programm. In addition I couldnt find anything in the source code that links to the included lib file. Its just added, but it seems that nothing is done with it.

All the functions the linker asks for are written (of course they dont have this underscroe =) ...

Why does the linker needs this lib file, and how can i write a "lib-free" program ?

thanks
dorian
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
You might not be calling but some function you are using may be calling it.