Visual c++ 6.0: error C2065: 'PWR_CString' : undeclared identifier - visual-c++

This error for the following: C:\software\CATS\includes\Commun\xml_transfer.cpp(1527) : error C2065: 'PWR_CString' : undeclared identifier
CString s1; // Empty string
I did include:"stdafx.h" , "resource.h"

Related

Error building CXX object gnuradio-runtime

I am trying to install a specific version of gnuradio (3.7.10.1). To do so I am not using Pybombs, but I try to do it from source (I am following this).
First I've cloned the github repository, then checkout the appropriate version. It worked fine until I've tried to invoke CMake and build GNU Radio:
mkdir build
cd build
cmake ../
make
During the make, after 6% done, I have the following error:
In file included from /usr/include/c++/7/type_traits:35:0,
from /usr/include/cppunit/tools/StringHelper.h:7,
from /usr/include/cppunit/TestAssert.h:8,
from /usr/include/cppunit/TestCase.h:6,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/c++/7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
^~~~~
In file included from /usr/include/cppunit/TestAssert.h:8:0,
from /usr/include/cppunit/TestCase.h:6,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/tools/StringHelper.h:22:15: error: ‘enable_if’ in namespace ‘std’ does not name a template type
typename std::enable_if<!std::is_enum<T>::value, std::string>::type toString(const T& x)
^~~~~~~~~
/usr/include/cppunit/tools/StringHelper.h:22:24: error: expected unqualified-id before ‘<’ token
typename std::enable_if<!std::is_enum<T>::value, std::string>::type toString(const T& x)
^
/usr/include/cppunit/tools/StringHelper.h:31:15: error: ‘enable_if’ in namespace ‘std’ does not name a template type
typename std::enable_if<std::is_enum<T>::value, std::string>::type toString(const T& x)
^~~~~~~~~
/usr/include/cppunit/tools/StringHelper.h:31:24: error: expected unqualified-id before ‘<’ token
typename std::enable_if<std::is_enum<T>::value, std::string>::type toString(const T& x)
In file included from /usr/include/cppunit/TestCase.h:6:0,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestAssert.h: In static member function ‘static std::__cxx11::string CppUnit::assertion_traits<T>::toString(const T&)’:
/usr/include/cppunit/TestAssert.h:74:42: error: ‘toString’ is not a member of ‘CppUnit::StringHelper’
return CPPUNIT_NS::StringHelper::toString(x);
^~~~~~~~
In file included from /usr/include/cppunit/extensions/HelperMacros.h:9:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestCaller.h: At global scope:
/usr/include/cppunit/TestCaller.h:159:37: error: ‘std::function’ has not been declared
TestCaller(std::string name, std::function<void()> test_function, Fixture* fixture):
^~~~~~~~
/usr/include/cppunit/TestCaller.h:159:45: error: expected ‘,’ or ‘...’ before ‘<’ token
TestCaller(std::string name, std::function<void()> test_function, Fixture* fixture):
^
/usr/include/cppunit/TestCaller.h:200:8: error: ‘function’ in namespace ‘std’ does not name a template type
std::function<void()> m_test_function;
^~~~~~~~
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod)’:
/usr/include/cppunit/TestCaller.h:121:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, m_fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:121:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, m_fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:121:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, m_fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod, Fixture&)’:
/usr/include/cppunit/TestCaller.h:138:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, &fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:138:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, &fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:138:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, &fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod, Fixture*)’:
/usr/include/cppunit/TestCaller.h:155:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:155:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:155:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, int)’:
/usr/include/cppunit/TestCaller.h:162:17: error: ‘fixture’ was not declared in this scope
m_fixture(fixture),
^~~~~~~
/usr/include/cppunit/TestCaller.h:162:17: note: suggested alternative: ‘Fixture’
m_fixture(fixture),
^~~~~~~
Fixture
/usr/include/cppunit/TestCaller.h:163:7: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function(test_function)
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:163:23: error: ‘test_function’ was not declared in this scope
m_test_function(test_function)
^~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h: In member function ‘void CppUnit::TestCaller<Fixture>::runTest()’:
/usr/include/cppunit/TestCaller.h:175:7: error: there are no arguments to ‘m_test_function’ that depend on a template parameter, so a declaration of ‘m_test_function’ must be available [-fpermissive]
m_test_function();
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:175:7: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from /usr/include/cppunit/extensions/HelperMacros.h:14:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/extensions/TestNamer.h: In member function ‘std::__cxx11::string CppUnit::TestNamer::getTestNameFor(const string&, const E&) const’:
/usr/include/cppunit/extensions/TestNamer.h:70:95: error: ‘toString’ is not a member of ‘CppUnit::StringHelper’
return getTestNameFor(testMethodName) + " with parameter: " + CPPUNIT_NS::StringHelper::toString(val);
^~~~~~~~
In file included from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h: In static member function ‘static CppUnit::TestSuite* qa_fxpt::suite()’:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: ‘unique_ptr’ is not a member of ‘std’
CPPUNIT_TEST_SUITE_END();
^
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: expected primary-expression before ‘>’ token
CPPUNIT_TEST_SUITE_END();
^
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: ‘guard’ was not declared in this scope
CPPUNIT_TEST_SUITE_END();
^
In file included from /usr/include/cppunit/extensions/HelperMacros.h:9:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestCaller.h: In instantiation of ‘void CppUnit::TestCaller<Fixture>::runTest() [with Fixture = qa_fxpt]’:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:102:1: required from here
/usr/include/cppunit/TestCaller.h:175:22: error: ‘m_test_function’ was not declared in this scope
m_test_function();
~~~~~~~~~~~~~~~^~
/usr/include/cppunit/TestCaller.h:175:22: note: suggested alternative: ‘__fortify_function’
m_test_function();
~~~~~~~~~~~~~~~^~
__fortify_function
gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/build.make:62: recipe for target 'gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/math/qa_fxpt.cc.o' failed
make[2]: *** [gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/math/qa_fxpt.cc.o] Error 1
CMakeFiles/Makefile2:726: recipe for target 'gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/all' failed
make[1]: *** [gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
I am not a Linux expert and I am not very familiar to this compiler/library support. I don't really understand where the error comes from and how to correct it.
I use Ubuntu 18.04.
Coud you give me a hand on this please?
Any help would be very appreciated.
Thanks a lot.
/usr/include/c++/7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
To resolve the above error you need to compile with -std=c++11 flag. Open CMakeLists.txt, find all occurrences or -std=c++98 and change them to -std=c++11. Then go to the build directory, remove CMakeCache.txt and rebuild
sed -i 's/-std=c++98/-std=c++11/g' CMakeLists.txt
cd build
rm CMakeCache.txt
cmake ..
make
Also as the error is in the cppunit and it's used for testing you can try disabling all tests
cd build
rm CMakeCache.txt
cmake -DENABLE_TESTING=OFF ..
make

LNK errors during built project with libcurl added

I've solved for 2 weeks how to build libcurl project. Finally today I managed it, I followed http://curl.haxx.se/libcurl/c/Using-libcurl-with-SSH-support-in-Visual-Studio-2010.pdf but after I wanted to add libcurl to my own project, it throws lot of LNK errors. So here is code my own project, where I want to add libcurl. It's only for downloading file from url:
#include "stdafx.h"
#include "DlData.h"
#include "curl.h"
//#define CURL_STATICLIB
//#pragma comment(lib, "libcurld")
//#pragma comment(lib, "ws2_32")
//#pragma comment(lib, "Wldap32.lib")
size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
{
size_t written = fwrite(ptr, size, nmemb, stream);
return written;
};
int _tmain(int argc, _TCHAR* argv[])
{
DlData test;
test.PrintMsg("this is test!");
test.WaitForClick();
//Part for download file
CURL *curl;
ofstream fp;
CURLcode res;
char *url = "http://football-data.co.uk/mmz4281/1415/E0.csv";
char outfilename[FILENAME_MAX] = "C:\\Users\\zdenik\\Documents\\GitProjects\\Predictor\\Files\\";
curl = curl_easy_init();
if (curl)
{
fp.open(outfilename);
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
fp.close();
}
cin.get();
return 0;
}
I set my project properties properly (C/C++ - General, Preprocessor, Linker - General, Input) and want to build it as application - exe file. So far I everything went well and I was able to create libcurld.lib which I added to linker in my project properties. After I built it, it throws a lot of LNK errors and it looks like there is no lib added. Here is output:
1>------ Build started: Project: Predictor, Configuration: Debug Win32 ------
1> stdafx.cpp
1> Main.cpp
1> DlData.cpp
1> Generating Code...
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: ___iob_func already defined in LIBCMTD.lib(_file.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _calloc already defined in LIBCMTD.lib(dbgcalloc.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgfree.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgmalloc.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _realloc already defined in LIBCMTD.lib(dbgrealloc.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _memmove already defined in LIBCMTD.lib(memmove.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _strchr already defined in LIBCMTD.lib(strchr.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _strncmp already defined in LIBCMTD.lib(strncmp.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _strrchr already defined in LIBCMTD.lib(strrchr.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fopen already defined in LIBCMTD.lib(fopen.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __strtoi64 already defined in LIBCMTD.lib(strtoq.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __errno already defined in LIBCMTD.lib(dosmap.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _tolower already defined in LIBCMTD.lib(tolower.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fseek already defined in LIBCMTD.lib(fseek.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _ftell already defined in LIBCMTD.lib(ftell.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _isalpha already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _isxdigit already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fwrite already defined in LIBCMTD.lib(fwrite.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _strtol already defined in LIBCMTD.lib(strtol.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _strtoul already defined in LIBCMTD.lib(strtol.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _isdigit already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fputc already defined in LIBCMTD.lib(fputc.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _isspace already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _memchr already defined in LIBCMTD.lib(memchr.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fflush already defined in LIBCMTD.lib(fflush.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _isalnum already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _atoi already defined in LIBCMTD.lib(atox.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __lseeki64 already defined in LIBCMTD.lib(lseeki64.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _getenv already defined in LIBCMTD.lib(getenv.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _isupper already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _islower already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _isprint already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _isgraph already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info##AAE#ABV0##Z) already defined in LIBCMTD.lib(typinfo.obj)
1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info##AAEAAV0#ABV0##Z) already defined in LIBCMTD.lib(typinfo.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __read already defined in LIBCMTD.lib(read.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __write already defined in LIBCMTD.lib(write.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __strnicmp already defined in LIBCMTD.lib(strnicmp.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __close already defined in LIBCMTD.lib(close.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __open already defined in LIBCMTD.lib(open.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libcurld.lib(easy.obj) : error LNK2019: unresolved external symbol __imp__WSAStartup#8 referenced in function _win32_init
1>libcurld.lib(telnet.obj) : error LNK2001: unresolved external symbol __imp__WSAStartup#8
1>libcurld.lib(easy.obj) : error LNK2019: unresolved external symbol __imp__WSACleanup#0 referenced in function _win32_cleanup
1>libcurld.lib(telnet.obj) : error LNK2001: unresolved external symbol __imp__WSACleanup#0
1>libcurld.lib(misc.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError#0
1>libcurld.lib(openssl.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError#0
1>libcurld.lib(telnet.obj) : error LNK2019: unresolved external symbol __imp__WSAGetLastError#0 referenced in function _printsub
1>libcurld.lib(tftp.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError#0
1>libcurld.lib(ftp.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError#0
1>libcurld.lib(asyn-thread.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError#0
1>libcurld.lib(select.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError#0
1>libcurld.lib(sendf.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError#0
1>libcurld.lib(connect.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError#0
1>libcurld.lib(global.obj) : error LNK2019: unresolved external symbol _OPENSSL_add_all_algorithms_noconf referenced in function _libssh2_init
1>libcurld.lib(openssl.obj) : error LNK2001: unresolved external symbol _OPENSSL_add_all_algorithms_noconf
...
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_load_error_strings referenced in function _Curl_ossl_init
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_SESSION_free referenced in function _Curl_ossl_session_free
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_set_session referenced in function _ossl_connect_step1
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_get_peer_certificate referenced in function _servercert
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_get_peer_cert_chain referenced in function _verifystatus
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_CTX_set_verify referenced in function _ossl_connect_step1
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_CTX_set_default_passwd_cb referenced in function _cert_stuff
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_CTX_set_default_passwd_cb_userdata referenced in function _cert_stuff
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_CTX_check_private_key referenced in function _cert_stuff
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_new referenced in function _cert_stuff
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_free referenced in function _Curl_ossl_close
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_connect referenced in function _ossl_connect_step2
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_read referenced in function _Curl_ossl_shutdown
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_peek referenced in function _Curl_ossl_check_cxn
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_write referenced in function _ossl_send
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_ctrl referenced in function _verifystatus
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_CTX_ctrl referenced in function _ossl_connect_step1
1>libcurld.lib(openssl.obj) : error LNK2019: unresolved external symbol _SSL_get_error referenced in function _Curl_ossl_shutdown
...
1>C:\Users\zdenik\Documents\GitProjects\Predictor\Debug\Predictor.exe : fatal error LNK1120: 213 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
My question is simple. What could be wrong with my project properties settings or how to set libcurld.lib properly?
I finally done it. I downloaded precompiled version of libcurl for Windows 32bit, but before I compiled code, I noticed there is error in char outfilename[FILENAME_MAX] = "C:\Users\zdenik\Documents\GitProjects\Predictor\Files\" row. It is needed to add name of the file at the end of the path string - C:\Users\zdenik\Documents\GitProjects\Predictor\Files\file.csv e.g. It would not cause compile error but app would crash after it's triggering.
After that code compiled successfully.

Could not install pg module in node.js on Windows 7

I try to install pg module to Node.js using this command: npm install pg
At first I had to install Python. Then PostgreSQL 8.x, then Microsoft Visual C++. But still it I cannot do it. I have errors while compiling:
npm http GET https://registry.npmjs.org/pg
npm http 304 https://registry.npmjs.org/pg
npm http GET https://registry.npmjs.org/generic-pool/1.0.9
npm http 304 https://registry.npmjs.org/generic-pool/1.0.9
> pg#0.7.2 install C:\Users\Adam\node_modules\pg
> node-gyp rebuild || (exit 0)
C:\Users\Adam\node_modules\pg>node "C:\Program Files\nodejs\node_modules\npm\bin
\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
binding.cc
c:\users\adam\.node-gyp\0.8.1\src\node_object_wrap.h(57): warning C4251: 'node:
:ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interface t
o be used by clients of class 'node::ObjectWrap' [C:\Users\Adam\node_modules\pg
\build\binding.vcxproj]
with
[
T=v8::Object
]
..\src\binding.cc(83): error C2061: syntax error : identifier 'EV_P_' [C:\Users
\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(237): error C2146: syntax error : missing ';' before identifi
er 'read_watcher_' [C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(237): error C4430: missing type specifier - int assumed. Note
: C++ does not support default-int [C:\Users\Adam\node_modules\pg\build\binding
.vcxproj]
..\src\binding.cc(237): error C4430: missing type specifier - int assumed. Note
: C++ does not support default-int [C:\Users\Adam\node_modules\pg\build\binding
.vcxproj]
..\src\binding.cc(238): error C2146: syntax error : missing ';' before identifi
er 'write_watcher_' [C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(238): error C4430: missing type specifier - int assumed. Note
: C++ does not support default-int [C:\Users\Adam\node_modules\pg\build\binding
.vcxproj]
..\src\binding.cc(238): error C4430: missing type specifier - int assumed. Note
: C++ does not support default-int [C:\Users\Adam\node_modules\pg\build\binding
.vcxproj]
..\src\binding.cc(86): error C2065: 'w' : undeclared identifier [C:\Users\Adam\
node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(86): error C2227: left of '->data' must point to class/struct
/union/generic type [C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
type is ''unknown-type''
..\src\binding.cc(87): error C2065: 'revents' : undeclared identifier [C:\Users
\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(117): warning C4800: 'int' : forcing value to bool 'true' or
'false' (performance warning) [C:\Users\Adam\node_modules\pg\build\binding.vcxp
roj]
..\src\binding.cc(247): error C2065: 'read_watcher_' : undeclared identifier [C
:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(247): error C3861: 'ev_init': identifier not found [C:\Users\
Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(248): error C2065: 'read_watcher_' : undeclared identifier [C
:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(248): error C2228: left of '.data' must have class/struct/uni
on [C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
type is ''unknown-type''
..\src\binding.cc(249): error C2065: 'write_watcher_' : undeclared identifier [
C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(249): error C3861: 'ev_init': identifier not found [C:\Users\
Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(250): error C2065: 'write_watcher_' : undeclared identifier [
C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(250): error C2228: left of '.data' must have class/struct/uni
on [C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
type is ''unknown-type''
..\src\binding.cc(312): error C2065: 'EV_DEFAULT_' : undeclared identifier [C:\
Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(312): error C2065: 'write_watcher_' : undeclared identifier [
C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(312): error C3861: 'ev_io_start': identifier not found [C:\Us
ers\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(358): error C2065: 'read_watcher_' : undeclared identifier [C
:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(358): error C2065: 'EV_READ' : undeclared identifier [C:\User
s\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(358): error C3861: 'ev_io_set': identifier not found [C:\User
s\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(359): error C2065: 'write_watcher_' : undeclared identifier [
C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(359): error C2065: 'EV_WRITE' : undeclared identifier [C:\Use
rs\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(359): error C3861: 'ev_io_set': identifier not found [C:\User
s\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(384): error C2065: 'EV_ERROR' : undeclared identifier [C:\Use
rs\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(395): error C2065: 'EV_READ' : undeclared identifier [C:\User
s\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(434): error C2065: 'EV_WRITE' : undeclared identifier [C:\Use
rs\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(623): error C2065: 'EV_DEFAULT_' : undeclared identifier [C:\
Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(623): error C2065: 'write_watcher_' : undeclared identifier [
C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(623): error C3861: 'ev_io_stop': identifier not found [C:\Use
rs\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(629): error C2065: 'EV_DEFAULT_' : undeclared identifier [C:\
Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(629): error C2065: 'write_watcher_' : undeclared identifier [
C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(629): error C3861: 'ev_io_start': identifier not found [C:\Us
ers\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(635): error C2065: 'EV_DEFAULT_' : undeclared identifier [C:\
Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(635): error C2065: 'read_watcher_' : undeclared identifier [C
:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(635): error C3861: 'ev_io_stop': identifier not found [C:\Use
rs\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(641): error C2065: 'EV_DEFAULT_' : undeclared identifier [C:\
Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(641): error C2065: 'read_watcher_' : undeclared identifier [C
:\Users\Adam\node_modules\pg\build\binding.vcxproj]
..\src\binding.cc(641): error C3861: 'ev_io_start': identifier not found [C:\Us
ers\Adam\node_modules\pg\build\binding.vcxproj]
gyp ERR! rebuild error Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msb
uild.exe` failed with exit code: 1
gyp ERR! rebuild error at ChildProcess.onExit (C:\Program Files\nodejs\node_
modules\npm\node_modules\node-gyp\lib\build.js:214:23)
gyp ERR! rebuild error at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! rebuild error at Process._handle.onexit (child_process.js:674:10)
gyp ERR! not ok
pg#0.7.2 node_modules\pg
└── generic-pool#1.0.9
Any ideas? Without this module, I cannot connect to my PostgreSQL database through Node.js.

vector equals for type <std::string> works in g++ but not in visual studio 2010

#include<iostream>
#include<vector>
std::vector<std::string> vector1;
int main() {
vector1.push_back("adadad");
std::vector<std::string> vector2;
vector2.push_back("adadd");
if (vector1==vector2) {
std::cout<<"success";
} else {
vector1.swap(vector2);
vector2.clear();
vector2.push_back("adadd");
if (vector1==vector2) {
std::cout<<"success_swap";
}
}
}
Now this works in g++ but not in visual studio. The operator == doesn't work here and throws compilation error in visual studio 2010(ultimate). The same works if the vector is of a integer type.Am I missing something here ? This is not a linux native thing that they have omitted. Why there is a implementation in gcc but not in vc++ ?
The error message that it shows is:
[snip]\vc\include\xutility(2990): error C2678: binary '==' : no operator found which takes a left-hand operand of type 'const std::basic_string<_Elem,_Traits,_Ax>' (or there is no acceptable conversion)
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
[snip]\vc\include\exception(470): could be 'bool std::operator ==(const std::_Exception_ptr &,const std::_Exception_ptr &)'
[snip]\vc\include\exception(475): or 'bool std::operator ==(std::_Null_type,const std::_Exception_ptr &)'
[snip]\vc\include\exception(481): or 'bool std::operator ==(const std::_Exception_ptr &,std::_Null_type)'
[snip]\vc\include\system_error(408): or 'bool std::operator ==(const std::error_code &,const std::error_condition &)'
[snip]\vc\include\system_error(416): or 'bool std::operator ==(const std::error_condition &,const std::error_code &)'
while trying to match the argument list '(const std::basic_string<_Elem,_Traits,_Ax>, const std::basic_string<_Elem,_Traits,_Ax>)'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
[snip]\vc\include\xutility(3030) : see reference to function template instantiation 'bool std::_Equal<_InIt1,_InIt2>(_InIt1,_InIt1,_InIt2)' being compiled
with
[
_InIt1=const std::basic_string<char,std::char_traits<char>,std::allocator<char>> *,
_InIt2=std::_Vector_const_iterator<std::_Vector_val<std::string,std::allocator<std::string>>>
]
[snip]\vc\include\xutility(3051) : see reference to function template instantiation 'bool std::_Equal1<const std::basic_string<_Elem,_Traits,_Ax>*,_InIt2>(_InIt1,_InIt1,_InIt2,std::tr1::true_type)' being compiled
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>,
_InIt2=std::_Vector_const_iterator<std::_Vector_val<std::string,std::allocator<std::string>>>,
_InIt1=const std::basic_string<char,std::char_traits<char>,std::allocator<char>> *
]
[snip]\vc\include\vector(1489) : see reference to function template instantiation 'bool std::equal<std::_Vector_const_iterator<_Myvec>,std::_Vector_const_iterator<_Myvec>>(_InIt1,_InIt1,_InIt2)' being compiled
with
[
_Myvec=std::_Vector_val<std::string,std::allocator<std::string>>,
_InIt1=std::_Vector_const_iterator<std::_Vector_val<std::string,std::allocator<std::string>>>,
_InIt2=std::_Vector_const_iterator<std::_Vector_val<std::string,std::allocator<std::string>>>
]
[snip]\test\main.cpp(8) : see reference to function template instantiation 'bool std::operator ==<std::string,std::allocator<_Ty>>(const std::vector<_Ty> &,const std::vector<_Ty> &)' being compiled
with
[
_Ty=std::string
]
The error happens because in MSVC, std::string's equality operator (==) is not included by <iostream> or <vector>. You have to include <string> as well.
The key line in the message is; "error C2678: binary '==' : no operator found which takes a left-hand operand of type 'const std::basic_string<_Elem,_Traits,_Ax>' (or there is no acceptable conversion)"
You're probably using a really old compiler.
This works for me in MSVS 2005, which isn't that new itself.
If your compiler is C++03 compliant, it should work:
23.2.4
template <class T, class Allocator>
bool operator == ( const vector<T,Allocator>& x,
const vector<T,Allocator>& y);

Export struct defined in winbase.h with ATL's IDL

This is my method defined in IDL:
[id(3), helpstring("method GetBatteryStatus")]
HRESULT GetBatteryStatus([out,retval] SYSTEM_POWER_STATUS_EX2* batteryStatus);
The SYSTEM_POWER_STATUS_EX2 is a struct defined in winbase.h, and this project is a ATLSmartPhone Project, the winbase.h is from Microsoft's SDK.
When I compile the project the error are :
error MIDL2025 : syntax error : expecting a type specification near "SYSTEM_POWER_STATUS_EX2"
If I add import "winbase.h" to the top of the IDL file, the error will be:
error MIDL2003 : redefinition : size_t; error MIDL2003 : redefinition : _LARGE_INTEGER;.....
Then if I add the typedef in in IDL:
typedef[public,uuid(37DE998A-6787-415a-A191-861C315D1248),helpstring("Power Status")]
struct _SYSTEM_POWER_STATUS_EX2 {
...
...
} SYSTEM_POWER_STATUS_EX2;
The error will be:
error C2011: '_SYSTEM_POWER_STATUS_EX2' : 'struct' type redefinition.
So how can I export the SYSTEM_POWER_STATUS_EX2 struct which was defined in winbase.h with IDL?
You can write the IDL version of the SYSTEM_POWER_STATUS_EX2 in the separate IDL file and import it for MIDL only:
cpp_quote("#if 0")
import "fake.idl";
cpp_quote("#else")
cpp_quote("#include <orginial_header>")
cpp_quote("#endif")

Resources