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

Discussion in 'C' started by .dorian, Oct 15, 2007.

  1. .dorian

    .dorian New Member

    Joined:
    Oct 15, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    You have defined x264_cpu_cpuid function but not _x264_cpu_cpuid. See the underscore at the begining.

    I hope that clears thing out.
     
  3. .dorian

    .dorian New Member

    Joined:
    Oct 15, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    You might not be calling but some function you are using may be calling it.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice