none
fatal error LNK1104: cannot open file 'C:\Users\********\Documents\Visual.obj'

    Question

  • I'm new to dlls. I tried a video tutorial from msdn how to repository and got an unexpected error.

    I've got 2 projects(test & testdLL) in a single solution space(testDLL).

    1.test(default)
    Source Files:test.cpp [
                                       #include<windows.h>
                                       #include<iostream>
                                       __declspec(dllimport) double WINAPI square(double);
                                       __declspec(dllimport) float WINAPI square(float);
                                       extern "C" {__declspec(dllimport) int WINAPI square(int);};

                                       int main()
                                      {
                                                int i=1;
                                                float j=2.0f;
                                                double k=3.0l;
                                                std::cout<<square(i)<<std::endl;
                                                std::cout<<square(j)<<std::endl;
                                                std::cout<<square(k)<<std::endl;
                                                return 0;
                                       }
                                      ]

    2.testDLL
    Source File:1. square.def [
                                              LIBRARY    "testDLL"

                                              EXPORTS
       
                                                      square
                                             ]
                    
                       2.  square_c.c [
                                                #include<windows.h>
                                                int WINAPI square(int x)
                                                {
                                                       return x*x;
                                                }
                                               ]

                       3. square_cpp.cpp [
                                                        #include<windows.h>
                                                        _declspec (dllexport) double WINAPI square(double x)
                                                        {
                                                              return x*x;
                                                        }
                                                        _declspec (dllexport) float _stdcall square(float x)
                                                        {
                                                              return x*x;
                                                        } 
                                                       ]


    The second project(testDLL) is built without any pronlems, but the first one(test) is giving the following error "fatal error LNK1104: cannot open file 'C:\Users\********\Documents\Visual.obj'"

    Please help.
     


    Wednesday, August 13, 2008 5:27 PM

Answers

All replies