Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Dev-C++ and WNetUseConnection

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Dev-C++ and WNetUseConnection
#2544
Posted by: 2003-08-23 23:58:58
Why will Dev-C++ not compile this? I get the error
C:Pathmain.o(.text+0x5b):main.cpp: undefined reference to `WNetAddConnection3A@20'

I am using Dev-C++ version 4 Build on 9/21/2000

*********************************************************
#include <iostream>
#include <windows.h>
#include <winnetwk.h>

using namespace std;

int main(int argc, char *argv[])
{
 HWND MyHwnd;
 NETRESOURCE nr;
 nr.dwType = RESOURCETYPE_DISK;

  nr.lpLocalName = "z:"; //local drive
  nr.lpRemoteName = "\\\\my_server\\my_share"; //server path
  nr.lpProvider = NULL;

  WNetAddConnection3A(MyHwnd, &nr, "", "", CONNECT_UPDATE_PROFILE);
  return 0;
}
*********************************************************
Message2. Re: Dev-C++ and WNetUseConnection
#2547
Posted by: guidance 2003-08-24 10:04:50
Are you sure you have adequate libraries and also specified at linker option?
Message3. Re: Dev-C++ and WNetUseConnection
#2548
Posted by: 2003-08-24 11:36:38
I think I know what the problem is. I tried us MSVC++ and had the same trouble. On msdn it states "Library: Use Mpr.lib." So I added that to the linker and it works. I guess now I need to know, how do I add this file to Dev-C++?

Thank-you
Message4. Re: Dev-C++ and WNetUseConnection
#2549
Posted by: guidance 2003-08-24 12:45:50
You should check Mingw gcc site I think, since dev-cpp is only an IDE, not compiler.
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0