Re: C++/TCL Need Solution to Compile Error c2784



JesusChuyCampos@xxxxxxxxx wrote:

David,

I got one more question. Do I have to tell the compiler to load the
jnior.dll or does it have to be part of the source code.

It needs to be part of the link. That's what the .lib file is for.

Here are the
error messages that I'm getting. What compiler are you using?

MSVC++ 6 (an oldie, but works for me)

error04.txt
===================================== START
jnior310tcl2.c
c:\program files\tcl_tk\tcl_c_api2\jnior_300.h(19) : warning C4031:
second formal parameter list longer than the first list
c:\program files\tcl_tk\tcl_c_api2\jnior_300.h(19) : warning C4028:
formal parameter 1 different from declaration
c:\program files\tcl_tk\tcl_c_api2\jnior_300.h(19) : warning C4142:
benign redefinition of type
c:\program files\tcl_tk\tcl_c_api2\jnior_300.h(19) : warning C4273:
'GetVersion' : inconsistent dll linkage
C:\Program Files\Microsoft Visual Studio\VC98\include
\winbase.h(1116) : see previous definition of 'GetVersion'

^-- All problems with the jnior header file's definition of GetVersion(). The
same function name is exported by windows, too. You could get around it by using
C++ namespaces like so:

namespace jnior {
# include "jnior_300.h"
}

Then the function would be jnior::GetVersion() and wouldn't clash. All other
jnior functions and types would be in that namespace as well. How the linker
would resolve that, I'm not sure off-hand.


Creating library jniortcl2.lib and object jniortcl2.exp
jnior310tcl2.obj : error LNK2019: unresolved external symbol
_Connect@20 referenced in function _ConnectCmd
jnior310tcl2.obj : error LNK2019: unresolved external symbol
_Disconnect@4 referenced in function _DisconnectCmd
jniortcl2.dll : fatal error LNK1120: 2 unresolved externals
===================================== STOP


Make sure jnior300.lib is in your list of libraries you link to and the path to
find it is there too.


I guess my biggest problem is with the compiler. I got IT to re-
installed MS Visual Studio 6 (because we have a spare license), and
that just gave me more problems, and I then had IT re-installed MS VC+
+ 2005 "Express Edition", since it has a 30 day trial, but it is
missing the "window.h", so now I'm trying to link libraries from both
compilers.

-JC

Cross-pollinating compilers voids your warranty ;) Just joking, should work fine.
There's always the "Platform SDK" from MSDN if you need the window.h stuff, but
it's rather a big download as I remember.

About you only get using an IDE environment is the ability to step-debug your
application, which may or may not be needed for your project. I like free
compilers, myself.. there's nothing wrong with them.

--
"But the important thing is persistence." -Calvin trying to juggle eggs

Attachment: signature.asc
Description: OpenPGP digital signature



Relevant Pages

  • Re: GCC
    ... The header names changed explicitly to ... The Standard says that the standard ... that did not put iostream into the std namespace. ... and compilers change along with them. ...
    (Debian-User)
  • Re: include headers: <X>, <X.h> and global namespaces
    ... >int strlen ... >keep standard library definitions out of the global namespace. ... some compilers have "strlen" as a compiler ... C++ FAQ: http://www.parashift.com/c++-faq-lite/ ...
    (comp.lang.cpp)
  • Re: Code question that involves namespaces, templates and classes
    ... > Because the namespace is the first name found (since it's the first ... > name available in all scopes searched). ... class TBeta: public TAlpha ... Even programmers that create compilers are capabable of making mistakes. ...
    (comp.lang.cpp)
  • Re: Need VC6 workaround for function template
    ... use a real name for the namespace and ... This might require creating another template function (e.g. ... template<typename Target, typename Source> ... sub-standard compilers like that of VC6. ...
    (microsoft.public.vc.language)
  • Re: Are numeric constants in a namespace visible globally?
    ... > Thanks alot for clearing that up, Rob. ... Many compilers implemented the style headers thus: ... namespace std ... C; // ADL ...
    (comp.lang.cpp)