Why are there no header files to include when building LuaPlus? - build

From this question's answer, it seems as though this should be simple: How do you include LuaPlus into your project?
This is absolutely ridiculous though. It is so dumb that you have to build this (along with such an awful website), but there are absolutely no tutorials on this either. Horrible documentation on getting it installed.
I read something about building it using the "jam" stuff, but that is alien lingo to me and sounds asinine. Why not just make this simple? Most libraries just let you download them straight up, extract, link, and wallah! I've built libraries before, and it was extremely simple and easy.
Anyway, I successfully built the library in Code::Blocks, but that isn't the problem. The problem is it only builds the library. Where are the header files to add to the include directory?
I tried messing around, but I had errors just dumping what I thought the header files were into a directory and including it.
I read online, people who use Visual Studio to build don't have a problem, and it creates all the header files. The only thing that results from my Code::Blocks build is the library file.
This is a PITA just to get to use, and I've already been at it 2 hours and the only way I can work with it is if I include the entire source in my project (which is just ridiculous).

edit2: Ergh! LuaPlus edits Lua itself, so you have to remove your link to Lua. LuaPlus has Lua in it. So F***ing ridiculous. Just let people download the library and just link simply for god's sake. A huge middle finger to needlessly complicated crap.
edit: Nevermind, this isn't the correct answer. Now I'm getting all kinds of stupid errors.
I guess the first time I copied over all the header files, I did something wrong because now it works just as it should.
For anyone interested, you just copy/paste all of the header files (shown here
Minus LuaPlusAll.cpp, src/lua.c, and src/luac.c
Then paste them in your search directory
lib/libLuaPlus.a
include/[paste here]
Link the library & include directory, tell Code::Blocks to use "libLuaPlus" and wallah!
No idea why I had problems with this. Must have been following someone's bad directions (causing me to mess up somewhere).

Related

How to get wxWidgets working in Visual Studio 2012

I've got a problem for which I would very much like a solution please:
All I'm trying to do is use wxWidgets in Visual Studio 2012 (in C++), and make it accessible to my code project. That shouldn't be so hard, should it? But as usual, even though there are programming tutorials for it, wxWidgets is evidently one of those things that has no proper documentation just to simply get it running, or if it does then I sure can't find it.
I downloaded the installer for Windows and installed it. When it finished, it gave me a message that said:
wxWidgets was installed successfully!
Please note: before using wxWidgets in your application,
you must build the library using the same compiler you
use for building your program.
Please see docs/msw/install.md file in the installation
directory for the detailed instructions about how to build
wxWidgets and use it from your application.
It should be noted that I think I remember something on the website or somewhere saying that I can just include a header file into my project and forego the DLL altogether (which is what I'd prefer to do, if possible), though I may possibly be misremembering that or confusing it with something else.
Anyway, when I opened the docs/msw/install.md file, I found (amongst other things) these instructions:
--- From the IDE
Ready to use project files are provided for VC++ versions 8, 9,
10, 11, 12, 14, 15, 16 and 17 (also known as MSVS 2005, 2008, 2010, 2012,
2013, 2015, 2017, 2019 and 2022 respectively).
Simply open wx_vcN.sln (for N=8, 9, 10, 11, 12, 14, 15, 16 or 17) file,
select the appropriate configuration (Debug or Release, static or DLL)
and build the solution. Notice that when building a DLL configuration,
you may need to perform the build several times because the projects
are not always built in the correct order, and this may result in link
errors. Simply do the build again, up to 3 times, to fix this.
Of course, it doesn't even say WHERE the "wx_vcN.sln" files are, but I ran a file search and found them in C:\wxWidgets-3.1.6\build\msw and I opened the one called wx_vc11.sln, because that seems to be the one that corresponds to VS2012, right?
Anyway, it took a LONG time to load, because it had to keep scanning through thousands of files and so forth, but when it was finally finished, I did the "Rebuild All" command thrice in a row, like it says to do (which also took a while).
But I'm not sure where it even put the actual DLL file. It says that it's in C:\wxWidgets-3.1.6\build\msw....\lib\vc_lib\wxmsw31ud_xrc.lib, but where the hell is "...."? It doesn't even bother to specify the entire path! What kind of nonsense is that?! I just want the file so that I can put it into my project! Or better yet, just a .h file that takes care of everything would be great. Supposedly there's one to include called "wx/wx.h", which then includes everything else, I think, but I don't know if that one indirectly also requires a DLL.
I always have problems with DLLs, anyway, though I'll use one if I absolutely have to. You'd think it would be the easiest thing to import a DLL into a project, but for some reason, I've never been able to find any sort of tutorial that explains a specific, step-by-step way to do it which is guaranteed to work, so on the rare occasion that I actually need to use a DLL (99% of the time I can just rely on my own code and the .h files included with Visual Studio), I always end up muddling through it until it FINALLY works by sheer accident (if I'm lucky). Mostly, it just reports errors for one reason or another, that it's not properly included or compatible, or that the header files that I'm using which reference it keep showing the same errors, as though I hadn't even imported the DLL file at all! I've been programming for about 30 years, and I work on things like AI and compression and cryptographic algorithms. I don't say this to brag, but to point out that if someone as experienced as me has trouble getting a DLL to attach properly to a roject, then there's something severely wrong with the whole process, or the documentation for it! I HATE using DLLS, because it's always a HUGE chore, but I'll do it if there's absolutely no other way (though I'd appreciate step-by-step instructions, if you don't mind).
But enough about that. In any case, I have an example project in which wxWidgets is being used in conjunction with Vulkan, and though it has compilation errors (because Vulkan didn't properly install on my machine (when I try to run the sample programs it says they're missing DLLs - big surprise) and as it turns out, I don't think it's compatible with my video card, anyway (which might possibly be why it didn't install properly), so I think I'll have to resort to OpenGL instead - PLEASE tell me that's compatible with wxWidgets!), but even in that example project, it has errors where it's trying to include and use wxWidgets stuff (like "wx/wx.h"), even though that's supposed to be a complete and already working project! I can't find any DLL files or the header files in question anywhere in the project directories!
So anyway, there's got to be an easier way to get this all set up, just to the point that I can make a simple test program using wxWidgets, and compile it. I'd REALLY like to be able to get at least that much working sometime tomorrow morning, so I'd greatly appreciate any help you can give me! Thank you.
#ThisIsMe,
First of all you need to educate yourself on properly using C++.
When you acquire the C++ code it contains of 2 portion - header file and source code.
Header file is what you call a declaration you declare you classes there - class name, member variable and method.
In the source files You define what you declared and you put an actual code there.
Now with that in mind:
wxWidgets contains both header and source files. When you downloaded the installer and did the installation it just copied the "text file" (headers and sources) into the folder of you choice.
Now as you can imagine text files are not executable - you need to compile them into the binary files And that is exactly what you did. (I don't know why you did it 3 times though - I guess you got an errors after building 1st and 2nd time).
Now, you said you have a project that (either uses wxWidgets or you want to incorporate wxWidgets into - which one is it, BTW?). The answer to this question will help direct you to a proper solution.
Now, you said that you tried the Vulkan and it fails to run the demo. How did it fails? Did it produce an error? What was it? Did it even run?
Now wxWidgets does support OpenGL as can be seen by looking at the documentation and checking the different samples that comes with the library, but I'm just curious if what you are seeing from Vulkan is really an incompatibility with the Video Card.
So, we need you to answer the questions I put and so we can help you further. Just keep in mind - C++ is not for the beginner programmers and if you are struggling with understanding the difference between compilation, installation , headers and sources - it will be very hard for you.
Maybe you should start with something simpler - like wxPython and forget about C++ for now.

Trouble installing C++ libraries from Github

I've used C++ for several courses in university but the libraries we used in these courses were quite simple to install. When we came across libraries which required a bit more complex installation, our teachers always provided detailed instructions.
This time I'm doing a project on my own. I have downloaded libraries for my own projects in the past. Sometimes the install was easier, sometimes I had to search for hours to do things most people here would do in 5 minutes.
I did some studying to remember some stuff about the compiling process, what dynamic and static libraries are, etc. I feel I understand the most part but it didn't really help me with my efforts to install some libraries. Some people in Github provide instructions for newbies like me, but others, understandably, don't.
I'm saying a lot so I'll get to the point. I will provide links for the library I'm trying to install but in case I'm not allowed to, please let me know so I can rewrite this in a way that is allowed.
I'm trying to install libccd so I can then install fcl. In the instructions 3 ways are mentioned:
Using Makefile
Using autotools
Using Cmake
In all 3 methods, I see specific commands like this :
First of all, where am I supposed to write these commands?
I don't even know how to search this. So, I tried installing with methods I've previously used.
Here are the steps I took:
Downloaded the whole repository.
Made a solution for Visual Studio with Cmake-gui (that's all I know how to do with Cmake,unfortunately it usually was enough so I never learnt more)
Compiled the code in Release mode, which should give me a lib file.
Now,in my own project, I added the relevant include directories of the repository I downloaded and the library directory for the lib file which was produced.
I'm not sure about my last step. I'm pretty sure if I did the installation as proposed in the link(and as required by fcl), I would have a new folder for the library including just an include folder and a lib folder. Now I'm just searching for the correct include files and the lib file in subfolders of subfolders hoping I include the right ones. I'm a bit lost.
I'd really like some general steps(if there are) to installing a library. I know each library has its own ways but I assume the general idea with Cmake or Makefile should be the same. I have tried searching online but I didn't come across a good or detailed enough tutorial. I really don't wanna waste any more days trying to install libraries and I don't want to end up asking here again.
UPDATE:
It looks like there is no standard way to install libraries. Since I'm getting 'close votes' I'll include a specific question:
Are the steps I took correct? What should I do next?
I'm trying to install libccd so I can then install fcl. In the instructions 3 ways are mentioned:
Using Makefile
Using autotools
Using Cmake
In all 3 methods, I see specific commands like this :
First of all, where am I supposed to write these commands?
These instructions are for a UNIX-like system. Makefiles, autotools... these are UNIX things. You'd typically write those build commands into a console window on something like Linux or a Mac.
CMake is a bit more cross-platform. You can find out how to invoke CMake on other SO questions.
You can get Makefiles and such to work on Windows, using projects like Cygwin and MSYS. I'd generally recommend you avoid that unless you really need it.
I'm not sure about my last step. I'm pretty sure if I did the installation as proposed in the link(and as required by fcl), I would have a new folder for the library including just an include folder and a lib folder. Now I'm just searching for the correct include files and the lib file in subfolders of subfolders hoping I include the right ones. I'm a bit lost.
This is where no "general" advice exists. Different authors put their output in different places. If their instructions didn't include this information, you're already doing the right thing. If you get really stuck, you can always just ask them.
I'd really like some general steps(if there are) to installing a library.
No such thing exists, but where these industry-standard tools are involved, you can usually go on general documentation for those tools, or from memory.
I also suggest you shop around for a general book on programming, as general principles should be covered in any good one of those.

How to add 3rd party library in Unreal Engine 4

I am new to Unreal Engine. But here is what I planned to do. I want to an experiment project by combining socket.io with Unreal Engine 4. I know somebody may shot at me, for it already had a plugin. But I don't like graph programming at all (I prefer "real" coding)
But as I followed instruction from Installing socket.io C++ and here. It just won't work. The error told me something about File Not Found on multiple headers file from this github repo. So I tried to add a lot of things (Hopefully it won't affect the outcome). And now a tons of errors had popped up. Now they are mostly about Macro errors. And I have absolutely no idea how to fix.
The problem is I don't understand why after I include .lib files to PublicAdditionalLibraries I still needed the original file (Shouldn't it work like any other visual studio projects?)
Also how to tackle loads of errors I am facing
Thanking in advanced
Did you add your include paths with the lib headers to PublicIncludePaths array ( in the StartupModule() method ? it's gonna be needed to use methods from your lib.
Here is an exemple how to use the PublicIncludePaths
string includePath = Path.Combine(ThirdPartyPath, "opencv", "include");
PublicIncludePaths.Add(includePath);
ThirdPartyPath is a member of my module class i retrieve with my getter
Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/"));
I took a look at the github repo of Socket-IO-cpp lib and the only libs compiled for windows are in 32bits, take care you're not tried to compile in 64bits, or every .lib files of your libraries are in 32bits to be linked all together, in case you're using others libs.
If you got some runtime error, take a look at my answer which explain how to indicate .dll when .libs arn't enough.
Hope it helps

Include files are not being recognized, even though they are in the right directory?

This is my first post on here, but from what I've seen, you guys like precise and concise problems. I think this qualifies. I have googled hi and lo and might have a case of the dumb, but cannot solve this.
I'm trying to compile a program I found that uses the portaudio library. I downloaded all of them, and HAVE all the relevant files, but visual studio is giving me issues.
This is the error I get:
So, I decided found the source path, and tracked down the file, which was in a different folder in portaudio, and copy/pasted it in the appropriate location (can't post third link, but it's there. I can provide that in the comments if necessary, I suppose). . I also have tried putting it in the same directory as the file that actually includes it, adding it to the project as an existing item, and adding that entire directory to the preprocessor include things (project settings > c++ > general > additional include directories).
The second error is very similar and is basically doing the same thing. I have the file, put it in the right place, visual studio can't find it.
Thank you all for your help.
One possible answer to your problem is that you don't have the right permissions. Are you able to open the file in a text editor?
I ended up figuring it out. For the second error, I had to save the .c file to .cpp through visual studio instead of just changing the extension. For the first one, I'm honestly not sure what I did, but it just sort of fixed itself. Such is the magic of programming, I suppose.

C++ include file browser

I have a very large project with tons of convoluted header files that all include each other. There's also a massive number of third-party libraries that it depends on. I'm trying to straighten out the mess, but I'm having some trouble, since a lot of the time I'll remove one #include directive only to find that the stuff it was including is still included through one of the other files. Is there any tool that can help me understand this? I'd really like to be able to click on a .h file and ask it which CPP files it's included in (directly or indirectly), and the paths through which it is included, and likewise click a cpp file and ask it which .h files are included (directly and indirectly). I've never heard of a tool that does this, and a bit of quick googling hasn't turned anything up, but maybe I don't know what to search for.
http://www.profactor.co.uk/includemanager.php
For VS2003 there is /showIncludes flag (in C/C++/Advanced properties). This will print all headers each .cpp file includes and what they include, so you can go from there.
I'm sure there is same option in same place for VS2008.
if you use GCC compilers, try this
g++ -M abc.cpp
it will show all include dependencies for the file abc.cpp
Your situation reminds me of my own. I have a bunch of headers that I have created that I use as a library instead of bothering with a DLL.
Of course the cyclic-includes can become troublesome, so I find that a tool like Visual Assist X (1) helps with this sort of thing. It has a function that can find references to stuff, so that you can easily weed out where something is being defined/declared/included etc. It also has a lot of other useful features, so I consider it to be pretty useful.
There’s probably other tools/plugins that have a referencing function, but usually as one feature among the other refactoring and productivity functions of the utility.
HTH
It's pretty tedious, but you can binary-search your way to where an #include happens by using #error (and #pragma message) to narrow down which include line is pulling in the third party. I've done this in the case of a single file I was trying to track down, but it sounds like your problem is bigger so probably one of the tools others have mentioned would be more effective.