building example of canopen from canfestival error - c++

I've got canopen source from canfestival.
I got errors when I built its win32test example on visual stdio,
there wasn't any lib file in file that I downloaded and extracted.
any help would be appreciated.
the errors:
error C2065: 'win32test_obj100C': undeclared identifier
error C2065: 'win32test_obj100D': undeclared identifier

there was a problem in built object dictionary
I make another object dictionary header and source with its .od file in cygwin and the errors gone

Related

Why is my code not compiling when including OpenCV in my Visual Studio Project?

There is too much code to post so I'll be short and sweet here.
I'm migrating a project to Visual Studio that I originally built in Eclipse on OSX, using the OpenCV Apple framework distribution (opencv delivered as a .framework).
I've created a visual studio project from the existing code but when I build it, I get a bunch of errors from one of the headers (opencv2/core/fast_math.hpp) that are included along the header chain of <opencv2/opencv.hpp>.
1>c:\users\blah\tools\lib\opencv\build\include\opencv2\core\fast_math.hpp(105):
error C2065: '__m128d': undeclared identifier
1>c:\users\blah\tools\lib\opencv\build\include\opencv2\core\fast_math.hpp(105):
error C2146: syntax error: missing ';' before identifier 't'
1>c:\users\blah\tools\lib\opencv\build\include\opencv2\core\fast_math.hpp(105):
error C2065: 't': undeclared identifier
1>c:\users\blah\tools\lib\opencv\build\include\opencv2\core\fast_math.hpp(105):
error C3861: '_mm_set_sd': identifier not found
1>c:\users\blah\tools\lib\opencv\build\include\opencv2\core\fast_math.hpp(106):
error C2065: 't': undeclared identifier
Nothing has really changed in my code, just that I'm now using Visual Studio 2017. I have added opencv\build\include to my include path. I see that this code is SIMD intrinsics, which I don't think should have any problem compiling.
Is there a step I'm missing here?
This looks to be something with how I set up the project. The SIMD intrinsics require extra headers. I didn't configure the project to use precompiled headers which also appears to explain why std::string was undefined too. The extra headers can be added in stdafx.h and it's presence resolves other missing components.

Boost C++ libraries generating strange errors

I recently tried to write a c++ program, where I used the build in socket tools you can find in the Boost library. First of all, I tried to make a client/server based program, where the server just sends a message and the client receives it. It worked just fine.
Then I wrote another program, where I used a Xbox 360 kinect, to control my movement. The idea of creating the first program, was the get the code for the socket creating, so I can connect with, i.e. my Samsung tv, to control the tv, using my kinect.
The problem arises, when I copy my code from the first program, into my second program with the kinect. All of sudden, the program gives 100+ error, when compiling the boost library.
I triple checked the including libraries and all, but the problem still arises. Some of the errors are posted below:
1>C:\boost_1_55_0b1\boost/asio/detail/socket_types.hpp(96): error C2143: syntax error : missing ';' before '.'
1>C:\boost_1_55_0b1\boost/asio/detail/socket_types.hpp(96): error C2238: unexpected token(s) preceding ';'
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2224): error C2653: 'Windows' : is not a class or namespace name
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2224): error C2871: 'Collections' : a namespace with this name does not exist
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2225): error C2653: 'Windows' : is not a class or namespace name
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2225): error C2871: 'Networking' : a namespace with this name does not exist
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2226): error C2653: 'Windows' : is not a class or namespace name
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2226): error C2871: 'Connectivity' : a namespace with this name does not exist
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2227): error C2065: 'IVectorView' : undeclared identifier
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2227): error C2065: 'HostName' : undeclared identifier
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2227): error C2059: syntax error : '>'
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2227): error C2653: 'NetworkInformation' : is not a class or namespace name
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2228): error C2065: 'hostnames' : undeclared identifier
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2228): error C2227: left of '->Size' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>C:\boost_1_55_0b1\boost/asio/detail/impl/socket_ops.ipp(2230): error C2065: 'HostName' : undeclared identifier
And many many others. I know by the fact, that the libraries work. It worked in the first program, so I just can't figure out what's causing the problem.
Other includes are the SDL and SDK for Kinect libraries for c++.
I just came across this too. I found by adding the "/P" option to the C++ compiler options in Visual Studio and recompiling the file that failed, that s_addr was indeed getting #defined.
The offending header was part of the Windows SDK inaddr.h, which is included in the header chain of winsock.h.
The offending line in the header was:
#define s_addr S_un.S_addr
More information about this header is on MSDN here.
The fix I found was to #undef s_addr just before the #include of the BOOST ASIO header.

dirent.h casuing problems with ShellAPI.h

I have a function:
SHFileOperationFunc(string item1, string item2, int operation, CuTest *tc)
It is used to do operations (move, delete or copy) directories. It works fine. But i am now trying to use stuff from dirent.h. When I include the file it causes huge problems with stuff from ShellAPI.h I use in SHFileOperationFunc. I got dirent.h as per http://www.softagalleria.net/dirent.php.
After I include the file I get errors like:
error C2065: 'FO_DELETE' : undeclared identifier
error C2065: 'FO_COPY' : undeclared identifier
error C2065: 'FO_DELETE' : undeclared identifier
error C2065: 'FO_DELETE' : undeclared identifier
These are defined in ShellAPI.h. When I hover over them in VS it says the value they have so it is seeing them. Anyone know why including this file is having this effect?
Using dirent.h on a Windows machine is unadvisable, it is a Unix header. The file you downloaded screws up the rest of your #includes. Either put if after #include <windows.h> or edit the file and delete the #define for WIN32_LEAN_AND_MEAN. Putting that in a header is, well, mean. It causes a large number of declarations to be skipped in the Windows headers.

Cannot open include file: 'iProxyTrans.h' - old Directshow project?

I inherited a project that used old opencv, directx and directshow libraries and I'm trying to be able to compile it on a current Windows 7 VS 2010 machine.
Two of the includes that are causing problems are as follows:
#include <iProxyTrans.h>
#include <ProxyTransuids.h>
How can I get this to compile? Are these files simply non-existant now? I tried searching my computer and I could not find it. I have the latest DirectX SDK and Windows SDK. I am also using OpenCV 2.3.1.
edit If I comment these out, I get things such as:
1>someclass.cpp(126): error C2065: 'CLSID_ProxyTransform' : undeclared identifier
1>someclass.cpp(132): error C2065: 'IProxyTransform' : undeclared identifier
1>someclass.cpp(132): error C2065: 'pProxyTrans' : undeclared identifier
1>someclass.cpp(133): error C2065: 'IID_IProxyTransform' : undeclared identifier
Here is where it comes from: ProxyTransuids.h, from OpenCV
// Intel License Agreement
// For Open Source Computer Vision Library

Compiling and using NTL c++ library for Windows

I have compiled the NTL inifite precision integer arithmetic library for c++, using Microsoft Visual Studio 2008. I did as explained, on this site, using the Visual Studio interface, rather than from the command prompt. Actually I would rather do it from the command prompt, but I was not sure how to.
Anyhow, I got the library compiled, and I now want to compile a program using the library, from the command prompt. The program I am trying to compile, has been tested on a linux system, where I compile it with the following
c++ -I/appl/htopopt/Linux_x86_64/NTL-5.4.2/include mpqs.cpp main.cpp -o main -L/appl/htopopt/Linux_x86_64/NTL-5.4.2/lib -lntl -L/appl/htopopt/Linux_x86_64/gmp-4.2.1/lib -lgmp -lm
Nevermind the gmp stuff, I dont have that installed on Windows. It is purely an optional thing that will make the NTL run faster. Anyhow, this works fine on linux. Now on Windows I write the following
cl /EHsc /I D:\Downloads\WinNTL-5_5_2\include mpqs.cpp main.cpp /link /LIBPATH:"D:\Documents\Visual Studio 2008\Projects\ntl\Debug"
But this results in the following errors:
mpqs.cpp
mpqs.cpp(38) : error C2039: 'find_smooth_vals' : is not a member of 'QS'
d:\desktop\qs\mpqs.h(12) : see declaration of 'QS'
mpqs.cpp(41) : error C2065: 'M' : undeclared identifier
mpqs.cpp(41) : error C2065: 'n' : undeclared identifier
mpqs.cpp(42) : error C2065: 'sieve_table' : undeclared identifier
mpqs.cpp(42) : error C2228: left of '.size' must have class/struct/union
type is ''unknown-type''
mpqs.cpp(43) : error C2065: 'sieve_table' : undeclared identifier
mpqs.cpp(44) : error C2065: 'qx_table' : undeclared identifier
mpqs.cpp(44) : error C3861: 'test_smoothness': identifier not found
mpqs.cpp(45) : error C2065: 'smooth_indices' : undeclared identifier
mpqs.cpp(45) : error C2228: left of '.push_back' must have class/struct/union
type is ''unknown-type''
main.cpp
Generating Code...
It is as if, my mpqs.h file is not included into the compilation process? Also I dont understand why it complains about .push_back() for a vector type?
Help is much appreciated!
mpqs.h is definitely being included as the output asks you to refer to it.
Seeing as MPQS.h does not appear to be included in the NTL library ... did you write it? If so can you post the code up?
Also, shouldn't you included the library file somewhere on your build?
Edit: There is no function find_smooth_values so why should you expect MSVC to find it? I'm not sure why that compiles under GCC but its obviously missing. I'm guessing that the other errors are caused because of this one. The errors are telling you things. You should listen to them.
push_back is failing because it doesn't know what the type you are trying to push_back into is. This again is probably caused by the fact that find_smooth_values doesn't exist. Try adding the function prototype into the QS class. This may well fix all your problems.
As for the library it won't get to using the library until the compilation succeeds. So don't worry about that just now. Get in there and fix the errors that MSVC is reporting!