{"id":161575,"date":"2023-01-25T07:16:24","date_gmt":"2023-01-25T07:16:24","guid":{"rendered":"\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/"},"modified":"2023-07-31T12:35:31","modified_gmt":"2023-07-31T12:35:31","slug":"why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/","title":{"rendered":"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c?"},"content":{"rendered":"<p>udf_names.c is created during the compilation process automatically. There are several reasons why you might get compiler errors for that file, all of them mean that you violated basic UDF requirements.  A typical error in early stages of UDF development could be: udf_names.c(7) : error C2059: syntax error : &#8216;}&#8217; udf_names.c(8) : warning C4034: sizeof returns 0  If you look at the file that you can find in the udf library folder structure, you can see that there is an empty array defined which is not valid. For Windows, lines 6 and 7 might look like the following: __declspec(dllexport) UDF_Data udf_data[] = {  };   This array should contain all the UDFs. Since it is empty, it means you forgot to create at least one DEFINE macro to your *.c or *.cpp source file. This can happen easily when starting the development a more complex UDF with many smaller functions. Always have at least one DEFINE macro in your code. Remember that you can access all functions defined with DEFINE macros also directly. So a DEFINE_ON_DEMAND can be accessed like any void function.   Keywords: UDF; user-defined function; user defined functions; compiler; compiled; C2059; C4034; syntax error; udf_names; udf_names.c<\/p>\n","protected":false},"template":"","class_list":["post-161575","topic","type-topic","status-publish","hentry","topic-tag-2019-r1","topic-tag-fluent","topic-tag-fluid-dynamics","topic-tag-general-fluent","topic-tag-udf"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"udf_names.c is created during the compilation process automatically. There are several reasons why you might get compiler errors for that file, all of them mean that you violated basic UDF requirements. A typical error in early stages of UDF development could be: udf_names.c(7) : error C2059: syntax error : &#039;}&#039; udf_names.c(8) : warning C4034: sizeof\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ansys Knowledge | Ansys Innovation Space\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c? | Ansys Knowledge\" \/>\n\t\t<meta property=\"og:description\" content=\"udf_names.c is created during the compilation process automatically. There are several reasons why you might get compiler errors for that file, all of them mean that you violated basic UDF requirements. A typical error in early stages of UDF development could be: udf_names.c(7) : error C2059: syntax error : &#039;}&#039; udf_names.c(8) : warning C4034: sizeof\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-01-25T07:16:24+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-07-31T12:35:31+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c? | Ansys Knowledge\" \/>\n\t\t<meta name=\"twitter:description\" content=\"udf_names.c is created during the compilation process automatically. There are several reasons why you might get compiler errors for that file, all of them mean that you violated basic UDF requirements. A typical error in early stages of UDF development could be: udf_names.c(7) : error C2059: syntax error : &#039;}&#039; udf_names.c(8) : warning C4034: sizeof\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/forums\\\/topic\\\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/topics\\\/#listItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/topics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/forums\\\/topic-tag\\\/fluent\\\/#listItem\",\"name\":\"fluent\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/forums\\\/topic-tag\\\/fluent\\\/#listItem\",\"position\":3,\"name\":\"fluent\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/forums\\\/topic-tag\\\/fluent\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/forums\\\/topic\\\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\\\/#listItem\",\"name\":\"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c?\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/forums\\\/topic\\\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\\\/#listItem\",\"position\":4,\"name\":\"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c?\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/forums\\\/topic-tag\\\/fluent\\\/#listItem\",\"name\":\"fluent\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/#organization\",\"name\":\"Ansys Knowledge\",\"description\":\"Ansys Innovation Space\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/forums\\\/topic\\\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/forums\\\/topic\\\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\\\/\",\"name\":\"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c? | Ansys Knowledge\",\"description\":\"udf_names.c is created during the compilation process automatically. There are several reasons why you might get compiler errors for that file, all of them mean that you violated basic UDF requirements. A typical error in early stages of UDF development could be: udf_names.c(7) : error C2059: syntax error : '}' udf_names.c(8) : warning C4034: sizeof\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/forums\\\/topic\\\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\\\/#breadcrumblist\"},\"datePublished\":\"2023-01-25T07:16:24+00:00\",\"dateModified\":\"2023-07-31T12:35:31+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/#website\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/\",\"name\":\"Ansys Knowledge\",\"description\":\"Ansys Innovation Space\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/knowledge\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c? | Ansys Knowledge","description":"udf_names.c is created during the compilation process automatically. There are several reasons why you might get compiler errors for that file, all of them mean that you violated basic UDF requirements. A typical error in early stages of UDF development could be: udf_names.c(7) : error C2059: syntax error : '}' udf_names.c(8) : warning C4034: sizeof","canonical_url":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/knowledge#listItem","position":1,"name":"Home","item":"https:\/\/innovationspace.ansys.com\/knowledge","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/topics\/#listItem","position":2,"name":"Topics","item":"https:\/\/innovationspace.ansys.com\/knowledge\/topics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic-tag\/fluent\/#listItem","name":"fluent"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/knowledge#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic-tag\/fluent\/#listItem","position":3,"name":"fluent","item":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic-tag\/fluent\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/#listItem","name":"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c?"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/#listItem","position":4,"name":"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c?","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic-tag\/fluent\/#listItem","name":"fluent"}}]},{"@type":"Organization","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/#organization","name":"Ansys Knowledge","description":"Ansys Innovation Space","url":"https:\/\/innovationspace.ansys.com\/knowledge\/"},{"@type":"WebPage","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/#webpage","url":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/","name":"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c? | Ansys Knowledge","description":"udf_names.c is created during the compilation process automatically. There are several reasons why you might get compiler errors for that file, all of them mean that you violated basic UDF requirements. A typical error in early stages of UDF development could be: udf_names.c(7) : error C2059: syntax error : '}' udf_names.c(8) : warning C4034: sizeof","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/knowledge\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/#breadcrumblist"},"datePublished":"2023-01-25T07:16:24+00:00","dateModified":"2023-07-31T12:35:31+00:00"},{"@type":"WebSite","@id":"https:\/\/innovationspace.ansys.com\/knowledge\/#website","url":"https:\/\/innovationspace.ansys.com\/knowledge\/","name":"Ansys Knowledge","description":"Ansys Innovation Space","inLanguage":"en-US","publisher":{"@id":"https:\/\/innovationspace.ansys.com\/knowledge\/#organization"}}]},"og:locale":"en_US","og:site_name":"Ansys Knowledge | Ansys Innovation Space","og:type":"article","og:title":"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c? | Ansys Knowledge","og:description":"udf_names.c is created during the compilation process automatically. There are several reasons why you might get compiler errors for that file, all of them mean that you violated basic UDF requirements. A typical error in early stages of UDF development could be: udf_names.c(7) : error C2059: syntax error : '}' udf_names.c(8) : warning C4034: sizeof","og:url":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/","article:published_time":"2023-01-25T07:16:24+00:00","article:modified_time":"2023-07-31T12:35:31+00:00","twitter:card":"summary_large_image","twitter:title":"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c? | Ansys Knowledge","twitter:description":"udf_names.c is created during the compilation process automatically. There are several reasons why you might get compiler errors for that file, all of them mean that you violated basic UDF requirements. A typical error in early stages of UDF development could be: udf_names.c(7) : error C2059: syntax error : '}' udf_names.c(8) : warning C4034: sizeof"},"aioseo_meta_data":{"post_id":"161575","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2025-10-17 19:13:15","updated":"2026-07-29 05:33:22","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/knowledge\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/knowledge\/topics\/\" title=\"Topics\">Topics<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic-tag\/fluent\/\" title=\"fluent\">fluent<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tWhy does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c?\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/innovationspace.ansys.com\/knowledge"},{"label":"Topics","link":"https:\/\/innovationspace.ansys.com\/knowledge\/topics\/"},{"label":"fluent","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic-tag\/fluent\/"},{"label":"Why does the ANSYS Fluent UDF compiler report a syntax error in udf_names.c?","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/why-does-the-ansys-fluent-udf-compiler-report-a-syntax-error-in-udf_names-c\/"}],"acf":[],"custom_fields":[{"0":{"_wp_page_template":["default"],"_bbp_forum_id":["27796"],"_bbp_author_ip":["23.56.168.180"],"_bbp_last_active_time":["1-24-2023  20:20:31"],"_btv_view_count":["1605"],"siebel_km_number":["2058293"],"product_version":["2019 R1"],"km_published_date":["2019-02-25T12:33:59.000Z"],"family":["Fluid Dynamics"],"application_name":["FLUENT"]},"test":"articlesansys-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/161575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/161575\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=161575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}