Comments (8)
just wondering if anyone usese windows with msvc c++ here and got this figured out
You probably compiled your project as C++. Look, there's no:
#ifdef __cplusplus
extern "C" {
#endif
inside microui.h
from microui.
Have the same issue, not sure how to fix it...
from microui.
- initial empty vs2019 project
- set
/SUBSYSTEM:WINDOWS
flag - add
_CRT_SECURE_NO_WARNINGS
flag - put everything in the root folder of your project, or you may Configure
Include Directories
to includesrc
anddemo
folder. - use NuGet add
SDL2
and(windows already has opengl)nupengl.core
Or you may add those dependences by hand like: How do I link SDL with Visual Studio 2019 - Stack Overflow - change include:
Inmain.c
:#include <SDL2/SDL.h>
=>#include "SDL.h"
Inrenderer.c
:#include <SDL2/SDL.h>
=>#include "SDL.h"
;#include <SDL2/SDL_opengl.h>
=>#include "SDL_opengl.h"
- add
opengl32.lib
toAdditional Dependencies
- build and run!
from microui.
I tried @inkydragon 's suggestion but no luck. I'm not using VS, just invoking the compiler from a developer command prompt.
Any ideas?
from microui.
Your project is C++, right? Apply this simple patch:
--- a/src/microui.h 2021-10-09 12:10:12
+++ b/src/microui.h 2021-10-09 12:14:10
@@ -8,6 +8,10 @@
#ifndef MICROUI_H
#define MICROUI_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MU_VERSION "2.01"
#define MU_COMMANDLIST_SIZE (256 * 1024)
@@ -293,4 +297,8 @@
void mu_begin_panel_ex(mu_Context *ctx, const char *name, int opt);
void mu_end_panel(mu_Context *ctx);
+#ifdef __cplusplus
+};
+#endif
+
#endif
from microui.
@gvanem I don't have a "project" as I'm not actually using Visual Studio. I invoke the compiler from the command line, and the default behavior with .c extensions is to compile as C. Even if I force C compilation with /Tc or /TC compiler flags, I always get the error:
LINK : fatal error LNK1561: entry point must be defined
I also tried with your fix and forcing C++ compilation, in which case I get several C4576 errors.
from microui.
from microui.
Problem fixed. I was only compiling main.c and microui.c. I assumed that renderer.c was included in main.c
from microui.
Related Issues (20)
- How can you resize microui window dynamically? HOT 2
- demo/build.sh is not suitable for MacOS HOT 1
- Post a screenshot HOT 7
- Licensing HOT 1
- DirectX 9 HOT 3
- Porting push_quad to DirectX
- Can I use it without SDL ? HOT 1
- Hash function "Cannot convert from 'const void *' to 'const unsigned char *'" HOT 4
- Question: how do I open a window HOT 2
- Library dependency HOT 1
- Why is black area covering gui appearing after resizing window? HOT 1
- Trying to get a window container within another window HOT 3
- C string gets corrupted when passed to the TextCommand handler HOT 3
- How to port to another low level access graphic control HOT 4
- Textbox improvements! HOT 3
- Question: Microui extensions
- Question: Running demo on windows HOT 2
- RAM Footprint HOT 7
- Can you layout from minimum required sizes by child widgets?
- 'step' does not work with mu_slider_ex HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microui.