As I have updated my wine tree from cvs and recompiled it, now I load the "shell32_test.dsw" into MSVC 6.0, press F7 and get linking errors:
| Deleting intermediate files and output files for project 'shell32_test - Win32 MSVC Headers'. | --------------------Configuration: shell32_test - Win32 MSVC Headers-------------------- | Compiling... | generated.c | E:\wine\dlls\shell32\tests\generated.c(9) : warning C4005: '_WIN32_IE' : macro redefinition | unknown(0) : see previous definition of '_WIN32_IE' | shelllink.c | shellpath.c | shlfileop.c | shlfolder.c | string.c | testlist.c | Generating Code... | Linking... | shlfolder.obj : error LNK2001: unresolved external symbol _winetest_ok | string.obj : error LNK2001: unresolved external symbol _winetest_ok | generated.obj : error LNK2001: unresolved external symbol _winetest_ok | shelllink.obj : error LNK2001: unresolved external symbol _winetest_ok | shellpath.obj : error LNK2001: unresolved external symbol _winetest_ok | shlfileop.obj : error LNK2001: unresolved external symbol _winetest_ok | shlfolder.obj : error LNK2001: unresolved external symbol _winetest_set_location | string.obj : error LNK2001: unresolved external symbol _winetest_set_location | generated.obj : error LNK2001: unresolved external symbol _winetest_set_location | shelllink.obj : error LNK2001: unresolved external symbol _winetest_set_location | shellpath.obj : error LNK2001: unresolved external symbol _winetest_set_location | shlfileop.obj : error LNK2001: unresolved external symbol _winetest_set_location | shelllink.obj : error LNK2001: unresolved external symbol _winetest_loop_todo | shelllink.obj : error LNK2001: unresolved external symbol _winetest_end_todo | shelllink.obj : error LNK2001: unresolved external symbol _winetest_start_todo | shelllink.obj : error LNK2001: unresolved external symbol _winetest_trace | shlfileop.obj : error LNK2001: unresolved external symbol _winetest_trace | string.obj : error LNK2001: unresolved external symbol _winetest_trace | shellpath.obj : error LNK2001: unresolved external symbol _winetest_interactive | shellpath.obj : error LNK2001: unresolved external symbol _winetest_get_mainargs | LIBCMTD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main | Output\Win32_MSVC_Headers/shell32_test.exe : fatal error LNK1120: 9 unresolved externals | Error executing link.exe. | | shell32_test.exe - 22 error(s), 1 warning(s)
Any ideas on what can be wrong? I have been doing this only on rare occasions in the past, so have no idea weather this is bug, regression or not.
* On Thu, 9 Jun 2005, Saulius Krasuckas wrote:
As I have updated my wine tree from cvs and recompiled it, now I load the "shell32_test.dsw" into MSVC 6.0, press F7 and get linking errors:
I have omited, I had run tools/winapi/msvcmake after compiling the tree.
| Linking... | shlfolder.obj : error LNK2001: unresolved external symbol _winetest_ok
It all occurs because the name STANDALONE isn't being defined. After some grep-work I have found that only tools/make_ctests.c can write out this define, but not msvcmaker. Their code diverged since the patch [1].
Then goes my manual syncing of the code:
| --- dlls/shell32/tests/testlist.c 2005-06-10 12:06:02.000000000 +0300 | +++ /mnt/vcd2/wine/dlls/shell32/tests/testlist.c.1 2005-06-11 00:38:52.000000000 +0300 | @@ -5,22 +5,19 @@ | #include <stdio.h> | #include <stdlib.h> | #include "windef.h" | #include "winbase.h" | + | +#define STANDALONE | +#include "wine/test.h" | | extern void func_generated(void); | extern void func_shelllink(void); | extern void func_shellpath(void); | extern void func_shlfileop(void); | extern void func_shlfolder(void); | extern void func_string(void); | | -struct test | -{ | - const char *name; | - void (*func)(void); | -}; | - | static const struct test winetest_testlist[] = | { | { "generated", func_generated }, | { "shelllink", func_shelllink }, | @@ -30,6 +27,4 @@ static const struct test winetest_testli | { "string", func_string }, | { 0, 0 } | }; | | -#define WINETEST_WANT_MAIN | -#include "wine/test.h"
in reaction to which MSVC compiler gives:
| Compiling... ... | testlist.c | ......\include\wine/test.h(92) : error C2133: 'winetest_testlist' : unknown size | Generating Code... | Error executing cl.exe.
I am wondering, how the idea works with make_ctests, which is used for generating source for MinGW crosscompiler. Or am I wrong?
Here I have two ideas. First one:
| --- dlls/shell32/tests/testlist.c 2005-06-10 12:06:02.000000000 +0300 | +++ /mnt/vcd2/wine/dlls/shell32/tests/testlist.c.2 2005-06-11 01:19:14.000000000 +0300 | @@ -30,6 +30,6 @@ static const struct test winetest_testli | { "string", func_string }, | { 0, 0 } | }; | | -#define WINETEST_WANT_MAIN | +#define STANDALONE | #include "wine/test.h"
But since it leaves "struct test" definition being generated for every dll, I can think of a second solution:
| --- include/wine/test.h 2005-06-10 11:31:42.000000000 +0300 | +++ /mnt/vcd2/wine/include/wine/test.h.3 2005-06-10 19:33:14.000000000 +0300 | @@ -89,7 +89,7 @@ struct test | void (*func)(void); | }; | | -static const struct test winetest_testlist[]; | +#include "testlist.h" | | /* debug level */ | int winetest_debug = 1; | | | --- /dev/null 2002-08-31 02:31:37.000000000 +0300 | +++ /mnt/vcd2/wine/dlls/shell32/tests/testlist.h.3 2005-06-10 14:34:24.000000000 +0300 | @@ -0,0 +1,17 @@ | +extern void func_generated(void); | +extern void func_shelllink(void); | +extern void func_shellpath(void); | +extern void func_shlfileop(void); | +extern void func_shlfolder(void); | +extern void func_string(void); | + | +static const struct test winetest_testlist[] = | +{ | + { "generated", func_generated }, | + { "shelllink", func_shelllink }, | + { "shellpath", func_shellpath }, | + { "shlfileop", func_shlfileop }, | + { "shlfolder", func_shlfolder }, | + { "string", func_string }, | + { 0, 0 } | +}; | | | --- dlls/shell32/tests/testlist.c 2005-06-10 12:06:02.000000000 +0300 | +++ /mnt/vcd2/wine/dlls/shell32/tests/testlist.c.3 2005-06-11 01:26:43.000000000 +0300 | @@ -6,30 +6,7 @@ | #include <stdlib.h> | #include "windef.h" | #include "winbase.h" | + | +#define STANDALONE | +#include "wine/test.h" | | -extern void func_generated(void); | -extern void func_shelllink(void); | -extern void func_shellpath(void); | -extern void func_shlfileop(void); | -extern void func_shlfolder(void); | -extern void func_string(void); | - | -struct test | -{ | - const char *name; | - void (*func)(void); | -}; | - | -static const struct test winetest_testlist[] = | -{ | - { "generated", func_generated }, | - { "shelllink", func_shelllink }, | - { "shellpath", func_shellpath }, | - { "shlfileop", func_shlfileop }, | - { "shlfolder", func_shlfolder }, | - { "string", func_string }, | - { 0, 0 } | -}; | - | -#define WINETEST_WANT_MAIN | -#include "wine/test.h"
This would require msvcmaker to write out two files instead of one - testlist.c and testlist.h. I feel this idea will be rejected.
Yet also we can break wine/test.h into a two include-files, so we can put minimal ammount of code into a testlist.c.
But this idea is even more uglier, so I am staying in wait for any changes regarding msvcmaker or some corrections. TIA.
[1] http://www.winehq.org/hypermail/wine-cvs/2005/05/0510.html