need help with C++
#1

Hey all

I'm new at C++ but i need a plugin
so i will ask you guys

I made a start with Microsoft visual C++
and i made something easy like this:

http://hamptonin.pastebin.com/m74a96006

But i got errors with compiling:
Код:
1>------ Build started: Project: test, Configuration: Release Win32 ------
1>Compiling...
1>test.cpp
1>Linking...
1>test.obj : error LNK2001: unresolved external symbol _amx_Register
1>test.obj : error LNK2001: unresolved external symbol "void * pAMXFunctions" (?pAMXFunctions@@3PAXA)
1>H:\Plugin\test\Release\test.dll : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://H:\Plugin\test\Release\BuildLog.htm"
1>tsg - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Hamptonin
Reply
#2

include export.def witch comes with sa-mp SDK
Reply
#3

Quote:
Originally Posted by GNeoncore
include export.def witch comes with sa-mp SDK
i don't have any export.dev

Код:
fatal error C1083: Cannot open include file: 'export.def': No such file or directory
Reply
#4

Add the file "amxplugin.cpp" (Located in the SDK folder) to your project solution.
Reply
#5

Quote:
Originally Posted by JakeB
Add the file "amxplugin.cpp" (Located in the SDK folder) to your project solution.
it compiles now but i got 1 warning:

Код:
1>H:\Plugin\test\test.cpp(49) : warning C4700: uninitialized local variable 'arg' used
Reply
#6

This mean you didn't give any value to that variable and try to use it.

Add this line under the declaration anyway:

amx_StrParam(amx, params[1], arg);
Reply
#7

The best thing too do is that you must buy a book about C++.
It helps you a lot!

- Creed
Reply
#8

Quote:
Originally Posted by 0rb
This mean you didn't give any value to that variable and try to use it.

Add this line under the declaration anyway:

amx_StrParam(amx, params[1], arg);
Thanks it compiles good

but now the next problem

in SA-MP Console:

Код:
[19:28:02] Loading plugin: test
[19:28:02]  Plugin does not conform to architecture.
[19:28:02]  Failed.
[19:28:02] Loaded 0 plugins.
Reply
#9

Sorry for double post but can anybody help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)