You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Andrew Wilson <an...@btopenworld.com> on 2007/02/14 10:28:13 UTC

Sample compile on Windows VC7.1 link error

I'm trying to get xerces started under Visual C++ 7.1 and get a small  
sample working.

I've downloaded both the source and the samples and they compile and  
run no problem.

I then copy the folder for one of the samples (CreateDomDocument) and  
place it elsewhere, outside the xerces folder so that I can get the  
environment settings right, but I can't get it to compile. It fails  
at linking with 5 unresolved external symbols (4  
xercesc_2_7::XMLString and one xercesc_2_7::XMLException).

I have copied the 4 lib files (xerces-???.dll) both into the Visual  
Studio bin directory and into the new CreateDomDocument folder next  
to the source files.

Under Tool > Options > Projects > VC++ Directories I have set the  
directory options for Include files and Library to point into the  
original xerces source downloads, to \src and \lib respectively.

Since I am using the sample's original solution (.sln) file, I've  
changed nothing in there.

The Building on Windows instructions on the xerces-c website give no  
other clues. Can someone please advise what I'm missing?

Andrew

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Sample compile on Windows VC7.1 link error

Posted by Andrew Wilson <an...@btopenworld.com>.
Thanks Alberto, now it works.

In project Properties > C/C++ > Language I had 'Treat wchar_t as  
Built-in Type' set to Yes and it should be No.

Once I had set this, it ripped up over the first include file  
(xercesc/util/PlatformUtils.hpp) so I also needed to set the Include  
Directory under Tools > Options > Projects > VC++ Directories to  
{main location}\xerces-c-src_2_7_0\src.

BTW, looking through some of the other samples, I see that they have  
'Disable Language Extensions' set to Yes whereas it should be No.

Hope this explanation also helps someone at some stage.

Thank you for all your work on this Alberto.

Andrew

On 14 Feb 2007, at 17:38, Alberto Massari wrote:

> Uhm, so you are getting *only* 5 unresolved externals even if you  
> use more Xerces functions? Have you checked that the "use wchar_t  
> as a built-in type" has the same value in both Xerces project and  
> your project?
>
> Alberto
>
> At 17.30 14/02/2007 +0000, Andrew Wilson wrote:
>> Thanks Alberto, but still no luck.
>>
>>>> I have copied the 4 lib files (xerces-???.dll) both into the Visual
>>>> Studio bin directory and into the new CreateDomDocument folder next
>>>> to the source files.
>>>
>>> I would rather copy the Xerces .dll in the directory where the
>>> sample .exe will be placed; the Visual Studio bin directory is not
>>> guaranteed to be in the PATH.
>> I copied the 2 debug dlls into the Debug folder of the new
>> CreateDomDocument folder. I still get the link error.
>>
>>
>>>> Under Tool > Options > Projects > VC++ Directories I have set the
>>>> directory options for Include files and Library to point into the
>>>> original xerces source downloads, to \src and \lib respectively.
>>>
>>> If you built Xerces from sources, the proper lib directory are
>>> builds\win32\vc7.1\debug and builds\win32\vc7.1\release
>> Then I changed the lib directory to the longer debug directory as
>> described above. I still get the error.
>>
>> If I remove both of the above (the copied dlls and the lib directory
>> pointers) then I get:
>> cannot open file 'xerces-c_2D.lib'
>>
>> and then if I put the lib directory back into the Tools > Options,
>> I'm back to the 5 Link errors, so presumably that file is being  
>> found.
>>
>> Andrew
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
>> For additional commands, e-mail: c-dev-help@xerces.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: c-dev-help@xerces.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Sample compile on Windows VC7.1 link error

Posted by Alberto Massari <am...@datadirect.com>.
Uhm, so you are getting *only* 5 unresolved externals even if you use 
more Xerces functions? Have you checked that the "use wchar_t as a 
built-in type" has the same value in both Xerces project and your project?

Alberto

At 17.30 14/02/2007 +0000, Andrew Wilson wrote:
>Thanks Alberto, but still no luck.
>
>>>I have copied the 4 lib files (xerces-???.dll) both into the Visual
>>>Studio bin directory and into the new CreateDomDocument folder next
>>>to the source files.
>>
>>I would rather copy the Xerces .dll in the directory where the
>>sample .exe will be placed; the Visual Studio bin directory is not
>>guaranteed to be in the PATH.
>I copied the 2 debug dlls into the Debug folder of the new
>CreateDomDocument folder. I still get the link error.
>
>
>>>Under Tool > Options > Projects > VC++ Directories I have set the
>>>directory options for Include files and Library to point into the
>>>original xerces source downloads, to \src and \lib respectively.
>>
>>If you built Xerces from sources, the proper lib directory are
>>builds\win32\vc7.1\debug and builds\win32\vc7.1\release
>Then I changed the lib directory to the longer debug directory as
>described above. I still get the error.
>
>If I remove both of the above (the copied dlls and the lib directory
>pointers) then I get:
>cannot open file 'xerces-c_2D.lib'
>
>and then if I put the lib directory back into the Tools > Options,
>I'm back to the 5 Link errors, so presumably that file is being found.
>
>Andrew
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
>For additional commands, e-mail: c-dev-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Sample compile on Windows VC7.1 link error

Posted by Andrew Wilson <an...@btopenworld.com>.
Thanks Alberto, but still no luck.

>> I have copied the 4 lib files (xerces-???.dll) both into the Visual
>> Studio bin directory and into the new CreateDomDocument folder next
>> to the source files.
>
> I would rather copy the Xerces .dll in the directory where the  
> sample .exe will be placed; the Visual Studio bin directory is not  
> guaranteed to be in the PATH.
I copied the 2 debug dlls into the Debug folder of the new  
CreateDomDocument folder. I still get the link error.


>> Under Tool > Options > Projects > VC++ Directories I have set the
>> directory options for Include files and Library to point into the
>> original xerces source downloads, to \src and \lib respectively.
>
> If you built Xerces from sources, the proper lib directory are  
> builds\win32\vc7.1\debug and builds\win32\vc7.1\release
Then I changed the lib directory to the longer debug directory as  
described above. I still get the error.

If I remove both of the above (the copied dlls and the lib directory  
pointers) then I get:
cannot open file 'xerces-c_2D.lib'

and then if I put the lib directory back into the Tools > Options,  
I'm back to the 5 Link errors, so presumably that file is being found.

Andrew

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Sample compile on Windows VC7.1 link error

Posted by Alberto Massari <am...@datadirect.com>.
Hi Andrew,

At 09.28 14/02/2007 +0000, Andrew Wilson wrote:
>I'm trying to get xerces started under Visual C++ 7.1 and get a small
>sample working.
>
>I've downloaded both the source and the samples and they compile and
>run no problem.
>
>I then copy the folder for one of the samples (CreateDomDocument) and
>place it elsewhere, outside the xerces folder so that I can get the
>environment settings right, but I can't get it to compile. It fails
>at linking with 5 unresolved external symbols (4
>xercesc_2_7::XMLString and one xercesc_2_7::XMLException).
>
>I have copied the 4 lib files (xerces-???.dll) both into the Visual
>Studio bin directory and into the new CreateDomDocument folder next
>to the source files.

I would rather copy the Xerces .dll in the directory where the sample 
.exe will be placed; the Visual Studio bin directory is not 
guaranteed to be in the PATH.


>Under Tool > Options > Projects > VC++ Directories I have set the
>directory options for Include files and Library to point into the
>original xerces source downloads, to \src and \lib respectively.

If you built Xerces from sources, the proper lib directory are 
builds\win32\vc7.1\debug and builds\win32\vc7.1\release

Alberto


>Since I am using the sample's original solution (.sln) file, I've
>changed nothing in there.
>
>The Building on Windows instructions on the xerces-c website give no
>other clues. Can someone please advise what I'm missing?
>
>Andrew
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
>For additional commands, e-mail: c-dev-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org