danomatika / ofxPd

(maintained) a Pure Data addon for OpenFrameworks using libpd
Other
202 stars 45 forks source link

Can I use ofxPd with Visual Studio? #64

Closed cuinjune closed 6 years ago

cuinjune commented 6 years ago

Hi, I wonder if it is possible to use ofxPd on Windows using Visual Studio. Thanks in advance!

danomatika commented 6 years ago

Yes, but keep in mind the Pd sources do not currently build in VS AFAICT.

You basically need to build a libpd.lib with MinGW which you can then use in VS with the ofxPd sources. I've done this successfully over the summer and recently overhauled the libpd readme.

The steps are basically:

You may also need a copy of libwinpthread-1.dll in your OF project bin folder as well. You can find a copy in the libpd libs mingw* folders.

danomatika commented 6 years ago

Let me know if this works for you. I'll add this info to the readme when I update ofxPd after the next libpd release.

danomatika commented 6 years ago

I've added the steps to the readme: https://github.com/danomatika/ofxPd#using-ofxpd-with-visual-studio

I was able to build libpd for 64 bit and use it with the ofxPd example in VS2015.

cuinjune commented 6 years ago

Hey @danomatika Thank you so much for the instruction. I followed the steps and I could successfully build an empty ofxPd project. However, when I run the project and try to open a pd patch, I get the following error.

open: \\mac\Home\Zack\OpenFrameworks\of_v0.9.8_vs_release\apps\myApps\MyApplication2\..\..\..\..\..\..\..\..\..\\Mac\Home\Zack\OpenFrameworks\of_v0.9.8_vs_release\apps\myApps\MyApplication2\bin\data\pd\/test.pd: No such file or directory
error: test.pd: read failed; No such file or directory
[ error ] Pd[warning] ofRtAudioSoundStream: stream over/underflow detected 

It seems like it can't properly recognize "pd/test.pd" path when calling pd.openPatch(); I tried changing the path to "pd\test.pd" but it didn't work.

Do you have any idea how to fix this problem? Thank you so much for your help.

danomatika commented 6 years ago

The forward slash at the end of the path looks suspicious. Try changing that to a backslash. The PdTest works for me without any changes to the code or patch.

On Jan 18, 2018, at 1:15 PM, cuinjune notifications@github.com wrote:

Hey @danomatika https://github.com/danomatika Thank you so much for the instruction. I followed the steps and I could successfully build an empty ofxPd project. However, when I run the project and try to open a pd patch, I get the following error.

open: \mac\Home\Zack\OpenFrameworks\of_v0.9.8_vs_release\apps\myApps\MyApplication2..................\Mac\Home\Zack\OpenFrameworks\of_v0.9.8_vs_release\apps\myApps\MyApplication2\bin\data\pd\/test.pd: No such file or directory error: test.pd: read failed; No such file or directory [ error ] Pd[warning] ofRtAudioSoundStream: stream over/underflow detected It seems like it can't properly recognize "pd/test.pd" path when calling pd.openPatch(); I tried changing the path to "pd\test.pd" but it didn't work.

Do you have any idea how to fix this problem? Thank you so much for your help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/danomatika/ofxPd/issues/64#issuecomment-358629441, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdVfapB8Cpw0H3JjLqTwnW6oKxFnv26ks5tLzXsgaJpZM4Redqo.


Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/

cuinjune commented 6 years ago

You mean the "ofxPd/pdExample" right? If I run the project without any changes to the code, I get the following error.

screen shot 2018-01-18 at 10 09 17 pm

I think it happens because it fails to open pd patches as I mentioned before. I tried changing the forward slash to backslash in the path, but it didn't fix the problem. Could this be the problem of running the virtual Windows 10 on my Macbook Pro? (I used Parallels)

Also, when I build the project in Release, I get many errors saying "unresolved external symbol __imp_libpd_init".

screen shot 2018-01-18 at 10 08 29 pm

Do you have any idea why it happens?

cuinjune commented 6 years ago

I followed your instruction using libpd-master branch. Maybe I should have used libpd-update-windows-libs branch instead? I would appreciate if you can confirm this for me.

cuinjune commented 6 years ago

I moved the OF directory to "C:\Users\" and I could successfully open the pd patch. Also, I could build the project in Release too. I needed to add the path to Additional Dependencies. Now, I can successfully run the pdExample using the Visual Studio.

screen shot 2018-01-19 at 12 09 49 am

Although I can hear the sound, the warning messages appear saying "stream over/underflow detected". Can I just ignore these warnings or is there a way to fix this issue? Thank you so much.

danomatika commented 6 years ago

Sounds like an OF problem, although I had no issues building and running with OF on the desktop. Is the projector generator setting the correct paths? Dunno.

On Jan 18, 2018, at 4:08 PM, cuinjune notifications@github.com wrote:

I moved the OF directory to "C:\Users" and I could successfully open the pd patch. Also, I could build the project in Release too. I needed to add the path to Additional Dependencies. Now, I can successfully run the pdExample using the Visual Studio. https://user-images.githubusercontent.com/24947986/35104604-a94e6614-fcac-11e7-9685-971d28a3403e.png Although I can hear sound, the warning messages appear saying "stream over/underflow detected". Can I just ignore this warnings or is there a way to fix this issue? Thank you so much.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/danomatika/ofxPd/issues/64#issuecomment-358675072, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdVfbQ2ZmLjU7I9t21T7Vtcji5YhOljks5tL16DgaJpZM4Redqo.


Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/