Getting the examples in libspotify to work under Windows 7 - c

I want to get started with libspotify on my Win 7 machine but I dont have a clue on how to get it all setup so that I can even run the examples included in the pack. I have a Spotify Premium account and I have tried installing libspotify by copying libspotify.dll to c:\windows, c:\windows\system32 and to c:\windows\SysWOW64 and also changed the path variable to include the path where libspotify.dll is located but I still dont understand how to get the examples to work.
I have Code::Blocks installed but as soon as I try to import and run any of the .c files included in the /examples/ folder I get all kinds of error messages. The truth is that I am not even sure how to install libspotify and the documentation is absolutely non existent so for a beginner it is impossible to even have a chance at getting started.
Is there somebody out there who can do a simple walkthrough on how to install libspotify and get the examples up and running on a Win 7 (64-bit) machine?
The only thing I really want to do with libspotify is to be able to via a command prompt or something like that be able to queue a song in Spotify so I dont really care about the other parts. But I can probably solve that by myself as long as I can get an example up and running.

Sadly libspotify is not well-supported on Windows, in fact the example code won't even build because there is no Windows audio driver for them. Your best bet to just get up and running would be to use mingw, or linux in a VirtualBox environment.

Related

How to synchronize code files on windows with WSL/linux?

Basically I have some C/C++ code that I need to build and debug on a Linux machine. Unfortunately, my windows laptop doesn't have enough free hard space to install some Linux dist nor does it have enough free RAM to comfortably run VM.
Until now, I dealt with it rather comfortably using WSL, but the scale was rather small. It was easy to edit and debug 2-3 .c files through CLI and gdb, but it became really annoying on a large scale projects.
I want something simple as "edit code in windows IDE [X], compile it on remote Linux/WSL (the project uses Makefiles), and preferably debug it via gdb".
VS has something close to what I want, but it can't deal with existing Linux projects. It needs to create a new configuration which is alien to the project's Makefile.
I know this question is a bit old, but I think the solution is to make a symlink between your WSL folder and the Window's folder. This is how I handled it for a Ubuntu-20.04 WSL:
Access PowerShell in Administrator mode
Type cmd.exe in the PowerShell
Once cmd.exe is opened, type mklink /d C:\<path_to_your_Windows_folder> \\wsl$\Ubuntu-20.04\home\<your_user>\<path_to_your_WSL_folder>
EDIT
This was tested under Windows 10 Version 2004 with WSL2
I'm unsure about C and C++ but it sounds like this is exactly the same as how i work in node and javascript every day.
I checkout my code using git inside WSL to a location like /mnt/c/code/myproject. Then using sublime/VS code/webstorm i edit the files in windows in the location c:\code\myproject this works really well and have been doing this every day for over a year.
Things to be aware of are that you need to ensure that your editor of choice saves files with linux line endings and that all command line operations are done inside WSL.
Please see this article to see the differences between windows and linux files and how this works inside the WSL.
I want something simple as "edit code in windows IDE , compile it on remote linux/WSL
You will have something as simple as that.
Only with Windows 19.03 though:
See "Updated WSL in Windows 10 version 1903 lets you access Linux files from Windows"
Microsoft's Craig Loewen says:
In the past, creating and changing Linux files from Windows resulted in losing files or corrupting data. Making this possible has been a highly requested and long anticipated feature. We're proud to announce you can now easily access all the files in your Linux distros from Windows.
So how does this work? He goes on to explain:
To put it briefly: a 9P protocol file server facilitates file related requests, with Windows acting as the client.
We've modified the WSL init daemon to include a 9P server. This server contains protocols that support Linux metadata, including permissions.
There is a Windows service and driver that acts as the client and talks to the 9P server (which is running inside of a WSL instance).
Client and server communicate over AF_UNIX sockets, since WSL allows interop between a Windows application and a Linux application using AF_UNIX as described in this post.
Warning:
The old rules still apply, you should NOT access your Linux files inside of the AppData folder!
If you try to access your Linux files through your AppData folder, you are bypassing using the 9P server, which means that you will not have access to your Linux files, and you could possibly corrupt your Linux distro.

Make netbeans use virtual box guest installation of phpunit

We use netbean's phpunit / unit testing plugins for all our testing. We used to use xampp and point netbeans at our our .bat file from the xampp installation. We recently started using vagrant and are now running our dev environment in virtual box. I would like to make netbeans use the installation of phpunit within the virtual machine. This would save us from having to have both installed. Is this even possible? Netbeans seems to want a file location and I am stumped as to how I can go about doing this.
[EDIT] I've created a custom batch file that uses vbox guestconrols to forward the commands to the VMs installation of phpunit. I am going to then point netbeans at my custom .bat file. My problem is, now, that guestcontrols doesn't seem to be forwarding --bootstrap. It seems to be trying to take it and use it, rather than forward it along. The docs say that all the additional arguments will just be passed on, but that doesn't seem to be the case. Here is what I am using in my my_phpunit.bat :
[my_phpunit.bat]
#echo off
if "%VBoxManage%" == "" set VBoxManage=C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
"%VBoxManage%" "--nologo" "guestcontrol" "<my_vm_name>" "execute" "--image" "/usr/bin/php5" "/usr/bin/phpunit" "--verbose" "--username" "<user>" "--password" "<pass>" "--wait-stdout" "--wait-stderr" "CustomNetbeansTestSuite" "<path/to/test/suite>" "--bootstrap" "<path/to/bootstrap>" %7
I am almost there, as running the bat file without the bootstrap option at the end takes me to the unit test. I am getting exceptions because of some autoloader issues(no bootstrap), but if I can figure out a better way to forward these command line arguments to
[EDIT 2]
I think I've finally solved this, but I need to get some issues with my guest OS in order. Once I've been able to test it a bit more, I'll post the final solution. I solved the Vbox guest control issue by adding "--" before I actually sent the parameters that should be forwarded. It said to do so in the docs, but it wasn't entirely clear to me at first.
I just wanted to update that I never actually got the .bat file to work. I think I got pretty close, but I was hung up on some linux CLI output that I couldn't suppress. The .bat file that I ended up with was:
# .bat example
https://pastebin.com/BX1xnL3q
I ended up moving to PhpStorm and everything worked out of the box. So, if you're still using netbeans, you can try and give that a shot. Maybe someone with more unix / linux experience can fix the issues I was having. I feel I was like 99% there with it.

fatal error: call to undefined function mssql_connect() on mac osx lion 10.7.4

So, I can execute php scripts from the terminal, but when the script tries to connect to the database using mssql_connect(), I run into this problem. I have gone through almost all of the sources available for this problem. But, it seems like I have something different. I'm fairly new to Mac, but I have followed most of the steps like uncommenting
#LoadModule php5_module libexec/apache2/libphp5.so
from the httpd.conf file, turning on the web sharing under system preferences. However, I'm not sure if I need to uncomment php_mysql/(i).dll from the php.ini file as well, since I'm using ms sql and not my sql. Also, I do not seem to have php_mssql70.dll like it was suggested in one of the forums I ran into during my search. But, there are 2 lines in my .ini file that read
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll \\Yes. They both read the same thing.
Can someone point me in the right direction please? I'm not sure if the information I gave is sufficient. But yes, I think I have read and tried to emulate 90% of the forums that claim to solve this problem.
NOTE: This post seemed quite close to what I am trying, given that the user is a noob at this. I haven't really set up PHP, Apache, etc by myself since I have only worked with Php and MySQL in school till now.
How to install/use php on mac v 10.7.2
Since you're not on Windows you need to ignore anyone mentioning anything containing '*.dll'.
Look for extensions.ini which should in the same folder as php.ini, or in a folder very close to it, and you should be able to enable it from there, it should be a .so file. If it is not already there then the extension is not installed at all. I have no idea how to add PHP extensions on OSX, though. :I

Cygwin Gcc - Access

I'm currently on Windows Vista Basic.
I have recently started on Eclipse, and for that I was required to install cygwin.
After that I made an edit in the PATH environment variable in "My Computer>Properties>Advanced Settings". In order to check the functionality, I started cmd-prompt and types
C:>gcc
This gives the following output: ACCESS IS DENIED
I know it's a security permission problem, but I don't know where exactly to do the change in the security settings. Last time I tried it started showing "error-illegal operation" and some error code.
You can not use gcc in your cmd. you must use it in cygwin shell that installed when you install cygwin
You can use gcc without using the cygwin shell !!
But you will probably end up with some configuration problems,
such as not having the correct dll's in the right places.
Another common error that can occur, is if you have multiple instances
of cygwin installed, the search paths get confused and the gcc system
can't find relevant compiler or tries to use the wrong compiler.
All the same this is very possible, I've done it myself hundreds of time,
when testing compilers I have written.
You might want to try invoking 'cc1.exe' for c, or 'cc1plus.exe' for c++,
remember to copy the cygwin dll's into the same directory as cc1 or cc1plus,
Other than that it could be your user account permissions.
Hope this helps.
/Tony

Eclipse cross-compile... how can I do that?

I am developing on a Windows machine using Eclipse in C code.
All the files are physically located on a Linux server.
I am using Eclipse only for editing and code browsing.
When I want to compile, I open a terminal and telnet to the Linux server from which I call a file that sets up few variables and eventually invoke a "make" command.
The server is pretty busy.. I would then like to be able to compile locally [and then just ftp these executable files back to the Linux machine so that I can execute them.. unless Eclipse can do that on its own :) ].... any idea how can that be done? I am not well versed in Eclipse or OS usage.... so if you could answer and explain what I should do.. I would really appreciate...
I changed the Build Command under Project Properties menu by just calling the script file on the server I usually invoke to compile... That looked fairly simple.. well... that was too good to be true... and of course.. it didn't work! I am getting this error if I use the default "make" (Cannot run program "make": Launching failed).... while getting (Cannot run program "T:\compile": Launching failed) if I try to invoke my script file that I use to compile...
thanks,
You should take a look at running a crosstool-ng setup on your windows box inside cygwin. And then have eclipse use that compiler. This will allow you to develop for your target Linux platform easily.
Here's some slides
It sounds like you're developing for a desktop/server platform, so you'll have to make sure you set up your crosstool-ng with the same versions of standard libs as your server has (libc, libstdc++, etc). You also want to make sure your crosstool-ng has the same version of gcc as the target as well.
If you don't want to mess with getting all that setup, you could always install Linux as a virtual machine on your windows box and work inside there.

Resources