[USRP-users] Compiling own code in Visual Studio 2010, 64bit

Stefano Speretta s.speretta at isispace.nl
Thu Dec 18 12:50:05 EST 2014

I am not sure if it is completely related, but I was also trying to 
initialize make with a static char array like you did (but under Linux 
with GCC) and I get this compile error:

no known conversion for argument 1 from âconst char [12]â to âconst 

while everything works fine if I do:

std:string args = "";

If you check the prototype of make 
(http://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__usrp.html), it 
expects a device_addt_t type which is created from an std:string and not 
an unsigned char*. In the end, GCC is generally more strict but does not 
convert anything automatically while I've seen Visual Studio doing it 
with positive and sometimes negative results.


> Hi all,
> I read through so many different pages and approaches how to build 
> your own code using the UHD API, but I did not manage to run 
> everything successfully. Maybe somebody has a hint J
> That's what I have right now:
> ·USRP X310 connected via GigE or PCIe
> ·Installed the lates UHD 64bit release, installed visual studio 
> professional 2010
> ·Boost library is installed as binary with the correct Visual Studio 
> 2010 64bit Version (as I'm using Win7 64bit)
> I tested the uhd_find_device and the uhd_usrp_probe exe-files provided 
> in the UHD installation directory: both worked fine and showed correct 
> results.
> I wanted a simple program: Starting with the thread safe uhd main, and 
> then simply calling ....multi_usrp::make(""); as the USRP 
> is currently connected via Ethernet.
> I set up Visual Studio as follows:
> ·Starting with an empty Win32 console project and changing 
> configuration to X64 (Debug)
> ·In the C++ configuration I add the UHD and Boost include directories
> ·In the Linker configuration I add the UHD lib and the Boost lib as 
> additional library directories
> ·I also add uhd.lib in the "Additional Dependencies" tab
> Everything compiles fine without errors. The Linker also does not 
> through any errors. So far so good. Next, I copied the uhd.dll from 
> the UHD installation directory (bin folder) to where by generated exe 
> lies.
> I start my program and when I reach the ::make statement in my C++ 
> code, I get an access violation. The uhd.dll is found, otherwise my 
> program complains about not finding the dll right at startup.
> Why do I get an access violation? Is it the wrong uhd.dll?
> Best regards,
> Emanuel
> _______________________________________________
> USRP-users mailing list
> USRP-users at lists.ettus.com
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20141218/df1b51b4/attachment-0002.html>

More information about the USRP-users mailing list