Ask Your Question
0

Compile Error with Visual Studio 15 [closed]

asked 2019-10-03 22:02:20 +0000

CashReuser gravatar image

updated 2019-10-03 22:03:23 +0000

Kind of following instructions from the website

https://www.wireshark.org/docs/wsdg_h...

I was able to install packages and figure out the build procedure. The command line threw a bunch of errors without the ability to narrow in on the cause. I used the IDE and found a fault occurred in compiling ascend.c file.

Git SHA1: db68ece98074436f45622b12e2e6a8dfa5cd3bb1

Everything else seems to be okay with the compile.

Specifically around this bit of code...any ideas that could help?

Lines 401 - 440 of ascend.c

ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */

define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))

ifndef YYSTACK_ALLOC_MAXIMUM

/* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. / define YYSTACK_ALLOC_MAXIMUM 4032 / reasonable circa 2006 */

endif

else

define YYSTACK_ALLOC YYMALLOC

define YYSTACK_FREE YYFREE

ifndef YYSTACK_ALLOC_MAXIMUM

define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM endif

if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free)))

include <stdlib.h> /* INFRINGES ON USER NAME SPACE */

ifndef _STDLIB_H

define _STDLIB_H 1

endif

endif

ifndef YYMALLOC

define YYMALLOC malloc

if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER)

????? warning treated as error - no 'object' file generated ????

void malloc (YYSIZE_T); / INFRINGES ON USER NAME SPACE */

endif

endif

ifndef YYFREE

define YYFREE free

if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER)

void free (void ); / INFRINGES ON USER NAME SPACE */

endif

endif

endif

endif /* ! defined yyoverflow || YYERROR_VERBOSE */

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by CashReuser
close date 2019-10-04 18:02:10.769594

Comments

What happens if you remove the ascend.c file and try compiling again?

If it still reports errors, what are the error messages (not the code, just the error messages)?

Guy Harris gravatar imageGuy Harris ( 2019-10-03 22:26:04 +0000 )edit

What version of Wireshark?

grahamb gravatar imagegrahamb ( 2019-10-04 12:11:09 +0000 )edit

Removing ascend give a link error.

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2019 unresolved external symbol _run_ascend_parser referenced in function _ascend_open   wiretap wiretap\ascendtext.obj  1

The version of wireshark is from the git repository I downloaded yesterday...somewhere in the cmake output it states -- V: 3.1.1-icron_dissector, MaV: 3, MiV: 1, PL: 1, EV: -icron_dissector.

I also have one other error that i did not notice before.

text2pcap-scanner.c(993): error C2220: warning treated as error - no 'object' file generated
text2pcap-scanner.c(993): warning C4003: not enough arguments for function-like macro invocation 'text2pcap_wrap'
Done building project "text2pcap.vcxproj" -- FAILED.
CashReuser gravatar imageCashReuser ( 2019-10-04 17:04:25 +0000 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2019-10-03 23:12:46 +0000

Chuckc gravatar image

ascend.c is created from ascend.y ?

????? warning treated as error - no 'object' file generated ????

void malloc (YYSIZE_T); / INFRINGES ON USER NAME SPACE */

Looks like a missing "" on the start of comment? There are three of these "INFRINGES" comments. First one has proper start/end of comment. The second and third are missing a "".

Are there any errors or warning from the yacc process?

edit flag offensive delete link more

Comments

It is in the code...probably something to do with the markup or copy and paste. I do no see any errors from the YACC process. I will try the build again to see if there is anything generated. I am not sure if it is created from ascend.y. Is this in the logs anywhere?

CashReuser gravatar imageCashReuser ( 2019-10-04 16:07:01 +0000 )edit

Yes, ascend.c is created, by Bison or Berkeley YACC, from ascend.y.

Guy Harris gravatar imageGuy Harris ( 2019-10-04 17:49:20 +0000 )edit
0

answered 2019-10-04 17:18:31 +0000

grahamb gravatar image

Note that 3.1x hasn't been tested with VS2015, but I don't think that's your issue.

I suspect that your build might have picked up a different bison\flex tool than expected. Do you have Cygwin or something similar installed?

Please delete CMakeCache.txt and re-run the CMake generation step, redirecting the output to a file and then post the contents of that file back here, e.g.

cmake -G ... 2>&1 > cmakeout.txt
edit flag offensive delete link more

Comments

It looks like it is getting it out of my MSYS directory.

CashReuser gravatar imageCashReuser ( 2019-10-04 17:25:12 +0000 )edit

OK, for building Wireshark then you must remove MSYS from the path. This sort of thing used to be much more common when we required Cygwin to be present but not on the path.

Similarly you must not have the git tools directory on the path.

FWIW my recommendation for building Wireshark is to use a VM where you can keep it isolated to just those tools required.

Also noting your first sentence in the question:

Kind of following instructions from the website

You really should following the instructions to the letter, any deviation is likely to cause issues.

grahamb gravatar imagegrahamb ( 2019-10-04 17:43:34 +0000 )edit

This seems to be the issue. I removed MSYS from the path. The build is going through now without the error on wiretap. Thanks a bunch

CashReuser gravatar imageCashReuser ( 2019-10-04 17:52:19 +0000 )edit

Question Tools

1 follower

Stats

Asked: 2019-10-03 22:02:20 +0000

Seen: 371 times

Last updated: Oct 03 '19