|
Hi I have a machine with several network interfaces that route through different NAT VPNs.
I've created a testing application that bind()s to one of these interfaces before calling connect(), which works excellent in Windows 7. When I try the same thing in Windows XP, bind() succeeds, but connect() fails with 10065 (WSAEHOSTUNREACH) after some seconds of blocking. I checked Wireshark, and there isn't even one single packet sent/received on each interface.
Any ideas what may be the problem?
Don't try it, just do it!
|
|
|
|
|
OK, this is probably a stupid question (so I won't be unhappy if I get a stupid answer ) but are you sure the host is reachable through that interface on the XP host? Have you checked with some other network application?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
 yea it is reachable. When i switch the default gateway to the interface i want to use i can reach the hosts.
the routes should be fine.
===========================================================================
Schnittstellenliste
0x1 ........................... MS TCP Loopback interface
0x2 ...00 0c 29 70 8c 43 ...... VMware Accelerated AMD PCNet Adapter - Paketplaner-Miniport
0x10004 ...00 0c 29 70 8c 39 ...... VMware Accelerated AMD PCNet Adapter
===========================================================================
===========================================================================
Aktive Routen:
Netzwerkziel Netzwerkmaske Gateway Schnittstelle Anzahl
0.0.0.0 0.0.0.0 192.168.178.1 192.168.178.28 1
0.0.0.0 0.0.0.0 192.168.179.1 192.168.179.130 100
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.178.0 255.255.255.0 192.168.178.28 192.168.178.28 1
192.168.178.28 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.178.255 255.255.255.255 192.168.178.28 192.168.178.28 1
192.168.179.0 255.255.255.0 192.168.179.130 192.168.179.130 100
192.168.179.130 255.255.255.255 127.0.0.1 127.0.0.1 100
192.168.179.255 255.255.255.255 192.168.179.130 192.168.179.130 100
224.0.0.0 240.0.0.0 192.168.178.28 192.168.178.28 1
224.0.0.0 240.0.0.0 192.168.179.130 192.168.179.130 100
255.255.255.255 255.255.255.255 192.168.178.28 192.168.178.28 1
255.255.255.255 255.255.255.255 192.168.179.130 192.168.179.130 1
Standardgateway: 192.168.178.1
===========================================================================
Ständige Routen:
Keine
Don't try it, just do it!
|
|
|
|
|
I think I've found the reason..
http://technet.microsoft.com/en-us/magazine/cc137807.aspx
Windows XP uses weak host model, Vista and later strong host model. There doesn't seem to be a way to configure this in Windows XP which is particularly ANNOYING!!
Don't try it, just do it!
|
|
|
|
|
Woah - your network-fu is way stronger than mine
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Heya,
So I am trying to work on a make environment that will let me create two libraries and then link against them.
The procedure goes like this:
1. create obj files for lib1 (about a dozen files):
*** Compiling .obj/common.o ...
g++ -O3 -MMD -pipe -pthread -D_REENTRANT -DICL_MEM_DEFAULT_DIRECT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -DBASE_THREADSAFE -march=native -Wall -Wno-write-strings -Wpointer-arith -Wno-ctor-dtor-privacy -Wmultichar -Wdisabled-optimization -Woverloaded-virtual -Wclobbered -Wempty-body -Wsign-compare -Wtype-limits -Wno-unused -Wuninitialized -I./proto -I/tmp/protobuf-2.1.0/include -I/tmp/protobuf-2.1.0/include/google/protobuf -I/tmp/protobuf-2.1.0/include/google/protobuf/io -c proto/common.pb.cc -o .obj/common.o
2. group the object files together into archive
ar rcs lib/libxproto.a ./.obj/cs_enums.o ./.obj/common.o ./.obj/converged_common.o ...<obj list="">
3. repeat for the second lib.
4. compile a few other objs for MY program:
*** Compiling ../BuildSupport/ExternalLinks/utilities/src/Thread.C ...
g++ -O3 -MMD -pipe -pthread -D_REENTRANT -DICL_MEM_DEFAULT_DIRECT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -DBASE_THREADSAFE -march=native -Wall -Wno-write-strings -Wpointer-arith -Wno-ctor-dtor-privacy -Wmultichar -Wdisabled-optimization -Woverloaded-virtual -Wclobbered -Wempty-body -Wsign-compare -Wtype-limits -Wno-unused -Wuninitialized -I./include -I../BuildSupport/ExternalLinks/utilities/include -I./proto -I/tmp/protobuf-2.1.0/include -I/tmp/protobuf-2.1.0/include/google/protobuf -I/tmp/protobuf-2.1.0/include/google/protobuf/io -I/tmp/OpenAMQ-1.4b3/ibase/include -I../BuildSupport/ExternalLinks/boost/include/boost-1_39 -I../BuildSupport/ExternalLinks/utilities/include -I../CaddyShack_Common/amq/include -I../CaddyShack_Common/id/include -c ../BuildSupport/ExternalLinks/utilities/src/Thread.C -o .obj/Thread.o
5. the final step is to compile the objs into an executable, link against the libs:
g++ -static -O3 -MMD -pipe -pthread -D_REENTRANT -DICL_MEM_DEFAULT_DIRECT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -DBASE_THREADSAFE -march=native -Wall -Wno-write-strings -Wpointer-arith -Wno-ctor-dtor-privacy -Wmultichar -Wdisabled-optimization -Woverloaded-virtual -Wclobbered -Wempty-body -Wsign-compare -Wtype-limits -Wno-unused -Wuninitialized -L./lib -lxamq -lxproto <obj list=""> -o ../bin/circuit_accelerator
I get the following error:
./lib/libxamq.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
I tried using ranlib after it, and then just relinking still no good. I also am using the 's' flag when doing the ar, meaning i shouldn't have to do a ranlib.
any ideas on why i would be getting this error? Any ideas on how to resolve it? Thanks in advance!!!
|
|
|
|
|
Are you sure that this is the correct linking order: -L./lib -lxamq –lxproto?
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word.
Advertise here – minimum three posts per day are guaranteed.
|
|
|
|
|
I would investigate any difference in the build processes of libxamq.a and libxproto.a - it looks like ld can find an index in libxproto.a...
Also - I presume you've deleted libxamq.a and rebuilt it from scratch?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Figured it out!!!!
I was using the $< flag for a gcc build in the makefile. I had added a dependency and on some *.h files, meaning that gcc was now trying to compile those, creating some kinda bogus obj files. Thus the lack of an object index....I officially hate makefiles, and feel like an ass. Thanks soo much!
|
|
|
|
|
If you're building a library with make (I'm talking Gnu make here), the approach I've used in the past is just to specify the dependency between the archive and its members and let make work out how to build from the built-in rules, customising the build where necessary using the compiler flag variables.
Consider this situation - I have a library, libtest.a, containing b.o (built from b.c) and c.o (built from c.cpp). Both files are dependent on the header file test.h.
This library is used to build an executable a, which has a main file a.o (built from a.c). a.o is also dependent on test.h
This makefile expresses these dependencies relatively minimally, and also modifies the standard compilation commands (turning on optimisations):
EXE_OBJS = a.o
LIB_OBJS = b.o c.o
LIB_ITEMS = $(foreach dir, $(LIB_OBJS), libtest.a($(dir)))
CFLAGS=-O2
CXXFLAGS=-O2
a : $(EXE_OBJS)
gcc -o a $< -ltest
a : libtest.a
$(EXE_OBJS) : test.h
libtest.a : $(LIB_ITEMS)
$(LIB_OBJS) : test.h
EXE_OBJS is a list of the objects linked directly into the executable. LIB_OBJS is a list of the object files included in the archive. LIB_ITEMS is a simple transformation of LIB_OBJS into archive members (LIB_ITEMS will be libtest.a(b.0) libtest.a(c.o) ).
The rules with commands express the primary dependencies, but the other rules also cause rule commands to be executed. That means that if I modify b.c, the libtest.a and a rules will be invoked (b.c => b.o => libtest.a(b.o) => libtest.a => a), so re-compiling b.c into b.o, inserting b.o into libtest.a and re-linking a.
Similarly, if I modify test.h, the rules mean that all the objects will be re-compiled.
It might be a little more involved, but I find it lets me express the dependencies more correctly (and I can use $< without worrying about including files that shouldn't be )
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I have an IGES file.I have to read this file using c++.
This basically has the graphics data (data realated to lines and otehr geometric entities) in the form of some numbers.
I have no idea how to go about this task.
Please do tell me if there is a way to read an IGES file.
Thnx in advnce.
|
|
|
|
|
If you have the file format specifications and permission to open the file it should be basic programming 101 to code that. If you can't then you need to get some good beginners books or enroll in a University Computer Science program. If you are having a more specific problem then you need to explain what it is so we can help.
|
|
|
|
|
Firstly, Thanx for the reply.
Actually my task here is i have an input iges file.
I have to read the geometry data using c++ from this file and recreate the geometry.
I opened the file in a notepad and i found the data is in the form of some kind of numbers.
I do not know how to read the geomtry from the file.
It wold be very helpfull if you let me know if there are any good links related to this.
Thank you.
|
|
|
|
|
There are some free IGES related tools, some with source code, here[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
raesa wrote: Please do tell me if there is a way to read an IGES file.
Yes there is a way.
A.
First, I assume you already have a 3D graphic engine to display, huh, 3D.
Second, get the IGES specifications, there are a couple of link on the IGES wikipedia page.
Third, read and parse the file to extract 3d entities and convert them to you own internal format.
B.
Get hold of a free converter and convert the IGES file to something you can read.
good luck.
This signature was proudly tested on animals.
|
|
|
|
|
Hi,
With Visual Studio 2008, how can I specify the operating system for who I will compile my application? I develop under Vista but I want to utilize on XP.
Thanks,
Claude
|
|
|
|
|
This can be done by changing the default value of WINVER[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
You could put this in your StdAfx.h file:
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#endif
Use version > 0x0400 otherlise you will get a compile error in VS2008.
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word.
Advertise here – minimum three posts per day are guaranteed.
|
|
|
|
|
I Want to Build Application in VC++ (dialog):
void CFirstVCDlg::OnHello()
{
MessageBox("This is my first Visual C++ Application!");
}
Why error is showed?:
error C2664: 'CWnd::MessageBoxW' : cannot convert parameter 1 from 'const char [41]' to 'LPCTSTR'
thank you
thank you
soso
|
|
|
|
|
Try using
MessageBox(_T("This is my first Visual C++ Application!"));
it should work
|
|
|
|
|
Ok, Thank you very much
thank you
soso
|
|
|
|
|
You might be using unicode build( which is default in vs2005 and later ). so should pass unicode string to MessageBox() function. To convert your string to unicode. use _T macro.
MessageBox( _T("This is my first Visual C++ Application!"));
|
|
|
|
|
You are building for Unicode and therefore trying to pass an ANSI string to an API which expects an Unicode string. Include all your literal strings within the TEXT macro.
anassamar wrote: MessageBox("This is my first Visual C++ Application!");
MessageBox(_T("This is my first Visual C++ Application!"));
The _T macro automatically emits an ANSI or an Unicode string (by prefixing nothing if building for MBCS or by prefixing L to the literal string if building for Unicode)
These links may help you further to understand about string data types:
The Complete Guide to C++ Strings, Part I - Win32 Character Encodings[^]
The Complete Guide to C++ Strings, Part II - String Wrapper Classes[^]
This might help you with International programming and Unicode:
International programming[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
推荐网站www.codeproject.com 和 www.codeguru.com,在这里可以找到
|
|
|
|
|
Hi all,
I want to close a messagebox without clicking its button or without pressing Esc.
can u please tell me how can i do this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
modified on Thursday, May 28, 2009 7:03 AM
|
|
|
|