Linker error between projects
-
Hi, I'm using C++ with MFC and VC++ 2005. My problem is this: I have two different projects, one dependent on the other. The first project compiles to produce a static lib. It also includes a namespace, let's call it "NAM" for the purpose of this question. The second project then includes the headers from the first project, and the static lib in its settings. This all seems fine, and the first project (the lib) compiles with no problems. However when I compile the second project, I receive linker errors for all of the namespace functions called in the first project's single .cpp file. So for instance, in project 1, I might have the function: NAM::Find_String(void) Which compiles just fine when I compile that project alone. But in the second project, I get this weird linker error that says: error LNK2001: unresolved external symbol _Find_String What am I doing wrong? It's like somehow the second project doesn't see the 'namespace' declared in the first project even though all the headers (there are only 3) are included and the lib is linked correctly.
KR
-
Hi, I'm using C++ with MFC and VC++ 2005. My problem is this: I have two different projects, one dependent on the other. The first project compiles to produce a static lib. It also includes a namespace, let's call it "NAM" for the purpose of this question. The second project then includes the headers from the first project, and the static lib in its settings. This all seems fine, and the first project (the lib) compiles with no problems. However when I compile the second project, I receive linker errors for all of the namespace functions called in the first project's single .cpp file. So for instance, in project 1, I might have the function: NAM::Find_String(void) Which compiles just fine when I compile that project alone. But in the second project, I get this weird linker error that says: error LNK2001: unresolved external symbol _Find_String What am I doing wrong? It's like somehow the second project doesn't see the 'namespace' declared in the first project even though all the headers (there are only 3) are included and the lib is linked correctly.
KR
Please check whether you have properly included the staticlib in its settings. Second thing, you have to specify the path in which the static liv is located in Project->Settings->Link->Input. Also please check whether you have included the namespace of the first project in the second one.
akt