Link to home
Start Free TrialLog in
Avatar of emily_hall
emily_hall

asked on

tli file syntax errors

I have a C++ file and it imports from a C# library like this:

#import "myLib.tlb"
using namespace myLib;

When I compile I get tons of syntx errors in the tli file - this is a file that is automatically generated right?

error C2059: syntax error : '::'
error C2059: syntax error : 'constant'
error C2143: syntax error : missing ';' before '::'
error C2143: syntax error : missing ';' before '{'
error C2238: unexpected token(s) preceding ';'
error C2447: '{' : missing function header (old-style formal list?)
error C2589: 'constant' : illegal token on right side of '::'
warning C4091: 'inline ' : ignored on left of 'long' when no variable is declared
warning C4278: 'WM_USER': identifier in type library 'myLib.tlb' is already a macro; use the 'rename' qualifier

any ideas?
Avatar of ikework
ikework
Flag of Germany image

sounds like a c# - question, you better ask it in the c# - area ....
Avatar of emily_hall
emily_hall

ASKER

My automatically generated C++ code is what is not compiling.  Using my C# library from my other application which is in VB.NET has never given me any problems.

I think the problem lies with the way I import the library in C++...

 

I found the problem - had a function called WM_USER() in the C# library which C++ did not like.  Changed the name and all is well.
ASKER CERTIFIED SOLUTION
Avatar of CetusMOD
CetusMOD
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial