electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
how to set up a visual c++ express thing for compiling ChucK
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 3 [57 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2, 3 Next
Author Message
Dr. Spankenstein



Joined: Mar 03, 2007
Posts: 136
Location: Cambridge
Audio files: 1

PostPosted: Fri Sep 28, 2007 12:25 pm    Post subject: how to set up a visual c++ express thing for compiling ChucK Reply with quote  Mark this post and the followings unread

[Note: I split this off from http://electro-music.com/forum/topic-20675.html , Blue Hell]


I'm not having any luck with Visual C++ Express. It tells me the source files I've downloaded can be opened?

I've downloaded the file from the link under the (build your own) header for the windows platform.

The .tgz file downloads a .tar file and when extracted it is just a unrecognisable file for the compiler? (A file with no extension so counts as a .0 file)

Where am I going wrong folks?

Rhys
Back to top
View user's profile Send private message
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Fri Sep 28, 2007 1:24 pm    Post subject: Reply with quote  Mark this post and the followings unread

In the src folder there is a file chuck_win32.dsp which seems to be a "Microsoft Developer Studio Project File" can you use that one?

The native build environment (using a make file) seems to be based on cygwin and a few extra tools, but the download page was pretty explicit in saying either cygwin or visual c. But otoh I see tools like lex and yacc are needed (or maybe not strictly, there could be some pre-translated stuff), which hints at cygwin again.

I'll download the vc express version to see. This may take a while but I wanted to have look at the ChucK VM anyway Very Happy


edit, NOTE : the following info got sort of lost in the topic split, it's in the old thread :

Quote:
Isn't the express version of visual C for free?

http://msdn2.microsoft.com/en-us/vstudio/Aa700736.aspx

_________________
Jan

Last edited by Blue Hell on Fri Sep 28, 2007 4:55 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Fri Sep 28, 2007 1:52 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, I can open the project file and I can start to compile it. But then I get a lot of errors like ... "can't find windows.h" :shock:

I'm installing the platform SDK now, to see if that helps.

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Fri Sep 28, 2007 2:54 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, installing the platform SDK helps a bit, but still some files can't be found.

Useful pages to get the platform SDK integrated into vc express : here
and here (there was no need apparently to follow steps 4 and 5)

The problem files left are dsound.h and dinput.h - some directX stuff I guess, will have to search a bit now.

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Fri Sep 28, 2007 3:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, looks like the direct X sdk must be installed as well, to be obtained from here - it's pretty big - 500 MB or so, will take a while.

edit: that solved some problems, only one left no in compilation - linking might give some more trouble.

error C2440: 'initializing' : cannot convert from 'const char *' to 'char *' in ugen_xxx.cpp line 2590

Change

char * format = strrchr( filename, '.');

into

char * format = (char *) strrchr( filename, '.');

which is an explicit type cast and that makes the compiler happier.

then indeed I get some linking errors :

Code:
   Creating library Debug/chuck.lib and object Debug/chuck.exp
rtaudio.obj : error LNK2019: unresolved external symbol __imp__CoInitialize@4 referenced in function "public: __thiscall RtApiDs::RtApiDs(void)" (??0RtApiDs@@QAE@XZ)
rtaudio.obj : error LNK2019: unresolved external symbol __imp__CoUninitialize@0 referenced in function "public: virtual __thiscall RtApiDs::~RtApiDs(void)" (??1RtApiDs@@UAE@XZ)
rtaudio.obj : error LNK2019: unresolved external symbol __imp__GetForegroundWindow@0 referenced in function "private: virtual bool __thiscall RtApiDs::probeDeviceOpen(int,enum RtApi::StreamMode,int,int,unsigned long,int *,int)" (?probeDeviceOpen@RtApiDs@@EAE_NHW4StreamMode@RtApi@@HHKPAHH@Z)


Right that might need some time Wink

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Fri Sep 28, 2007 4:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

There seems to be a problem with additional dependencies.

Here is some info about how to see 'm but it's not the complete solution yet, I don't know what extra libs should be included. I now added "User32.lib", "gdi32.lib" and "Advapi32.lib" as mentioned in the link.

What's left now is :

Code:
rtaudio.obj : error LNK2019: unresolved external symbol __imp__CoInitialize@4 referenced in function "public: __thiscall RtApiDs::RtApiDs(void)" (??0RtApiDs@@QAE@XZ)
rtaudio.obj : error LNK2019: unresolved external symbol __imp__CoUninitialize@0 referenced in function "public: virtual __thiscall RtApiDs::~RtApiDs(void)" (??1RtApiDs@@UAE@XZ)


So two to go ...

Edit: the structured answer seems to be

Quote:
You need to add the libraries for the Win32 APIs you're calling to the linker settings. To find out the names of libraries, search up the corresponding API in MSDN.


which I read here.

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Fri Sep 28, 2007 4:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

the complete additional dependencies list I use now reads :

Code:

dinput.lib
odbc32.lib
odbccp32.lib
dsound.lib
dxguid.lib
wsock32.lib
winmm.lib
User32.lib
gdi32.lib
Advapi32.lib
ole32.lib
kernel32.lib
oleaut32.lib


and then I get :

Code:

------ Build started: Project: chuck_win32, Configuration: Debug Win32 ------
Linking...
   Creating library Debug/chuck.lib and object Debug/chuck.exp
Embedding manifest...
Build log was saved at "file://d:\Download\Music\chuck\chuck-source-1.2.1.0\src\Debug\BuildLog.htm"
chuck_win32 - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========



jackson dancing

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Fri Sep 28, 2007 6:03 pm    Post subject: Re: how to set up a visual c++ express thing for compiling C Reply with quote  Mark this post and the followings unread

Dr. Spankenstein wrote:

The .tgz file downloads a .tar file and when extracted it is just a unrecognisable file for the compiler? (A file with no extension so counts as a .0 file)

Where am I going wrong folks?

Rhys


Odd. It should be a dir of files, I know I downloaded the source to plain Windows computers then looked at it when in doubt about functionality that wasn't yet documented. As far as I can tell everything has proper extensions.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dr. Spankenstein



Joined: Mar 03, 2007
Posts: 136
Location: Cambridge
Audio files: 1

PostPosted: Sat Sep 29, 2007 9:21 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks very much for all the info Blue. I think I'm finally set up and ready to tackle the source...if it werent for this weird dowload issue!

Could someone please attach the windows source for me as I'm not getting a .tar file with a folder inside but instead an odd file that nothing can seem to open?!

Thanks again

Rhys

PS. I'm getting the file from:

http://chuck.cs.princeton.edu/release/files/chuck-1.2.1.0.tgz
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Sep 29, 2007 9:33 am    Post subject: Reply with quote  Mark this post and the followings unread

Attached you should find all the files that are in the src directory in a zip. I made this with Ark on Linux, couldn't quickly find how to zip the dir itself so you'll have to extract to a new dir.

This is the main source and should include Windows, Mac or Linux versions.

Let me know if this works out, Visual Studio Express requires SP2 which I don't really want to install on my DAW, I'd like a copy of the .exe if this works out.


chucksrc.zip
 Description:
All files from the src directory in a zip. Doesn't include my edit. ChucK is covered by the GPL.

Download
 Filename:  chucksrc.zip
 Filesize:  907.29 KB
 Downloaded:  244 Time(s)


_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Sep 29, 2007 9:41 am    Post subject: Reply with quote  Mark this post and the followings unread

Oh, and if this works, could you try making a version that has both the Envelope fix and the ASIO one by Philippe?
_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Sat Sep 29, 2007 9:47 am    Post subject: Reply with quote  Mark this post and the followings unread

Dr. Spankenstein wrote:
http://chuck.cs.princeton.edu/release/files/chuck-1.2.1.0.tgz


Strange, that file is OK for me (using an old winzip 8), and seemingly the same one that I used. Can you handle the file posted by Kassen? Alternatively I could zip the tar or the dir-tree with winzip and post that (there is not much extra besides the src folder that Kassen already posted, just some examples and some docs).

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Dr. Spankenstein



Joined: Mar 03, 2007
Posts: 136
Location: Cambridge
Audio files: 1

PostPosted: Sat Sep 29, 2007 9:53 am    Post subject: Reply with quote  Mark this post and the followings unread

Yup Kassen's file works great, I'm guessing its the latest version too. I'm using WinRAR to extract any compressed files.

Will have a go at modifying the code to include the two new envelopes and post you lot the results, which will hopefully work?!

Thanks again for your time

Rhys
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Sep 29, 2007 9:56 am    Post subject: Reply with quote  Mark this post and the followings unread

Assuming dr.S already has working install of ChucK under Windows there's no need for the doc or examples, those also come with the binary-only Win downloads.

I'd like to know what the issue here is/was, as far as I can tell the tar.gz is perfectly fine.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Sat Sep 29, 2007 10:15 am    Post subject: Reply with quote  Mark this post and the followings unread

I had some trouble compiling with __WINDOWS_ASIO__ instead of __WINDOWS_DS__ (assuming that is what I have to do to make an asio version).

On compilation the following headers are missing (rtaudio.cpp line 4675) :

#include "asio/asiosys.h"
#include "asio/asio.h"
#include "asio/asiodrivers.h"

And some libs as well probably, any idea where to get those?

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Dr. Spankenstein



Joined: Mar 03, 2007
Posts: 136
Location: Cambridge
Audio files: 1

PostPosted: Sat Sep 29, 2007 11:11 am    Post subject: Reply with quote  Mark this post and the followings unread

Quote:

You need to add the libraries for the Win32 APIs you're calling to the linker settings. To find out the names of libraries, search up the corresponding API in MSDN.


I've done this and I'm still getting the same error messages?!

I've changed the VC++ directories settings in tools -> options according to what is needed in the configuration properties for chuck_win32 and still no luck!

Hmmm....everything else is fine!
Back to top
View user's profile Send private message
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Sat Sep 29, 2007 11:16 am    Post subject: Reply with quote  Mark this post and the followings unread

What error messages exactly?
_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Sep 29, 2007 12:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
I had some trouble compiling with __WINDOWS_ASIO__ instead of __WINDOWS_DS__ (assuming that is what I have to do to make an asio version).

On compilation the following headers are missing (rtaudio.cpp line 4675) :

#include "asio/asiosys.h"
#include "asio/asio.h"
#include "asio/asiodrivers.h"

And some libs as well probably, any idea where to get those?


based on this;
https://lists.cs.princeton.edu/pipermail/chuck-dev/2007-June/000229.html

I'd say you'll likely need to get those from the RTaudio page;
http://www.music.mcgill.ca/~gary/rtaudio/

Solving problems together is fun! :¬D

Edit; I send Philippe a little mail, perhaps he can help, I'm asuming Ge is terribly bussy as he didn't respond to mails for a while.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Sat Sep 29, 2007 12:24 pm    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:
based on this;
https://lists.cs.princeton.edu/pipermail/chuck-dev/2007-June/000229.html

I'd say you'll likely need to get those from the RTaudio page;
http://www.music.mcgill.ca/~gary/rtaudio/


Laughing Thanks !

But I just found out the same thing the hard way, by googling around as a mad man, and was just about to post something about it Very Happy

didn't have time yet to figure out how to use it, but working on it.

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Sat Sep 29, 2007 12:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hmm, I just copied the asio folder I found in the McGill RtAudio package to the ChucK src folder and hit compile again ... some nasty errors ...
Quote:

d:\download\music\chuck\chuck-source-1.2.1.0\src\rtaudio.cpp(4891) : error C2143: syntax error : missing ';' before ':'
d:\download\music\chuck\chuck-source-1.2.1.0\src\rtaudio.cpp(4891) : error C2143: syntax error : missing ';' before ':'
d:\download\music\chuck\chuck-source-1.2.1.0\src\rtaudio.cpp(4914) : error C2143: syntax error : missing ';' before ':'
d:\download\music\chuck\chuck-source-1.2.1.0\src\rtaudio.cpp(4914) : error C2143: syntax error : missing ';' before ':'
d:\download\music\chuck\chuck-source-1.2.1.0\src\rtaudio.cpp(5138) : error C2039: 'cerr' : is not a member of 'std'
d:\download\music\chuck\chuck-source-1.2.1.0\src\rtaudio.cpp(5138) : error C2065: 'cerr' : undeclared identifier


maybe the files need modification or some setup ....

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
lamarcph



Joined: Oct 21, 2004
Posts: 40
Location: Montreal, Canada
G2 patch files: 4

PostPosted: Sat Sep 29, 2007 1:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:

Hmm, I just copied the asio folder I found in the McGill RtAudio package to the ChucK src folder and hit compile again ... some nasty errors ...


this is "normal". I was able to fix it.
Since asia-rtaudio is normally stripped at the preprocessor level, nobody would find those out.
Back to top
View user's profile Send private message
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Sat Sep 29, 2007 2:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

lamarcph wrote:
I was able to fix it.


Apparently Laughing , would you be willing to tell how you did it?

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Sep 29, 2007 2:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

I just got a mail from lamarcph (philippe) reporting that his test-build (which he send to me) doesn't seem to work but that he's very bussy with school and can't spare much time.

Perhaps this will be seen as a sign that we could use a more official ASIO building process, particularly as these days RT-audio supports building a program for both DX and ASIO. With any luck Ge's new work-place will offer the ASIO enabled Windows machine that Princeton was missing in the past.

Well, I can dream.... :¬)

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lamarcph



Joined: Oct 21, 2004
Posts: 40
Location: Montreal, Canada
G2 patch files: 4

PostPosted: Sat Sep 29, 2007 2:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

sorry about that!

most of it is only typos:


4891 and 4914 -- EM_poplog();

and for 5138, my bad, I just commented out the if--std::cerr block.

it would also be possible, I think, to change
Quote:

std::cerr << "Possible input/output buffersize discrepancy!" << std::endl;


with something like

Quote:

sprintf(message_, "RtApiAsio:Possible input/output buffersize discrepancy! (%s).",
devices_[device].name.c_str());



We should find a way to share the a ASIO / MS build source code on a cvs somewhere.

I hope this helps.

Thanks,
Philippe

Last edited by lamarcph on Sat Sep 29, 2007 3:10 pm; edited 2 times in total
Back to top
View user's profile Send private message
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22292
Location: The Netherlands, Enschede
Audio files: 212
G2 patch files: 319

PostPosted: Sat Sep 29, 2007 3:07 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, thank you gentlemen !

I'm doing some G2 patching / listening currently, but will have a look later, probably tomorrow

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 3 [57 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2, 3 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use