Problem linking using msvc

Help
Paul Brown
2004-05-19
2004-05-19
  • Paul Brown

    Paul Brown - 2004-05-19

    Hi

    i'm using cpptasks-1.0b3

    i built a simple HelloWorld C/C++ program using the <cc> task...that produced a DLL....fine.

    i now started changing the HelloWorld program to have some dependencies on other LIB/DLL's....i'm getting a linker error when i try and build my project

    i'm struggling to understand how you tell the <cc> task the location of the LIBs

    i'm doing this :
      <target name="all" >
        <echo message="Building cbuild"/>
        <cc  name="msvc" debug="true"
         incremental="false"
         objdir="."
             outfile="./nativecpubsubtest"
             outtype="shared"
             link="shared">
             <fileset dir="." includes="*.cpp"/>
             <linker name="msvc">
              <linkerarg value="/machine:I386" location="mid"/>
               <libset libs="kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid odbc32 odbccp32"/>
           <fileset dir="." includes="*.obj"/>

           <libset libs="C:/nativecjms/wmdcc/lib_g"/>
            </linker>

        </cc>
      </target>

    so i'm trying to use the nested 'libset' element to point at the directory containing my LIBs.

    It's not working ...i'm still getting linker errors... PLEASE HELP?!?!?!?!?!

    Paul

     
    • Curt Arnold

      Curt Arnold - 2004-05-19

      Try either:

      <libset dir="C:/nativecjms/wmdcc" libs="lib_g"/>

      or

      <fileset file="C:/nativecjms/wmdcc/lib_g.lib"/>

      The first form will support gcc-like compilers and will result in a "-LC:/nativejms/wmdcc -llib_g" added to the command line which will cause the linker to link in liblib_g.so or liblib_g.a.

      The second form just adds the .lib file to the link which will work for most windows compilers.

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks