ld -Bdynamic -o bin\Debug\Hello Wrld.exe crt2.o crtbegin.o -LC:\MinGW\lib\gcc\mingw32\3.4.2 -LC:\MinGW\lib -L obj\Debug\main.o -lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt crtend.o
ld: crt2.o: No such file: No such file or directory
Using mingw 3.4.2 and vista business. It started out with the usual menagerie of problems. Fixed those and then stuck at this little problem. After adding the -v to the linker I came up with this messy looking command line. According to http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_node/ld_3.html#SEC3 (http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_node/ld_3.html#SEC3) this looks about right. The 'missing' file is located in C:\MinGW\lib. I've tried every fix I could find and come up blank. The same problem occurred with wxDev-Cpp so I assume this is pretty much a mingw problem as others have mentioned. Is there any cure for this yet besides reinstalling windows? How do I force this !#$%@# linker to recognize the search directories? There seem to be some options under other settings -> advanced options for the linker that I'll toy with next, but barring something new I'm stumped.
PS The two additional files required are both in the CodeBlocks directory, so that's definitely not it.
Hi ironlizard,
we are using also mingw compilers. But the current version (3.4.x and 4.x) of compilers do not work under windows Vista, so we made a patch in gcc/gcc.c
#ifdef WIN32
2381 /* VISTA patch:
2382 in vista the access with X_OK = 1 no longer works
2383 as a woarkaround we use F_OK (file exists) and at the
2384 extension .exe if necessary
2385 */
2386 static int
2387 __win32_access_check(const char *name, int mode)
2388 {
2389 char *tmp_name;
2390 int len = strlen(name);
2391 const char *const file_suffix = ((mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : "");
2392 int suffix_len = strlen(file_suffix);
2393
2394 if (mode == X_OK) {
2395 if (len > suffix_len && suffix_len && !strcmp(&name[len-suffix_len],file_suffix))
2396 return access(name,F_OK);
2397 else
2398 {
2399 tmp_name = alloca(len+suffix_len);
2400 strcpy (tmp_name,name);
2401 strcat (tmp_name, file_suffix);
2402 return access(tmp_name,F_OK);
2403 }
2404 }
2405 else
2406 return access(name,mode);
2407 }
2408 #endif
2409 static int static int
2410 access_check (const char *name, int mode) access_check (const char *name, int mode)
2411 { {
2412 if (mode == X_OK) if (mode == X_OK)
2413 { {
2414 struct stat st; struct stat st;
2415
2416 if (stat (name, &st) < 0 if (stat (name, &st) < 0
2417 || S_ISDIR (st.st_mode)) || S_ISDIR (st.st_mode))
2418 return -1; return -1;
2419 #ifdef WIN32
2420 return __win32_access_check(name, mode);
2421 #endif
2422 } }
2423
2424 return access (name, mode); return access (name, mode);
2425 }
}
and in libiberty/make-relative-prefix.c
/* on WIN32 we test only file exists including the executable suffix */
86 /* workaround for VISTA */
87 # undef X_OK
88 # define X_OK 0
89 #else #else
90 # define HOST_EXECUTABLE_SUFFIX ""
91 # define PATH_SEPARATOR ':' # define PATH_SEPARATOR ':'
92 #endif #endif
and replace the line
nstore = (char *) alloca (prefixlen + strlen (progname) + 1);
with
nstore = (char *) alloca (prefixlen + strlen (progname) + 1 + strlen(HOST_EXECUTABLE_SUFFIX));
in make-relative.c.
We made this patch and now the mingw based compilers work on vista. As we are still testing, we did not public this patch.
Bye
It is a unicode debug file. OK, now I'm lost. Where would I find this wxmsw28ud?
You have to compile wxWidgets with those settings.
e.g.
mingw32-make -f makefile.gcc BUILD=debug UNICODE=1