Comments (10)
Unfortunately I can't test this because the MingW additions are contributed by others. Perhaps they may offer suggestions here.
I note an addition in "ofxNDIdynloader.h" -
#include <cstddef> // to avoid NULL definition problem
A brief look here shows that it contains a "byte" type. Try excluding that header.
from ofxndi.
hello @leadedge - thanks for the suggestion. unfortunately commenting out that line did not help.
i decided to try using visual studio 2019 while running of_v0.12.0_vs_release.zip as suggested in this guide.
other examples are running fine, however unfortunately when i try running example-receiver i get the same errors.
![image](https://private-user-images.githubusercontent.com/12017938/287554780-be7368a3-36cd-475b-bce8-f36fa4af85fd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU0MjE5OTQsIm5iZiI6MTcyNTQyMTY5NCwicGF0aCI6Ii8xMjAxNzkzOC8yODc1NTQ3ODAtYmU3MzY4YTMtMzZjZC00NzViLWJjZTgtZjM2ZmE0YWY4NWZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA0VDAzNDgxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNmYWQ2MjNiNjBjYTQwZWYyZDQ1MDVjMDBlM2Y0MzM2ZmY0NGY0ODQ5ZjM4OTJmYjU3MTRhNzdiOTlmYzJjNzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.v95f4cYnrbrT8qKzwDcUb8WdnRwAmxrWqJORkFPffH0)
any ideas on how to get this addon working on windows in general ?
from ofxndi.
I set up Openframeworks 12 and Visual Studio 2019 and can compile successfully as long as I use C++ Language standard "Default (ISO C++14 Standard)". If I change to C++17 or C++20 there are all sorts of errors building the Openframeworks library. A quick search indicates that the language standard is related to the 'byte' ambiguous symbol problem.
There are some redundant includes in ofxNDIsender.h but removing these does not prevent the errors.
What language standard are you using? Set this to C++14 for all configurations and platforms and see if this makes a difference.
from ofxndi.
ok that must be the difference - i checked and it was set to using C++17 for my build.
unfortunately when i set it to C++14 as you suggest, a bunch of other errors appear that look like they come from base openframeworks files where atleast C++17 is expected - i can see that:
- ofSingleton.hpp
- ofRandomEngine.h
- ofRandomDistributions.h
are affected.
![image](https://private-user-images.githubusercontent.com/12017938/287581504-372a5db5-4997-4849-ad09-aea73d8810bd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU0MjE5OTQsIm5iZiI6MTcyNTQyMTY5NCwicGF0aCI6Ii8xMjAxNzkzOC8yODc1ODE1MDQtMzcyYTVkYjUtNDk5Ny00ODQ5LWFkMDktYWVhNzNkODgxMGJkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA0VDAzNDgxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVkMjI5Y2NmMGMxMGZkMjAwN2QxZGI4MjBkYzc5NTkzYzk5ODNhYjU5NDk2Y2Y3NGJkODJhNTA0YjIxOWRiNmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.A60NRRtf1aX9qh-c7_WhOT__MtMldX9hLNafdFHFA1k)
im a bit confused how it compiles for you with C++14 if you are also running of0.12 like i am. (also confused why c++17 does not compile for you but it does for me)
in the of0.12 changelog it does say:
all: C++17 default
but not that c++14 support is being dropped... so hmmm would be nice to have this addon compiling for C++17 too.. i can try some more to see how to make it work (although a bit out of my depths)
and in meantime i might try it again with of0.11.2 and see if that is happy compiling C++14
from ofxndi.
Sorry my mistake. I was using of 11.2 and not 12.0. For all the current projects I am using of 11.0 and Visual Studio 2022.
I tried again and now I can't even build for C++14. It's complaining about filesystem -
error C2027: use of undefined type 'std::filesystem::path'
error C2386: 'filesystem': a symbol with this name already exists in the current scope
error C2079: 'ofDirectory::myDir' uses undefined class 'std::filesystem::path'
I think I risk getting into an unrecoverable state. What I will do is set up Openframeworks 12.0 from new on a different computer for Visual Studio 2022, which is what I am using for all the projects, and see if it builds for C++17.
from ofxndi.
I set up of of 12.0 and I think I found the problem. Unfortunately it's not simple but I think there is a way to make ofxNDI work.
Using C++17 breaks the build if you include "shlwapi.h". All is OK if \it's not included. This is used in ofxNDIdynloader to find the executable path and I think I can use some string functions to replace that.
But, more seriously, it also breaks if you include "dx11.h", so all the Spout Openframeworks examples fail for C++17.
The only thing I can do is document this and Openframeworks 11.2 is as far as it goes because dx11.h is definitely required.
It's a failure on the Microsoft side. After some searching, I tried the suggested workarounds but they don't work.
from ofxndi.
thanks a lot for the update!
thats a pain that it breaks so much.
fwiw i got it all working for me using of11.2 and visual studio 2019
tried again on msys2 with c++14 but hit against another error regarding shlwapi.h
(undefined reference to '__imp_PathRemoveFileSpecA',
) decided not to sink any more time on this since the visual studio approach is working anyway..
from ofxndi.
If you get the same error with msys2, it confirms that this is a Microsoft problem.
I am certain that I can bypass shlwapi.dll. I will look at it tomorrow. You are right, these things can consume much more time than they are worth and as soon as there is a solution, that's the only path you can take.
from ofxndi.
Update.
I removed dependence on shlwapi in the addon and the modified files are uploaded to the Master branch. All works well as far as I can tell. I also made modifications to the Spout SDK files but d3d11.h still caused the error when used with Openframeworks.
However, I think I have found the root cause of the problem. Remove "using namespace std" from ofMain.h. The library still builds and d3d11.h no longer conflicts. I don't know exactly why but it enables use of Openframeworks 12 with the Spout SDK.
from ofxndi.
FYI
It turns out that Microsoft acknowledge the problem. Look for "_HAS_STD_BYTE" on this page.
With Visual Studio it can be solved by adding "_HAS_STD_BYTE=0" to the C/C++ Preprocessor Definitons.
I think you can just use "#define _HAS_STD_BYTE 0" in the source code before including anything, but I have not confirmed this.
from ofxndi.
Related Issues (20)
- EXC_BAD_ACCESS when building for macOS (Release only, Debug works) HOT 19
- Proper way to handle multiple receivers HOT 3
- Issues with CopyMemory and unsigned __int32 on macOs HOT 10
- Memory leak on mac osx HOT 12
- macOs - freezing for about 10 seconds when NDI sender is disconnected HOT 5
- RPI 4 support (OpenGL ES 2.0) HOT 2
- ofxNDIutils, rgba_bgra and rgba_bgra_sse2 don't compile in macOS HOT 6
- README could be commented... HOT 11
- macOS errors HOT 10
- ndiSender.GetNDIversion() crashes in macOS HOT 5
- ofmain.h HOT 4
- timecode HOT 7
- should it be possible to send two NDI streams from the same openframeworks app ? HOT 2
- Failing to compile latest commit on macOS HOT 9
- not working in macOS HOT 14
- error when compiling example on raspberry pi 4: undefined reference to ofxNDIutils::CopyImage HOT 8
- not working in macOS 2 HOT 2
- Trouble building example sender with MSYS2 MINGW64 on Windows 11 HOT 2
- Locked FPS? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ofxndi.