I am having an issue with trying to setup opencv 2.4.6 with visual studio ultimate 2010 on a 64-bit windows 8 machine. I know to add in the includes and dll references, but when I execute the code I have it shows this huge external linking error:
code:
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, const char** argv )
{
Mat img = imread("mypic.JPG", CV_LOAD_IMAGE_UNCHANGED); //read the image data in the file "MyPic.JPG" and store it in 'img'
if (img.empty()) //check whether the image is loaded or not
{
cout << "Error : Image cannot be loaded..!!" << endl;
//system("pause"); //wait for a key press
return -1;
}
namedWindow("MyWindow", CV_WINDOW_AUTOSIZE); //create a window with the name "MyWindow"
imshow("MyWindow", img); //display the image which is stored in the 'img' in the "MyWindow" window
waitKey(0); //wait infinite time for a keypress
destroyWindow("MyWindow"); //destroy the window with the name, "MyWindow"
return 0;
}
and the error is:
1>Build started 7/28/2013 3:08:34 AM.
1>InitializeBuildStatus:
1> Touching "Debug\opencv_2.0.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1>ResourceCompile:
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>core.obj : error LNK2019: unresolved external symbol "void __cdecl cv::destroyWindow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?destroyWindow#cv##YAXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) referenced in function _main
1>core.obj : error LNK2019: unresolved external symbol "int __cdecl cv::waitKey(int)" (?waitKey#cv##YAHH#Z) referenced in function _main
1>core.obj : error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow#cv##YAXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV_InputArray#1##Z) referenced in function _main
1>core.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray#cv##QAE#ABVMat#1##Z) referenced in function _main
1>core.obj : error LNK2019: unresolved external symbol "void __cdecl cv::namedWindow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?namedWindow#cv##YAXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) referenced in function _main
1>core.obj : error LNK2019: unresolved external symbol "class cv::Mat __cdecl cv::imread(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?imread#cv##YA?AVMat#1#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) referenced in function _main
1>core.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree#cv##YAXPAX#Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat#cv##QAE#XZ)
1>core.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate#Mat#cv##QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release#Mat#cv##QAEXXZ)
1>core.obj : error LNK2019: unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd#cv##YAHPAHH#Z) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release#Mat#cv##QAEXXZ)
1>C:\Users\Parker\documents\visual studio 2010\Projects\opencv_2.0\Debug\opencv_2.0.exe : fatal error LNK1120: 9 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.67
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I did try adding the .lib files in the additional dependencies, but vs2010 said it does not detect them, since I did see another post with a problem just like mine. The include directory includes the generic "include" folder along with the opencv and opencv2 folders. I then added the build\x64\vc10\lib, bin and staticlib to the additional lib dirs. The opencv was also extracted to just the c:\ drive so there should not be any problem there. I thank everyone in advance for your help!
just replace:
opencv_highgui243.lib
on:
opencv_highgui243d.lib
Probably, you have included release libraries instead of debug versions.
Because you have built in debug mode, libraries should also be of debug version like:
opencv_highgui243d.lib
instead of
opencv_highgui243.lib
Related
I downloaded OpenCV from NuGet on MSVS 2017, and ran a code I had found on this very site:
#include "stdafx.h"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat image = imread("C:\\Users\\Chubak\\Pictures\\index.jpg");
if (image.empty())
return -1;
imshow("TEST", image);
waitKey();
return 0;
}
But when I run the code I get this extremely unintelligible errors that I don't understand:
1>------ Build started: Project: OpenCLTest, Configuration: Debug Win32 ------
1>OpenCLTest.cpp
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree#cv##YAXPAX#Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat#cv##QAE#XZ)
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray#cv##QAE#ABVMat#1##Z) referenced in function _main
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate#Mat#cv##QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release#Mat#cv##QAEXXZ)
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd#cv##YAHPAHH#Z) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release#Mat#cv##QAEXXZ)
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "int __cdecl cv::waitKey(int)" (?waitKey#cv##YAHH#Z) referenced in function _main
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow#cv##YAXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV_InputArray#1##Z) referenced in function _main
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "class cv::Mat __cdecl cv::imread(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?imread#cv##YA?AVMat#1#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) referenced in function _main
1>c:\users\chubak\documents\visual studio 2017\Projects\OpenCLTest\Debug\OpenCLTest.exe : fatal error LNK1120: 7 unresolved externals
1>Done building project "OpenCLTest.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I understand that unresolved externals error is related to missing obj files but don't they come with the NuGet Package?
I also found this question but all the links given in the answers are no longer working, so this may or may not be a duplicate.
OpenCV => 3.1.0
Operating System / Platform => Windows 10 / x64
Compiler => Visual Studio 2013
Detailed description
I wrote my code based on the example given on opencv github page for SURF matcher using CUDA.
When I try to build, i get the following errors:
1>Testing.obj : error LNK2019: unresolved external symbol "public: static struct cv::Ptr<class cv::cuda::DescriptorMatcher> __cdecl cv::cuda::DescriptorMatcher::createBFMatcher(int)" (?createBFMatcher#DescriptorMatcher#cuda#cv##SA?AU?$Ptr#VDescriptorMatcher#cuda#cv###3#H#Z) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: __cdecl cv::cuda::SURF_CUDA::SURF_CUDA(void)" (??0SURF_CUDA#cuda#cv##QEAA#XZ) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: int __cdecl cv::cuda::SURF_CUDA::defaultNorm(void)const " (?defaultNorm#SURF_CUDA#cuda#cv##QEBAHXZ) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::cuda::SURF_CUDA::downloadKeypoints(class cv::cuda::GpuMat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > &)" (?downloadKeypoints#SURF_CUDA#cuda#cv##QEAAXAEBVGpuMat#23#AEAV?$vector#VKeyPoint#cv##V?$allocator#VKeyPoint#cv###std###std###Z) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::cuda::SURF_CUDA::downloadDescriptors(class cv::cuda::GpuMat const &,class std::vector<float,class std::allocator<float> > &)" (?downloadDescriptors#SURF_CUDA#cuda#cv##QEAAXAEBVGpuMat#23#AEAV?$vector#MV?$allocator#M#std###std###Z) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::cuda::SURF_CUDA::operator()(class cv::cuda::GpuMat const &,class cv::cuda::GpuMat const &,class cv::cuda::GpuMat &,class cv::cuda::GpuMat &,bool)" (??RSURF_CUDA#cuda#cv##QEAAXAEBVGpuMat#12#0AEAV312#1_N#Z) referenced in function main
1><computer_dir>\TestCode\x64\Debug\TestCode.exe : fatal error LNK1120: 6 unresolved externals
All libraries seem to be linked properly and I am not getting any error while writing the code.
It would be great if anyone could say what the error is. Thanks!
#include <dcmtk\oflog\config.h>
#include <dcmtk\dcmimgle\dcmimage.h>
#include <dcmtk\dcmnet\dicom.h>
#include <dcmtk\config\osconfig.h>
#include <iostream>
#include <fstream>
#include <ostream>
#include <iomanip>
#include<dcmtk\ofstd\ofstream.h>
#include<dcmtk\dcmdata\dctk.h>
int main(int argc, char *argv[])
{
OFLog::configure(OFLogger::INFO_LOG_LEVEL);
DicomImage *image = new DicomImage("E:\\datamining project\\dataset\\Lung CT image\\nodules\\nodules\\23.dcm", CIF_UsePartialAccessToPixelData, 0, 10 /* fcount */);
if (image->getStatus() == EIS_Normal)
{
do {
DCMIMGLE_INFO("processing frame " << image->getFirstFrame() + 1 << " to "<< image->getFirstFrame() + image->getFrameCount());
} while (image->processNextFrames());
}
delete image;
return 0;
}
Error 1 error LNK2019: unresolved external symbol "public: __thiscall OFString::~OFString(void)" (??1OFString##QAE#XZ) referenced in function _main c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
Error 2 error LNK2019: unresolved external symbol "public: __thiscall OFString::OFString(char const *)" (??0OFString##QAE#PBD#Z) referenced in function _main c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
Error 3 error LNK2019: unresolved external symbol "class OFLogger __cdecl DCM_dcmimgleGetLogger(void)" (?DCM_dcmimgleGetLogger##YA?AVOFLogger##XZ) referenced in function _main c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
Error 4 error LNK2019: unresolved external symbol "public: __thiscall DicomImage::DicomImage(char const *,unsigned long,unsigned long,unsigned long)" (??0DicomImage##QAE#PBDKKK#Z) referenced in function _main c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
Error 5 error LNK2019: unresolved external symbol "public: static void __cdecl OFLog::configure(enum OFLogger::LogLevel)" (?configure#OFLog##SAXW4LogLevel#OFLogger###Z) referenced in function _main c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
Error 6 error LNK2019: unresolved external symbol "public: bool __thiscall log4cplus::Logger::isEnabledFor(int)const " (?isEnabledFor#Logger#log4cplus##QBE_NH#Z) referenced in function "public: bool __thiscall OFLogger::isEnabledFor(int)const " (?isEnabledFor#OFLogger##QBE_NH#Z) c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
Error 7 error LNK2019: unresolved external symbol "public: void __thiscall log4cplus::Logger::forcedLog(int,class OFString const &,char const *,int,char const *)const " (?forcedLog#Logger#log4cplus##QBEXHABVOFString##PBDH1#Z) referenced in function "public: void __thiscall OFLogger::forcedLog(int,class OFString const &,char const *,int,char const *)const " (?forcedLog#OFLogger##QBEXHABVOFString##PBDH1#Z) c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
error LNK2019: unresolved external symbol "public: virtual __thiscall log4cplus::Logger::~Logger(void)" (??1Logger#log4cplus##UAE#XZ) referenced in function "public: virtual __thiscall OFLogger::~OFLogger(void)" (??1OFLogger##UAE#XZ) c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
error LNK1120: 8 unresolved externals c:\users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\Debug\dcmimage.exe dcmimage
I don't have CMake installed at the moment on my machine, so I can't try this out myself.
Looks likes you have to build various libraries, this one looks particularly interesting: ofstd.lib. Then there's also oflog.lib.
Please make sure that you linked the following libraries to your project (Project Properties --> Linker --> Input --> Additional Dependencies):
oflog.lib;ofstd.lib;iphlpapi.lib;ws2_32.lib;netapi32.lib;wsock32.lib
I'm using OpenCV 2.4.6 and Visual Studio 2008 with Windows8.1 x86.
When I debug my program it signal me 9 errors:
1>FYD_control.obj : error LNK2019: unresolved external symbol "int __stdcall cv::waitKey(int)" (?waitKey#cv##YGHH#Z) referenced in function _main
1>FYD_control.obj : error LNK2019: unresolved external symbol "void __stdcall cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow#cv##YGXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV_InputArray#1##Z) referenced in function _main
1>FYD_control.obj : error LNK2019: unresolved external symbol "double __stdcall cv::threshold(class cv::_InputArray const &,class cv::_OutputArray const &,double,double,int)" (?threshold#cv##YGNABV_InputArray#1#ABV_OutputArray#1#NNH#Z) referenced in function _main
1>FYD_control.obj : error LNK2019: unresolved external symbol "void __stdcall cv::cvtColor(class cv::_InputArray const &,class cv::_OutputArray const &,int,int)" (?cvtColor#cv##YGXABV_InputArray#1#ABV_OutputArray#1#HH#Z) referenced in function _main
1>FYD_control.obj : error LNK2019: unresolved external symbol "void __stdcall cv::medianBlur(class cv::_InputArray const &,class cv::_OutputArray const &,int)" (?medianBlur#cv##YGXABV_InputArray#1#ABV_OutputArray#1#H#Z) referenced in function _main
1>FYD_control.obj : error LNK2019: unresolved external symbol "void __stdcall cv::fastFree(void *)" (?fastFree#cv##YGXPAX#Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat#cv##QAE#XZ)
1>FYD_control.obj : error LNK2019: unresolved external symbol "int __stdcall cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd#cv##YGHPAHH#Z) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release#Mat#cv##QAEXXZ)
1>FYD_control.obj : error LNK2019: unresolved external symbol "void __stdcall cv::error(class cv::Exception const &)" (?error#cv##YGXABVException#1##Z) referenced in function "public: int & __thiscall cv::Mat::at<int>(int,int)" (??$at#H#Mat#cv##QAEAAHHH#Z)
1>C:\Users\___________________________\Debug\FYD2_Control.exe : fatal error LNK1120: 8 unresolved externals
1>Build log was saved at "file://c:\Users\_________________\Debug\BuildLog.htm"
1>FYD2_Control - 9 error(s), 0 warning(s)
I've analized everything and I've noticed that while in this errors I have
(?waitKey#cv##YGHH#Z)
(?imshow#cv##YGXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV_InputArray#1##Z)
(?threshold#cv##YGNABV_InputArray#1#ABV_OutputArray#1#NNH#Z)
(?cvtColor#cv##YGXABV_InputArray#1#ABV_OutputArray#1#HH#Z)
(?medianBlur#cv##YGXABV_InputArray#1#ABV_OutputArray#1#H#Z)
(?fastFree#cv##YGXPAX#Z)
(?_interlockedExchangeAdd#cv##YGHPAHH#Z)
(?error#cv##YGXABVException#1##Z)
if I analize the .lib there is the same, but with A instead the first G
(?waitKey#cv##YAHH#Z)
(?imshow#cv##YAXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV_InputArray#1##Z)
(?threshold#cv##YANABV_InputArray#1#ABV_OutputArray#1#NNH#Z)
(?cvtColor#cv##YAXABV_InputArray#1#ABV_OutputArray#1#HH#Z)
(?medianBlur#cv##YAXABV_InputArray#1#ABV_OutputArray#1#H#Z)
(?fastFree#cv##YAXPAX#Z)
(?_interlockedExchangeAdd#cv##YAHPAHH#Z)
(?error#cv##YAXABVException#1##Z)
Substituting the A with G in the .lib I solve this problem, but later it gives me an other error
The procedure entry point ?fastFree#cv##YGXPAX#Z could not be
located in the dynamic link library
How can I solve this?
Sorry for my english and thank's to anyone will answer.
you have problem with linking. replacing A with G in your library wont help. Make sure that you have added all libraries in additional dependencies. Below are the most necessary lib files make sure you have included it.
highgui210d.lib
cxcore210d.lib
cv210d.lib
Once you have done this if u still get error then go to lib folder of opencv (C:\opencv\build\x86\vc12\lib) and add all the lib files to additional dependencies (right click on your project select properties->configuration properties->linker->input then on right pane locate additional dependencies then add all lib file names) of your project.
I'm trying to get a simple example working using gSoap, for VS2008.
I've done the following:
wsdl2h -o Init.h http://myservices/InitalisationService.asmx?WSDL
And then this:
soapcpp2 -I "C:\3pSDK\gsoap-2.7\gsoap\import" -i -C -limport Init.h
which produces many files. My project folder looks like this:
// generated files
Init.h
InitalisationServiceSoap.initalizePlayer.req.xml
InitalisationServiceSoap.initalizePlayer.res.xml
InitalisationServiceSoap.nsmap
InitalisationServiceSoap12.initalizePlayer.req.xml
InitalisationServiceSoap12.initalizePlayer.res.xml
InitalisationServiceSoap12.nsmap
ortC.cpp
ortH.h
ortInitalisationServiceSoap12Proxy.cpp
ortInitalisationServiceSoap12Proxy.h
ortInitalisationServiceSoapProxy.cpp
ortInitalisationServiceSoapProxy.h
ortMatlab.c
ortMatlab.h
ortStub.h
// Project Files
ReadMe.txt
stdafx.cpp
stdafx.h
WebServicesClient.cpp
WebServicesClient.vcproj
targetver.h
// files added to the project from gSoap folder
stdsoap2.cpp
stdsoap2.h
typemap.dat
When I build, I get a lot of linker errors (unresolved externals). I can't find anything to link against (e.g. no binary libraries) - what am I missing?
I believe that this may have something to do with the following from the docs:
To complete the build, compile and
link the generated soapC.cpp,
soapcalcProxy.cpp, and the run-time
gSOAP engine -lgsoap++ (or use source
stdsoap2.cpp in case libgsoap++.a is
not installed) with your code.
is there a gsoap++ library for win32?
1>Compiling...
1>WebServicesClient.cpp
1>ortC.cpp
1>Generating Code...
1>Linking...
1>stdsoap2.obj : error LNK2019: unresolved external symbol _soap_faultcode referenced in function _http_response
1>stdsoap2.obj : error LNK2001: unresolved external symbol _namespaces
1>stdsoap2.obj : error LNK2019: unresolved external symbol _soap_getheader referenced in function _soap_recv_header
1>stdsoap2.obj : error LNK2019: unresolved external symbol _soap_faultsubcode referenced in function _soap_set_fault
1>stdsoap2.obj : error LNK2019: unresolved external symbol _soap_faultstring referenced in function _soap_set_fault
1>stdsoap2.obj : error LNK2019: unresolved external symbol _soap_putfault referenced in function _soap_send_fault
1>stdsoap2.obj : error LNK2019: unresolved external symbol _soap_putheader referenced in function _soap_send_fault
1>stdsoap2.obj : error LNK2019: unresolved external symbol _soap_serializefault referenced in function _soap_send_fault
1>stdsoap2.obj : error LNK2019: unresolved external symbol _soap_serializeheader referenced in function _soap_send_fault
1>stdsoap2.obj : error LNK2019: unresolved external symbol _soap_getfault referenced in function _soap_recv_fault
1>stdsoap2.obj : error LNK2019: unresolved external symbol _soap_faultdetail referenced in function _soap_set_error
1>ortC.obj : error LNK2019: unresolved external symbol "void * __cdecl soap_class_id_enter(struct soap *,char const *,void *,int,unsigned int,char const *,char const *)" (?soap_class_id_enter##YAPAXPAUsoap##PBDPAXHI11#Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * __cdecl soap_in_std__string(struct soap *,char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *,char const *)" (?soap_in_std__string##YAPAV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PAUsoap##PBDPAV12#1#Z)
1>ortC.obj : error LNK2019: unresolved external symbol "int __cdecl soap_putindependent(struct soap *)" (?soap_putindependent##YAHPAUsoap###Z) referenced in function "int __cdecl soap_put_std__string(struct soap *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const *,char const *,char const *)" (?soap_put_std__string##YAHPAUsoap##PBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PBD2#Z)
1>ortC.obj : error LNK2019: unresolved external symbol "int __cdecl soap_getindependent(struct soap *)" (?soap_getindependent##YAHPAUsoap###Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * __cdecl soap_get_std__string(struct soap *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *,char const *,char const *)" (?soap_get_std__string##YAPAV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PAUsoap##PAV12#PBD2#Z)
1>ortC.obj : error LNK2019: unresolved external symbol "int __cdecl soap_fdelete(struct soap_clist *)" (?soap_fdelete##YAHPAUsoap_clist###Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * __cdecl soap_instantiate_std__string(struct soap *,int,char const *,char const *,unsigned int *)" (?soap_instantiate_std__string##YAPAV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PAUsoap##HPBD1PAI#Z)
1>ortC.obj : error LNK2019: unresolved external symbol "void __cdecl soap_default_int(struct soap *,int *)" (?soap_default_int##YAXPAUsoap##PAH#Z) referenced in function "public: virtual void __thiscall _ns1__initalizePlayerResponse::soap_default(struct soap *)" (?soap_default#_ns1__initalizePlayerResponse##UAEXPAUsoap###Z)
1>ortC.obj : error LNK2019: unresolved external symbol "int __cdecl soap_out_int(struct soap *,char const *,int,int const *,char const *)" (?soap_out_int##YAHPAUsoap##PBDHPBH1#Z) referenced in function "int __cdecl soap_out__ns1__initalizePlayerResponse(struct soap *,char const *,int,class _ns1__initalizePlayerResponse const *,char const *)" (?soap_out__ns1__initalizePlayerResponse##YAHPAUsoap##PBDHPBV_ns1__initalizePlayerResponse##1#Z)
1>ortC.obj : error LNK2019: unresolved external symbol "int __cdecl soap_ignore_element(struct soap *)" (?soap_ignore_element##YAHPAUsoap###Z) referenced in function "class _ns1__initalizePlayerResponse * __cdecl soap_in__ns1__initalizePlayerResponse(struct soap *,char const *,class _ns1__initalizePlayerResponse *,char const *)" (?soap_in__ns1__initalizePlayerResponse##YAPAV_ns1__initalizePlayerResponse##PAUsoap##PBDPAV1#1#Z)
1>ortC.obj : error LNK2019: unresolved external symbol "int * __cdecl soap_in_int(struct soap *,char const *,int *,char const *)" (?soap_in_int##YAPAHPAUsoap##PBDPAH1#Z) referenced in function "class _ns1__initalizePlayerResponse * __cdecl soap_in__ns1__initalizePlayerResponse(struct soap *,char const *,class _ns1__initalizePlayerResponse *,char const *)" (?soap_in__ns1__initalizePlayerResponse##YAPAV_ns1__initalizePlayerResponse##PAUsoap##PBDPAV1#1#Z)
1>G:\Prototypes\WebServicesClient\Debug\WebServicesClient.exe : fatal error LNK1120: 19 unresolved externals
1>Build log was saved at "file://g:\Prototypes\WebServicesClient\WebServicesClient\Debug\BuildLog.htm"
1>WebServicesClient - 20 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Okay, for those frustrated with the docs on the gSoap site, using VS2008 to compile a quick client only example, here's the steps (servers are different).
Generate the header file from the WSDL:
wsdl2h -o Init.h http://bleh.com/myservice.asmx?WSDL
Generate the soap client files:
soapcpp2 -C -IC:\3pSDK\gsoap-2.7\gsoap\import Init.h
Ensure you add the following files to your solution for build:
soapC.cpp, soapClient.cpp, and stdsoap2.cpp
Ensure that, for each of these files, you select the compiler option "Not using Pre-Compiled headers". (file Properties -> C++ -> Precompiled Headers -> Create/Use Precompiled header).
Finally, add the .nsmap file generated for your proxy to the stdafx.h (or in your main if your project isn't using pre-compiled headers).
Here's a sample that makes a simple query:
// WebServicesClient.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "init/soapInitServiceSoapProxy.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
std::string user = "AAAA";
std::string pass = "BBBB";
InitServiceSoap service;
_ns1__initPlayer query;
_ns1__initPlayerResponse ans;
query.psParam1 = &user;
query.psParam2 = &pass;
if( service.__ns2__initPlayer(&query, &ans) == SOAP_OK )
{
cout << "success!" << endl;
}
cin.get();
return 0;
}
hope this helps someone!