0 registered members (),
18,580
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Visual Studio 2003
#111550
02/10/07 04:51
02/10/07 04:51
|
Joined: Apr 2006
Posts: 136 San Francisco
Tor
OP
Member
|
OP
Member
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: jcl]
#111552
02/11/07 22:22
02/11/07 22:22
|
Joined: Apr 2006
Posts: 136 San Francisco
Tor
OP
Member
|
OP
Member
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]
#111554
02/18/07 22:55
02/18/07 22:55
|
Joined: Nov 2005
Posts: 94 Texas
3Dski
Junior Member
|
Junior Member
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
Tor
OP
Member
|
OP
Member
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: jcl]
#111557
03/03/07 00:31
03/03/07 00:31
|
Joined: Apr 2006
Posts: 136 San Francisco
Tor
OP
Member
|
OP
Member
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

Chief Engineer
|

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.
|
|
|
|