WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2011-May-18 16:26:54

riveridea
Member
From: Tennessee Tech Univ.
Registered: 2010-Oct-01
Posts: 100

How to compile PNET.c in 64 bit windows 7?

My host computer running MATLAB is based on 64 bit windows 7.
It is found that the MATLAB can not use the TCP/IP tool box of PNET using the direct downloaded package. Below information is indicated:

Code:

You need to compile pnet.c to a mex-file for your platform. Read the header of pnet.c

I tried the commands provided in the pnet.c file but never succeeded. The LCC compiler for 64 bit can not work at all.

Offline

 

#2 2011-May-19 07:48:05

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: How to compile PNET.c in 64 bit windows 7?

We haven't tried pnet under Windows 7 64-bit. You'll have to dig into the mex documentation to figure out what's breaking compilation. There are some discussions of mex under 64-bit Win7 on Mathworks' site that might help. If you figure it out, please report back so we can update the wiki.

Offline

 

#3 2011-May-19 15:58:51

riveridea
Member
From: Tennessee Tech Univ.
Registered: 2010-Oct-01
Posts: 100

Re: How to compile PNET.c in 64 bit windows 7?

Seems that I solved this problem. You can have a try.

I did not dig into MEX documentation, but found this page about the supported C/C++ compiler for 64 windows for Matlab:
http://www.mathworks.com/support/compil … win64.html

I installed the Microsoft Visual C++ 2010 Express and Windows SDK 7.1 1 in my 64 bit windows 7 and then run below commands:

Code:

 mex -O pnet.c ws2_32.lib
 
Select a compiler: 
[1] Microsoft Visual C++ 2010 Express in C:\Program Files (x86)\Microsoft Visual Studio 10.0 
 
[0] None 
 
Compiler: 1

Now the function pnet can be used directly in my Matlab under windows 7.

I also put this tips to the comments of Mathworks website at http://www.mathworks.com/matlabcentral/ … box-2-0-6,  as some people are also asking the same question there.  Please note to change the #ifdef WIN32 to #ifdef _WIN64 in the PNet.c file

Last edited by riveridea (2011-Jul-28 11:15:14)

Offline

 

#4 2011-May-19 16:08:06

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: How to compile PNET.c in 64 bit windows 7?

Nice! Thanks for posting the directions. I'll update the WARPLab getting started page with a link to your post.

Offline

 

#5 2011-Jul-20 19:19:30

bj1k
Member
Registered: 2011-Jul-04
Posts: 3

Re: How to compile PNET.c in 64 bit windows 7?

Do you know how to make this work for Windows 7 32-bit?
I followed the same steps as above, and then Windows 7 returns not the VisualC++ compiler, but the built-in Lcc compiler in matlab.  Then compiling failed with error message "link of pnet_mex232 failed."

Offline

 

#6 2011-Jul-28 11:18:04

riveridea
Member
From: Tennessee Tech Univ.
Registered: 2010-Oct-01
Posts: 100

Re: How to compile PNET.c in 64 bit windows 7?

bj1k wrote:

Do you know how to make this work for Windows 7 32-bit?
I followed the same steps as above, and then Windows 7 returns not the VisualC++ compiler, but the built-in Lcc compiler in matlab.  Then compiling failed with error message "link of pnet_mex232 failed."

This tip is for 64bit system. For 32bit system, the LCC is supported, as listed in http://www.mathworks.com/support/compil … in32.html, but I don't know why lcc does not work.

Offline

 

Board footer