Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,508 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Visual Studio 2003 #111550
02/10/07 04:51
02/10/07 04:51
Joined: Apr 2006
Posts: 136
San Francisco
T
Tor Offline OP
Member
Tor  Offline OP
Member
T

Joined: Apr 2006
Posts: 136
San Francisco
Hey guys, I'm having a really rough time getting the c-lite plugins interfaced with visual studio.

I've got all the includes etc working. But I'm getting a linker error on compile:

a6_windows error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup

All the links are in place to the acknex.lib and the other header files, am I missing anything else? I also placed the acknex.dll in the same folder as the source code. Any other things I could try?

Thanks


"Towlie, you're the worst character ever." I know...
Re: Visual Studio 2003 [Re: Tor] #111551
02/11/07 16:44
02/11/07 16:44
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
In the lite-C manual under "External Languages" you'll find a description how to write plugins for lite-C - if that was your problem.

For any questions related to visual studio you can get help in the "higher languages" forum. However you should then give a little more details. It is not clear from your post what you're doing at all - writing an engine plugin, or using the engine in another application, or whatever - and what your problem really is. As the free lite-C version can not publish, you can not implement its engine in other programs. This is only possible when you own Gamestudio.

Re: Visual Studio 2003 [Re: jcl] #111552
02/11/07 22:22
02/11/07 22:22
Joined: Apr 2006
Posts: 136
San Francisco
T
Tor Offline OP
Member
Tor  Offline OP
Member
T

Joined: Apr 2006
Posts: 136
San Francisco
Yea, I'm sorry, I was being rather hasty in my decision making process and was getting extremely frustrated at the linker errors.

I own a copy of A6 and I was going to try to implement my game in C++ but quickly scratched that idea as what I need to do could suffice in a plug-in and I wouldn't have to go through all the hell of typcasting stuff like crazy inside all of my code.

But yea, I was trying to create a standalone app that used the engine. and no matter how I linked it up, I kept getting that error above. Which was driving me nuts.

I had linked in the acknex.lib and set the compiler to know where it is, as well as the same for the headers, and I kept getting that linker error and I had no idea how to fix it. I did, however, use all the other default visual studio settings for creating an empty win32 console app.

Sorry I was so vague before.


"Towlie, you're the worst character ever." I know...
Re: Visual Studio 2003 [Re: Tor] #111553
02/12/07 16:36
02/12/07 16:36
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
You can not link the acknex.lib to a plugin. Besides, a plugin is a DLL - a dynamically linked library - not a win32 console app.

There are many tutorials on the web about the first steps with VC++ and the basics of C++ programming under Windows. Once you've got the basics, just read under "External languages" how to write a lite-C plugin. It's really easy, but you need at least some basic understanding of VC++ and the plugin SDK. Otherwise you'll only get frustration, but not a working plugin.

http://manual.conitec.net/prog_started.htm

Re: Visual Studio 2003 [Re: Tor] #111554
02/18/07 22:55
02/18/07 22:55
Joined: Nov 2005
Posts: 94
Texas
3
3Dski Offline
Junior Member
3Dski  Offline
Junior Member
3

Joined: Nov 2005
Posts: 94
Texas
Tor, I don't know if this will be helpful, but I've been going through the same troubles, but not with the "Plugin" or "engine" SDK, rather with the LiteC "legacy mode" samples in the "work" directory. I can now tell you some things to look out for if your are trying to compile these under VS .NET 2003.

First, make sure all common paths for "includes" and "libraries" (for any Windows project) come before those you add, under "Tools/Optins/Projects/VC ++ directories. You can use the little up and down arrow controls to move items up or down the list. If you are wondering if the includes are being used in the expected order, under the project's properties "C/C++", under "Advanced" you can set "Show Includes" to "Yes".

Now, I was working with HelloWorld.c when I ran into troubles, so some of what I had to do may be specific to this project. But, I had to change the calling convention to "__stdcall", under "C/C++","Advanced","Calling Convention". On this same property page, I had to set "Compile As" to "Compile as C++ Code". I think this is because the tools are trying to go by the ".c" extention of the source, so confused. And, just to be sure, since this project is a Windows EXE, set "Linker/System/Subsystem" to "Windows"; this should already be the case if you created an empty Win32 project.

The above fixed all my problems, except for an "unresolved _WinMainCRTStartup"; or something on that order. Though it sounds like the tools are supposed to be smart enough to know and identify the "entry point" to the Windows app, I had to explicitly set this to "WinMain", under "Linker/Advanced/Entry point".

So, if you ever want to try out building some of the "legacy mode" apps under Lite-C's "work" directory, you hopefully won't have to spend the hours I did trying to get the simplest app to comile and run

Re: Visual Studio 2003 [Re: 3Dski] #111555
02/19/07 10:51
02/19/07 10:51
Joined: Apr 2006
Posts: 136
San Francisco
T
Tor Offline OP
Member
Tor  Offline OP
Member
T

Joined: Apr 2006
Posts: 136
San Francisco
Oh! About the .c thing. I was scrounging around in the help files and I think I saw somewhere that it says to rename them to .cpp files to avoid the .c thing.

Ah.

The entry point. Yea, I will have to play around with that later at some point. More about linkers I haven't gotten (they really don't teach yo uthat much about that in school I'm afraid. Other than the makefiles we used to do in linux).

I must admit tho, after my initial panic at the lack of multiplayer in lite-c, I've reworked that creating a mutliplayer .dll is more likely than convering the entire project over to C++ code (calling the engine, etc). But yea, I totally didn't think of calling the code in like that. (duh!)

I must admit, linking in for the .dll project is significantly easier. Just a few lib includes and seetting the header path. >_<

thanks for the help tho!
-T


"Towlie, you're the worst character ever." I know...
Re: Visual Studio 2003 [Re: Tor] #111556
02/19/07 16:44
02/19/07 16:44
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
For compiling a legacy lite-C project with VC++ 2003, use the mandelbrot_legacy.c script. It's prepared to compile with VC++. The other legagy projects would require some little modifications. And yes, you need to either rename it to .cpp, or change the VC++ .c settings (see the comment in the source code).

Re: Visual Studio 2003 [Re: jcl] #111557
03/03/07 00:31
03/03/07 00:31
Joined: Apr 2006
Posts: 136
San Francisco
T
Tor Offline OP
Member
Tor  Offline OP
Member
T

Joined: Apr 2006
Posts: 136
San Francisco
OK, I tried compiling the mandelbro_legacy.c script. I changed it over to .cpp and included the c:/programfiles/litec/include folder in the additional headers directory and I'm getting over 100 compiler errors.

I have a feeling it's cuz everything else is still named .c, how do I change visual studio to treat all .c files as C++?

I'm not a visual studio noob, I've been using it for at least 6 years (since VS 6) but I've never run into a situation where I've needed ot change the way files compile (never made my own scripting language like this? haha).

Albeit, I will admit, I'm not totally on top of the VS linker... What are the different linking steps in VS 2003 for pure/legacy mode? thanks!


"Towlie, you're the worst character ever." I know...
Re: Visual Studio 2003 [Re: Tor] #111558
03/03/07 10:37
03/03/07 10:37
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Ok - I certainly believe that you get 100 errors (or more) when you put the lite-C include files in the VC++ include path. Bill Gates has not yet managed to adapt Visual Studio to lite-C, so the lite-C include files won't go well with VC++.

I explain what to do step by step. With 6 years experience you probably won't need an introduction into the first steps with VC++ 2003 , but here's it anyway:

1. Start VC++ 2003. First you need to create an empty project. Select File / New / Project / Win32 Project. In the field below enter the project name, like "Mandelbrot_Legacy", then click OK. In the following dialog check "Empty Project" under "Application Settings", then click "Finish". VC++ will now create a project for you.

2. Copy mandelbrot_legacy.c into the project folder that VC++ has created, and rename it to .cpp (you're using classes, so it's a C++ program). Add it to the project: In the VC++ Solution explorer, right click on "Source Files", and select Add / Add Existing Item / mandelbrot_legacy.cpp. That should be the only file of the project.

3. Because VC++ does not know about the lite-C includes, you need to edit the path to the litec.h file. Edit the first "#include" line, and give the path to litec.h in double quotes, like this:

#include "C:\program files\litec\include\litec.h"

4. Compile it with Build \ Build Solution, then run it with Debug \ Start.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1